Remove/Replace Registry entries? - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

ssearles
Posts: 65
Joined: Tue Oct 30, 2007 12:54 pm

Remove/Replace Registry entries?

I have an installer that writes a specific set of registry entries (in this case to the HKCU), but in some cases the key/entry may already exist (from an old installer or configuration) on the machine but are needing to be replaced by my latest ones.

How can I automatically remove the entries (and all subkeys) if they exist AND then write the new ones I want in their place... preferably without dialogs or actions by the user?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

Please note that the registry value in your installation package will automatically replace an existing value in the registry (you don't have to set any option).

Also, for the string values you have the following options:
- Prepend the string(s) entered in the Data field to any existing registry value strings
- Append the string(s) entered in the Data field to any existing registry value strings
- Replace the existing registry value with the string(s) entered in the Data field

You can read more about the "Registry" page here:
http://www.advancedinstaller.com/user-g ... istry.html
http://www.advancedinstaller.com/user-g ... ialog.html

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ssearles
Posts: 65
Joined: Tue Oct 30, 2007 12:54 pm

Not sure my meaning came across

In the case of existing keys/subkeys... there may be ones in the computer that I would need to remove because their existence (that my installer would be unaware of in advance) may conflict with the new ones that i want.

For instance... I may be now writing only 8 specific keys, but the computer may actually have 10 keys already (old config, users modifications, whatever). Now if only 6 keys are in common between my installer and the computer, then I would end up with 12 keys in the hive, four of which I don't want and may cause my application to crash or be incorrectly configured.

What i would want to do it automatically remove the 10 keys in the computer, just before writing my 8 in their place regardless of the values (i.e. my keys trump all others).


Hope this is clearer.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

This can be done by a custom action which removes the main registry key (the one which contains all the other subkeys). There is a sample custom action here:
http://www.activexperts.com/activmonito ... RegKey.htm

Note that this custom action must be scheduled before the "WriteRegistryValues" standard action (when the registry entries in your package are created). You can see a standard action by using the "Show Standard Action" button on the toolbar in the "Custom Actions" page.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”