You are here

Meaning of a statement in the documantation regarding the section [RegistryKeys]

4 posts / 0 new
Last post
tapsklaps
Offline
Last seen: 5 years 6 months ago
Developer
Joined: 2010-10-17 08:11
Meaning of a statement in the documantation regarding the section [RegistryKeys]

In the documantation regarding the section [RegistryKeys] I found the following statement:

If you do not wish to save the data of the registry key to a file but only want to keep it safe and throw away any changes, set the “file name” to -, so you end up with -=registry key location.

I've been thinking about the meaning of this statement.

Suppose, that a registry key called "HKCU\Software\AppName" already exists (ie. this registry key won't created by the portable app). If in this case the portable app use this registry key, then any changes of this registry key (performed by this portable app) would throw away through the following code:

-=HKCU\Software\AppName

Accordingly, the registry key stay unchanged with its original values.

Are my above statements so far on this issue correctly?

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 8 years 10 months ago
Joined: 2007-04-15 21:08
Not quite

As a general rule, you don't want portable and local to mix at all. - will clear the local data while the app is running; it functions just the same as any other [RegistryKeys] section, except that it skips saving to Data\settings\-.reg.

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

tapsklaps
Offline
Last seen: 5 years 6 months ago
Developer
Joined: 2010-10-17 08:11
Clarification

If I understood you correctly, then the code "-=HKCU\Software\AppName" means, that a portable program creates the registry key "HKCU\Software\AppName" as usual. After the closure of the program, the registry key "HKCU\Software\AppName" is deleted. However, in this case no corresponding file "appname.reg" (you call this file suitable "-. reg") stored in the folder Data\settings. Is that correct so far?

Aluísio A. S. G.
Offline
Last seen: 7 years 9 months ago
DeveloperTranslator
Joined: 2010-11-09 17:43
Correct

The key is backed up in the Registry itself (in HKCU\Software\PortableApps.com\...). Then it's deleted and the program is executed. After it is done, the key is deleted and the backup is moved to its original location.

Previously known as kAlug.

Log in or register to post comments