View Full Version : Custom Uninstall actions don't get run

10-30-2001, 02:35 PM
I've bought installshield express and am fairly happy so far, considering that it is a work-related product and all...

I'm installing a service. I have a custom action that registers the service once it's installed, and that works fine.

I have a custom action to unregister the service at uninstall time. It does not run. It's not that it doesn't work - it just doesn't get run at all. I've verified that it isn't being run by writing a simple exe that displays a message box and using it as a custom action at both install and uninstall times. I see the install custom action, but not the uninstall. I 've chosen a number of different execute points but nothing seems to do the trick.

I *have* been doing quite a few install/uninstall cycles on my machine. Is it possible that some uninstall thingie isn't getting updated properly from previous installs?

Is there something obvious that I'm missing? People do use this, right? It was tested and all... right?

Jim Kang
10-30-2001, 07:32 PM
1. What's your Invoke property set to?
2. Is your CA a dll or exe?
3. If you replace it with notepad.exe, does notepad get launched during uninstall? If not, can you strip everything out of the setup except the CA and post it here?

10-30-2001, 08:16 PM
invoke is set to 'after ready to remove dialog'. the CA is an exe created with VC++ - it's very simple, and the install-time CA runs fine and does it's job.

I have 2 CAs - one for install, one for uninstall. I *wanted* to use the same CA since the program is practically all of 8 lines long, even with the two options. (it's just a few system() calls)

I did try with notepad and no dice. I also tried with notepad and a reboot before uninstalling. I'll try to do a minimal dummy install that has a problem and get back here. thanks.

10-31-2001, 09:21 AM
Are you by ANY chance calling the same file for both Custom Actions? There is a bug in Express 3.5 (pretty sure about this) where at build time one of the files is overwritten instead of having a new entry. If they are the same file, try making a copy of the file and renaming it. During install use the original for the Custom Action, and during uninstall use the renamed copy.

10-31-2001, 06:56 PM
here's a simple minimal install that illustrates the problem. There are three .exes - MyProgram (the install target) InstallAction and UninstallAction. I believe I have everything set up right in the install, and InstallAction does run when I install, but UninstallAction never runs at uninstall time.


be sure to unzip the files with path info preserved.

10-31-2001, 06:58 PM
(dammit) the .zip file is to big to upload here...

trying another url

11-01-2001, 09:54 AM
I tried your project and the Custom Action is launched during unsinstall as well. I tried it on a WInNT system. What OS are you trying it on?

Another thing to try. Install your product. Now go to command line. Browse to the location of the setup. From the command line type:

Setup.exe /v"/lv C:\Install.log"

This will create the uninstallation log. Matbe this will give us a clue as to why your Custom Action is not running on your machine. You can send the log file to chandimar@installshield.com and I will take a look.

11-01-2001, 02:19 PM
I tried that - if I run the setup program as described the uninstall action runs. the log file shows that as well, with these lines...

Action start 10:55:51: Uninstall_Action.
Action ended 10:56:15: Uninstall_Action. Return value 1.

but, if I use add/remove programs and choose remove for that program, the uninstall action does not run. is there a way to modify the registry such that the uninstall will create a log file?

what's interesting here is that if I run the uninstall by hand, either by typing the registry install string - MsiExec.exe /I{B02C3C47-AE11-4A86-8E9B-B95828FC6954} - or by typing Setup.exe /v"/lv C:\Install.log", I see a dialog that offers me the option of install, modify, or remove. choosing remove runs uninstall and the action runs.

If I use add/remove from the control panel, I do not see this dialog. the the program components are removed, but the uninstall action does not run.


11-01-2001, 02:33 PM
btw, Windoze 2000, sp5

11-01-2001, 02:41 PM
if I uninstall my program by running msiexec /i{guid} and choosing remove, the custom action runs.

but if I uninstall my program by running msiexec /x{guid}, the custom action does not run. /x appears to be what is used by the remove button of the add/remove programs dialog.

11-01-2001, 03:06 PM
Per communication from Chandima Rajakaruna - if I disable the remove button and force the user to go through the change dialog to remove the product, the action is performed. This isn't optimal (I would prefer that the remove button be enabled and work properly, and I don't offer a change or repair option, which might confuse my users) but it does work, and I'm in a pragmatic frame of mind right now. Thanks.