Discussion:
How hook my uninstall.exe?
(too old to reply)
Ken
2005-04-20 19:00:32 UTC
Permalink
I have created a uninstall.exe UI to uninstall my programs. All I
wanted is to provide a hook to this UI uninstall.exe instead of the
standard uninstall from Microsoft. Meaning, if the user clicks on the
Add/Remove myProgram, then it will call my uninstall.exe, and that is
it. How can I do that with the Windows Installer which came with the
VS.NET 2003?
Or the alternative is to have an UI as part of the unistall sequence
with checkboxes for me to perform custom actions which calls my
dosomething.exe.
Thanks.
Luke Surace
2005-04-20 22:33:49 UTC
Permalink
You can change this by editing the registry on install under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
Change the "UninstallString" to match your executable's path.

The will run you program when the user hits the "Remove" button.
You might also need to handle the "Modify" button.
Post by Ken
I have created a uninstall.exe UI to uninstall my programs. All I
wanted is to provide a hook to this UI uninstall.exe instead of the
standard uninstall from Microsoft. Meaning, if the user clicks on the
Add/Remove myProgram, then it will call my uninstall.exe, and that is
it. How can I do that with the Windows Installer which came with the
VS.NET 2003?
Or the alternative is to have an UI as part of the unistall sequence
with checkboxes for me to perform custom actions which calls my
dosomething.exe.
Thanks.
Phil Wilson
2005-04-21 02:07:13 UTC
Permalink
Unfortunately that doesn't work because MSI doesn't use it. MSI just does
the equivalent of msiexec /x {product guid} .
--
Phil Wilson
[Microsoft MVP-Windows Installer]
Post by Luke Surace
You can change this by editing the registry on install under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
Change the "UninstallString" to match your executable's path.
The will run you program when the user hits the "Remove" button.
You might also need to handle the "Modify" button.
Post by Ken
I have created a uninstall.exe UI to uninstall my programs. All I
wanted is to provide a hook to this UI uninstall.exe instead of the
standard uninstall from Microsoft. Meaning, if the user clicks on the
Add/Remove myProgram, then it will call my uninstall.exe, and that is
it. How can I do that with the Windows Installer which came with the
VS.NET 2003?
Or the alternative is to have an UI as part of the unistall sequence
with checkboxes for me to perform custom actions which calls my
dosomething.exe.
Thanks.
Ken
2005-04-21 13:25:08 UTC
Permalink
What do you suggest if the UninstallString does not work? Thanks.
mgama
2005-04-21 15:35:44 UTC
Permalink
I've been in a similar situation before, and what we did was set the
following MSI properties to be zero: ARPNOMODIFY, ARPNOREPAIR, ARPNOREMOVE,
ARPSYSTEMCOMPONENT. This means that the Windows Installer will not create an
Add/Remove entry for you. Someone may come along and say that only the last
one is required, which is true if you don't need to support Win9x. For
Win9x, you need all the properties set to zero. After doing that, the
Windows Installer won't create an ARP entry for you, you will need create
one yourself. Now you need to add your uninstall.exe to your setup, so it
will be installed on the users machine. Next you need to create your own
Add/Remove entry regkeys which will point to your uninstall.exe. You need to
add the following regkeys (this isn't a complete set of the regkeys, but it
gives a pretty good ARP user experience):

HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName]
String: DisplayName = [ProductName]
String: DisplayVersion = [ProductVersion]
String: Publisher = [Manufacturer]
String: UninstallString = [#FL_file_key_for_your_uninstall.exe]
String: UninstallPath = [#FL_file_key_for_your_uninstall.exe]
String: DisplayIcon = [#FL_file_key_for_your_uninstall.exe]
DWORD: Language = #[ProductLanguage]
String: InstallSource = [SourceDir]
String: URLInfoAbout = [ARPURLINFOABOUT]
String: HelpLink = [ARPHELPLINK]

That's about it. If you forget something, and you don't appear in the
add/remove applet, you can always uninstall your app by running: "msiexec /x
{your_product_code}" I assume your uninstall.exe will need to call that
anyway to remove your product. By calling msiexec /x, it will delete the ARP
regkeys. One problem you may encounter is it cannot delete the uninstall.exe
as it is in use. This may cause a prompt for a reboot on the uninstall.

When I had to use this approach, I just wanted one Add/Remove entry for our
suite of products. So our custom installation launcher installed each app
one after another, and the custom uninstaller did the same thing.
Post by Ken
What do you suggest if the UninstallString does not work? Thanks.
Ken
2005-04-21 19:39:15 UTC
Permalink
How do I go by setting MSI properties to be zero for ARPNOMODIFY,
ARPNOREPAIR, ARPNOREMOVE,ARPSYSTEMCOMPONENT? I tried ORCA but I could
not find those fields. Thanks.
mgama
2005-04-22 06:07:32 UTC
Permalink
You can create them if they are not present. Depending on what MSI
authoring tool you are using, you can probably add the new properties there,
or you can do so through Orca by right clicking in the Property table and
selecting add row.
Post by Ken
How do I go by setting MSI properties to be zero for ARPNOMODIFY,
ARPNOREPAIR, ARPNOREMOVE,ARPSYSTEMCOMPONENT? I tried ORCA but I could
not find those fields. Thanks.
Luke Surace
2005-04-21 22:20:09 UTC
Permalink
Yes you are correct Phil. Sorry for posting that misleading information

cheers,

Luke
Post by Phil Wilson
Unfortunately that doesn't work because MSI doesn't use it. MSI just does
the equivalent of msiexec /x {product guid} .
--
Phil Wilson
[Microsoft MVP-Windows Installer]
Post by Luke Surace
You can change this by editing the registry on install under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
Change the "UninstallString" to match your executable's path.
The will run you program when the user hits the "Remove" button.
You might also need to handle the "Modify" button.
Post by Ken
I have created a uninstall.exe UI to uninstall my programs. All I
wanted is to provide a hook to this UI uninstall.exe instead of the
standard uninstall from Microsoft. Meaning, if the user clicks on the
Add/Remove myProgram, then it will call my uninstall.exe, and that is
it. How can I do that with the Windows Installer which came with the
VS.NET 2003?
Or the alternative is to have an UI as part of the unistall sequence
with checkboxes for me to perform custom actions which calls my
dosomething.exe.
Thanks.
Continue reading on narkive:
Loading...