Change what happens when a user uninstalls from add/remove programs
Hey everybody . . . I am 2 months old at repackaging (I know, EVERYBODY loves a newbie, har har). I am trying to figure out how to change what command is executed when a user clicks Remove from add/remove programs under control panel. I have had mixed results with just changing the registry value under HKLM\Software\Microsoft\Windows\Current Version\Uninstall\{GUID}\Uninstall String. Sometimes changing this value works, other times it doesn't. I have heard that the Windows Installer service keeps a database which can override the value in that string and substitute its own.
Is this true? If so, is there a way to write a script to change the value within that database?
Thanks for your help. I really appreciate it.
Jim
Is this true? If so, is there a way to write a script to change the value within that database?
Thanks for your help. I really appreciate it.
Jim
0 Comments
[ + ] Show comments
Answers (7)
Please log in to answer
Posted by:
anonymous_9363
17 years ago
Posted by:
jimpross
17 years ago
Wellsir, we are packaging to meet the rather stringent demands of a large corporation who wants everything to be uniform across the enterprise. That means that we can't always do everything we want to within an MSI. We usually wrap our MSIs inside a Nullsoft package which often includes actions that are executed after the MSI is installed. When possible, we create custom actions (often VB scripts) within the MSI, but that's not always possible. If the uninstall is simply reversing what the MSI did, our extra actions within the Nullsoft package aren't reversed.
I appreciate any help you can give me.
Jim
I appreciate any help you can give me.
Jim
Posted by:
sh79
17 years ago
So you would like your msi uninstall in ARP to remove all the additional changes made by your wrapper as well as removal of the msi?
Why don't you add custom actions to you msi that only run on uninstall that will reverse the changes made by the extra wrapper stuff?
That way only your msi need be activated as usual.. no other processing is required outside of the msi uninstall.
Why don't you add custom actions to you msi that only run on uninstall that will reverse the changes made by the extra wrapper stuff?
That way only your msi need be activated as usual.. no other processing is required outside of the msi uninstall.
Posted by:
jimpross
17 years ago
Posted by:
anonymous_9363
17 years ago
The Installer database is the MSI: you mean the Installer's application installation data which is stored in the registry. You have the location right, BTW.
My point would be that if the NullSoft wrapper is making changes after the MSI has run, then it should be made to undo those changes. It's exactly the same situation with MSIs: any install action has to be accompanied by an uninstall action. Trying to shoe-horn after-the-event actions in the way you propose is, in my opinion, doomed to failure.
My point would be that if the NullSoft wrapper is making changes after the MSI has run, then it should be made to undo those changes. It's exactly the same situation with MSIs: any install action has to be accompanied by an uninstall action. Trying to shoe-horn after-the-event actions in the way you propose is, in my opinion, doomed to failure.
Posted by:
jimpross
17 years ago
Well, that's what I'm trying to do. Since the NSIS wrapper does stuff beyond what the MSI does, I would like to call that same NSIS package at uninstall so it can undo what it did at install.
But from my tests I have found that changing the registry key will not always change what command is executed at uninstall. I have changed the key before and made it point to a Nullsoft executable only to have the original MSI called at uninstall (with the /x switch). So something overrides the registry at times, and I have heard that it has something to do with the Windows Installer service. That's what I would like to modify, to ensure that the original Nullsoft wrapper is called at uninstall, to undo what it did at install time.
But from my tests I have found that changing the registry key will not always change what command is executed at uninstall. I have changed the key before and made it point to a Nullsoft executable only to have the original MSI called at uninstall (with the /x switch). So something overrides the registry at times, and I have heard that it has something to do with the Windows Installer service. That's what I would like to modify, to ensure that the original Nullsoft wrapper is called at uninstall, to undo what it did at install time.
Posted by:
jimpross
17 years ago
Well, my colleague figured it out. In the MSI, you have to set the property ARPSYSTEMCOMPONENT to 1. This keeps an entry for the software from showing up in Add/Remove programs. Then you write keys to HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\<application_name> . Under that you need subkeys for DisplayName and UninstallString, and voila! An entry displays for your application, but it isn't automatically just running the msiexec on the msi with a /X . You can determine what exactly you want to happen. In my case, it's often to call the msi again with /X, but also to do some other actions. That way you're not tied to having everything inside the MSI for it to uninstall properly. Heck yes!
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.