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?
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 toData\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
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?
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.