View Full Version : Stop the installation with a custom action

12-05-2004, 02:05 AM
How can I stop the installation with a custom action? It should be the same thing as when clicking on Cancel: installation stops and rollbacks.


Christopher Painter
12-05-2004, 08:43 AM
Just set the CA return processing for "Sync. Checks Exit Code". If your custom action returns a failure exit code the CA will force the install to stop. If you happen to be within a rollback transaction it will also do a rollback.

How to generate the exit code depends on whether your calling a DLL, EXE, VBScript, JScript or InstallScript. If you need help I'll follow up once I know what your using.

12-05-2004, 11:54 AM
Please see, for example, this InstallShield newsletter tip: http://www.installshield.com/news/newsletter/0308-articles/msi.asp.

12-07-2004, 06:21 AM
First- thank you for your help. With your ideas- the installation stopes and that's great, but I also need the installation to delete all the registry keys it created, remove the files it copied duing the installation etc, everything it made. I can not use installScript.

Christopher Painter
12-07-2004, 07:49 AM
Provided that all of the resources you mentioned were installed by windows installer and now some custom action you can accomplish this with a rollback. Rollbacks only occur during the execute sequence between InstallInitialize and InstallFinalize. Checkout the below link for a pretty thorough explanation of custom action scheduling and execution: