3

I created a vbscript custom action which checks for some registry keys and alters them if neccessary. In case a key could not be written or something like that, the setup should be aborted.

In order to achieve this, I set a property which I tried to use as a condition for the next step within the execute sequence but this does not work.

I found out that this can not work since the custom action cannot write the property at the time it is executed.

So the question is: How can I achieve an abort of installation depending on what my custom action says? Is there a method to pass an "abort installation request" to the Installer or something like that?

Marcus
  • 1,105
  • 2
  • 21
  • 35

2 Answers2

3

If you search on http://community.installshield.com you'll find an article by Robert Dickau entitled "Exiting an MSI Installation from a Custom Action". It's at the following link:

http://community.installshield.com/showthread.php?p=418197

Here's the snippet of code he uses as his example:

Function ExitSetupFromVBS( )

Const IDABORT = 3

    ' ...do some work...

    ' abort the installation
    ExitSetupFromVBS = IDABORT

End Function

Good luck.

Ken
  • 326
  • 1
  • 9
  • 1
    That link doesn't work anymore, here's the new link http://community.flexerasoftware.com/showthread.php?181383-Exiting-an-MSI-Installation-from-a-Custom-Action – barsh Jan 21 '14 at 23:08
0

You should need return 3 from your function for a fail and 0 or 1 for success.

Here is a msdn article on the topic : http://msdn.microsoft.com/en-us/library/aa371254(VS.85).aspx

Make sure you put your script in a function.

Web
  • 1,735
  • 2
  • 22
  • 36