Scary error dialog when custom action returns nonzero code - 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!

czamara
Posts: 2
Joined: Thu May 24, 2007 10:58 pm

Scary error dialog when custom action returns nonzero code

I am running a custom action that I want to be able to stop installation if a certain condition is found on the target system. It will dislpay a message to the user and return a nonzero exit code in this case, in order to abort the installation and rollback any changes so far.

It almost works, but for some reason I am getting this weird error message that I definitely DON'T want the user to see:

"There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor."

My custom action is displaying the correct message to the user, and the above message is simply confusing, scary and inaccurate.

Is there any way to abort/rollback an installation from a custom action WITHOUT getting this extra error message?
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,
"There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor."
This is because you use an EXE custom action and EXE custom actions does not have access to the Windows Installer session.

My suggestion is to use a C++ DLL or a VBS custom action. Here is a VBS custom action example on how to give a message box and abort the installation:

Code: Select all

Function Test
MsgBox "Test message"
Test = 3
End Function
For a C++ DLL example please see flowing forum post:
http://www.advancedinstaller.com/forums ... =3848#3848
Return ERROR_INSTALL_FAILURE for abort/rollback or ERROR_SUCCESS for success. To give a message box you can use MsiProcessMessage WI function:
http://msdn2.microsoft.com/en-us/library/aa370354.aspx

Hope this helps.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
czamara
Posts: 2
Joined: Thu May 24, 2007 10:58 pm

Thanks for the quick and helpful reply. This looks like it should do the trick! I can call my EXE from VBScript and return its exit code.

Return to “Common Problems”