This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- How to trigger error and abort installation from Installscript?
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 18, 2017
02:20 AM
How to trigger error and abort installation from Installscript?
Hello Guys,
I have to do error handling in my installer. One of the requirement is to abort the installation whenever any step fails in case of any error or exceptions. Additionally in some case trigger Rollback as well. Its a basic MSI project.
My current situation is, in case of any error conditions i will try to catch them in Catch block and want to trigger a dialog box with some custom error message and trigger abort or rollback based on the condition.
How can i accomplish this? I tried using "return ERROR_INSTALL_FAILURE;" but this is not triggering the error.
How to achieve it?
Please help. Its very important.
I have to do error handling in my installer. One of the requirement is to abort the installation whenever any step fails in case of any error or exceptions. Additionally in some case trigger Rollback as well. Its a basic MSI project.
My current situation is, in case of any error conditions i will try to catch them in Catch block and want to trigger a dialog box with some custom error message and trigger abort or rollback based on the condition.
How can i accomplish this? I tried using "return ERROR_INSTALL_FAILURE;" but this is not triggering the error.
How to achieve it?
Please help. Its very important.
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 18, 2017
08:15 AM
Post a message withMessageBox and then abort. Note that "The abort statement does not call a rollback if initiated after the OnFirstUIAfter event."
MessageBox( szMsg, SEVERE );
abort;
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 18, 2017
08:23 AM
rguggisberg wrote:
Post a message withMessageBox and then abort. Note that "The abort statement does not call a rollback if initiated after the OnFirstUIAfter event."
MessageBox( szMsg, SEVERE );
abort;
Hi rguggisberg,
Thanks for your response. This solution i know and quite simple way of handling. In my case its a suite installer, so dont have the privilege of using messagebox 😞
And moreover, i read abort statement will not work in windows OS 8.1 and above. This is official statement, however, fun fact is i tried abort in Win 10 and it works.
Can u post ur thoughts about using "return ERROR_INSTALL_FAILURE". that will be educational for me 😄
Respect for ur help and guidance 🙂
Thanks and bye.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 18, 2017
08:45 AM
ok.. your original post said Basic MSI. For a suite project you can set a property in your CA that you can then use as a condition to display a Secondary window (see bottom of Wizard page). In a suite project you may already have some of the packages installed. You will have to do your own rollback behavior.
Hope that helps.
Hope that helps.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 18, 2017
08:47 AM
rguggisberg wrote:
ok.. your original post said Basic MSI. For a suite project you can set a property in your CA that you can then use as a condition to display a Secondary window (see bottom of Wizard page). In a suite project you may already have some of the packages installed. You will have to do your own rollback behavior.
Hope that helps.
Thanks man, i will try that...sorry for the confusion for Basic MSI thing...