writing registry key during uninstall - 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!

shelmers
Posts: 63
Joined: Thu Sep 03, 2009 9:02 pm
Location: Andover, Massachusetts USA

writing registry key during uninstall

Thanks to assistance in these forums, I now have an installer that prepends a value to an existing REG_SZ registry entry (AI’s prepend feature can only work with REG_MULTI_SZ entries). To accomplish this I used a search to extract the current value (let’s call is OLD_VALUE), an installation property (let’s call is MY_VALUE) and wrote back OLD_VALUE;MY_VALUE. Works great!

What I need to do now is set the reg key back to its original value during uninstall. So I have a couple of questions.

1) How do I write a registry key during uninstall? I don’t see a place to do that.

2) Does the AI search function operate during uninstall or just during install?

3) Are the values of installation properties like MY_VALUE preserved from install to uninstall? (I know this would require storing the values somewhere but it seems like this might happen… wishful thinking?)

I’m guessing I might have to write a VBScript to read, edit and rewrite the registry value but was hoping there might be an approach built into AI. Is there any difference between Professional and Enterprise for want I want to do?
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: writing registry key during uninstall

Hello,
1) How do I write a registry key during uninstall? I don’t see a place to do that.
This feature is not directly supported by Windows Installer. You can however place a "Launch File or Open URL" custom action in which you use the reg command line utility to write your registry value. Set its condition to only run during uninstall. If however you are doing a backup-restore to preserve a registry value, you can check out our guide on How to prevent a registry key from being overwritten.
2) Does the AI search function operate during uninstall or just during install?
The AppSearch Standard Action also executes during uninstall. This behavior is implemented by Windows Installer.
3) Are the values of installation properties like MY_VALUE preserved from install to uninstall? (I know this would require storing the values somewhere but it seems like this might happen… wishful thinking?)
No, values are not preserved unless you specifically write them somewhere, like in a file or the registry. However you can check out our guide on How to make properties in the package keep their values.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
shelmers
Posts: 63
Joined: Thu Sep 03, 2009 9:02 pm
Location: Andover, Massachusetts USA

Re: writing registry key during uninstall

Thanks for the excellent answers, Gabriel.

Return to “Common Problems”