Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
johnmarsden
Level 7

Could a user's registry be non-writeable?

Is there any chance that a user's registry may be no writeable for some reason.. whether it be storage restraints or something of the kind? My assumption was that each app installed as a certain amount of allocated/guaranteed registry storage, but I'm not sure.

I'm getting some reports from customers that certain settings aren't saving for them... but they're saving correctly on all my devices. My only guess is that it could be something related to registry. 
0 Kudos
2 Replies
EnTerr
Level 8

Re: Could a user's registry be non-writeable?

It surely is possible - and the case i have in mind is when you have stored too much info in the registry, then flushing to disk fails. You should check on the return of .flush() - notice how most functions return Boolean
0 Kudos
Komag
Level 9

Re: Could a user's registry be non-writeable?

I use this to count my registry size
FUNCTION getRegSize(report AS BOOLEAN) AS INTEGER ' trig by saveAll(1) report False, and for testing from console where report may be True
sz = 30 ' Header for the whole registry
r = CreateObject("roRegistry")
secList = r.GetSectionList()
FOR EACH name IN secList
secSz = 8 ' A small header for each registry section (2 bytes plus section name, assume 6 more bytes)
sec = CreateObject("roRegistrySection", name)
keyList = sec.GetKeyList()
FOR EACH key IN keyList
val = sec.Read(key)
secSz = secSz + Len(val) + 4 ' Headers - add 2 bytes for the key and 2 bytes for the value
END FOR
IF report THEN ? "getRegSize() sec name " name ", secSz" secSz
sz = sz + secSz ' Add this section's secSz to the overall sz
END FOR
IF report THEN ? "getRegSize() overall sz" sz
RETURN sz
END FUNCTION
0 Kudos