You are here

Registry Moves

1 post / 0 new
englishman
Offline
Last seen: 11 years 2 months ago
Joined: 2010-02-03 11:10
Registry Moves

Just need to get my head around the [RegistryKeys] launcher entries...

So taking the example

[RegistryKeys]
app=HKCU\software\app

On launch
If there is no registry file in %PAL:DataDir%\settings, the live registry key is backed up and then deleted. There will be no key left in the live registry.
If there is a registry file in %PAL:DataDir%\settings the live registry key is deleted and backed up and replaced by the %PAL:DataDir%\settings entry.

At end of run
The live registry key is moved to %PAL:DataDir%\settings (overwriting any existing file) and the backed up key is restored to the live registry. If there is no backed up key, the live registry key will be left empty. The backed up copy if it is exists is deleted.

Now looking at the other methods...

[RegistryKeys]
-=HKCU\software\app

On launch
The live registry key, if it exists, is backed up then deleted. There will always be no key left in the live registry. Any key that happens to exist in %PAL:DataDir%\settings is ignored.

At end of run
The backed up registry key, if it is exists, is restored. The backed up copy is deleted. Nothing ever gets written to %PAL:DataDir%\settings

Please could someone check and correct my understanding based on 2.1 Beta launcher.

A couple of questions...

1. If the above is correct, is there a way where, on launch, you would want the live registry key backed up, but you would actually still want a copy of it in the live registry - rather than being deleted or being overwritten by a copy in %PAL:DataDir%\settings?

2. As I understand it, all [RegistryKeys] entries will also move any subkeys, such as HKCU\software\app\subkey. Is there a way of defining an entry so that subkeys are not moved? Such as:

[RegistryKeys]
app=HKCU\software\app]

The ']' defining that only the values from this key are copied/restored and none from any subkeys that may exist. There are some registry keys that have lots of subkeys, but sometimes you are only ever interested in the values in the top-level keys. Control Panel\Desktop is an example. Again, my understanding may be incorrect, so would appreciate clarification.

Thanks