Forcing an early exit - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

Jebrew
Posts: 53
Joined: Thu Jan 18, 2007 8:53 pm

Forcing an early exit

Okay, so I've got it setup so that I call an external uninstall program that may or may not run to completion. If the uninstall fails, I have a function that catches that, so I need to exit from the install on the second screen (I've put in one indicating that the external uninstall will run right after the Welcome Screen). I've put an "EndDialog" action with the argument "Return" that triggers if the other uninstaller fails. The problem is that after the EndDialog is hit, the installer skips directly to the progress dialog and attempts to install the software. I previously had it setup to do a NewDialog using the ExitDialog as my target if the external uninstall failed and it would go to the ExitDialog just fine, but then jump to the ProgressDialog when the user pressed Finish.

Needless to say, somewhere along the way, I've messed up my dialog order, but I can't figure out where, and in particular, there is no reference to the ProgressDialog from the dialog where the user is told that the uninstall will run.

Please help...I'll stop rambling now.

Jebrew
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

In the custom action that runs the uninstaller you need to exit with an error code (3) to indicate that the custom action was failed and in this case the installation will stop.

Here is a VBS custom action that stops the installation:

Code: Select all

Function TestFunction()
   TestFunction = 3
End Function 
For testing add this code to a .vbs file and use it as "Attached Custom Action" and type TestFunction as function name field.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”