cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
marcovdlinden
Level 4

Uninstall deletes to many registry entries

Installscript project

We have multiple applications and we store some setting during installation in this way:
RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
RegDBSetKeyValueEx ( "Software\\Company Name\\"+IFX_PRODUCT_NAME, "ID", REGDB_STRING, ID, -1 );



works fine, on uninstall however, it deletes the entire 'Company Name' tree including settings made by other applications in their own sub keys.
Why? and how can we prevent this.
I'm not even sure why it deletes anything at all, reading the help on the function it mentions that it only deletes keys when they were created by RegDBCreateKeyEx

note: these projects have no other regestry entries in the installation, it only has those made by RegDBSetKeyValueEx calls.

any help to prevent deleting of the entire tree would be much apreciated
Labels (1)
0 Kudos
2 Replies
marcovdlinden
Level 4

Some more time searching the forums showed me that this problem exists since atleast 2002. 😞

Atleast there seems to be a work arround which I'm gona test:
Disable(LOGGING) / Enable(LOGGING) arround the key codes... but now they wont be removed at all...


Would still like to ask, if there is a proper solution to this, or if this is a bug and if so when that will be fixed.
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

The docs are unfortunately incorrect in current releases of InstallShield. RegDBSetKeyValueEx calls RegDBCreateKeyEx passing the key from the szKey parameter to create it. RegDBCreateKeyEx will always log any keys it is called with (if logging is enabled), and will mark them as 'created' if the current install was the first to create the keys passed. In this case, when the project is uninstalled, any keys marked 'created' in the log are removed.

It is possible to create this registry information through the Registry view in InstallScript projects. This currently offers an additional option to mark registry keys as shared (by right-clicking a key then selecting "Shared among several applications"). The engine will take a slightly different approach during uninstall when removing keys marked as shared to attempt to avoid the situation you are seeing (keys created with RegDBCreateKeyEx are not marked as shared).

Note that you can view all registry keys that were logged during an installation and whether they were 'created' by the install using the InstallScript Cabinet and Log File Viewer from the Tools menu in InstallShield.
0 Kudos