cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Mark_M
Level 2

Stop installation from VBScript in Web project

I have a web install project that is automatically uninstalling previous instances of the software (as it should). However, I want to display a dialog box to the users to confirm the removal of the local data along with the other files. I have created a VBScript custom action to do this, however my issue is that I can't seem to exit the install process from the custom action. I have tried various ways to create the VBScript, but it seems most people on these boards say to use a function, so this is what I currently have:

function ConfirmUninstall()
retval = msgbox ("A previous version is installed. If you continue, all existing data will be lost. Continue?", 4, "Warning!")
if retval = 7 then
' exit the installation
ConfirmUninstall = 1602
end if
end function
ConfirmUninstall()

One post suggested that any non-zero exit code will cause the installer to quit. However, this doesn't seem to be the case in a web project unless I am mistaken.

My question is simply, how do I make the install sequence actually exit from a web project?

Any help is greatly appreciated!

EDIT:
Some additional info -
I have inserted the Custom Action in the Execution Sequence right after the Setup Initialization. This CA has a condition to only execute if there is an existing installation. The message box does pop up at the right time, but the install doesn't exit.
The CA properties are:
Synchronous (check exit code)
Immediate Execution
Labels (1)
0 Kudos
(2) Replies
RobertDickau
Flexera Alumni

One thing to check is, is your VBScript in an external file? For some reason, VBScript action functions with the VBScript code embedded in the CustomAction table can't return a value.

Also, perhaps have the function return the value 3 (IDABORT) when you want to exit?
0 Kudos
Mark_M
Level 2

Thanks Robert. It seems that using the script directly in the custom action was the cause. As soon as I moved it to the .vbs file, it worked like a charm.

Thanks again!
0 Kudos