abort uninstall because process is running: fatal error msg - 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!

davidsmith
Posts: 59
Joined: Sun Jul 12, 2009 8:33 pm

abort uninstall because process is running: fatal error msg

For uninstalls from the Windows control panel, if I use standard custom actions to check for a running process, and give an error message if a process is running, I always get a final dialog box like

Title Bar: "Add or Remove Programs"
Text: Fatal error during installation

See the attached jpg file.

I cannot find any Advanced Installer dialog box that this maps to.

Is there anyway to stop these fatal dialog boxes?
Attachments
fatalerror.JPG
fatalerror.JPG (7.44 KiB) Viewed 6981 times
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: abort uninstall because process is running: fatal error msg

Hello,

Please make sure you followed the guidelines outlined here: http://www.advancedinstaller.com/user-g ... ocess.html
Also note that your installer may need elevated privileges.
If your problem persists, please send us your .aip and log to support at advancedinstaller dot com so we can further assist you with your problem.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
davidsmith
Posts: 59
Joined: Sun Jul 12, 2009 8:33 pm

Re: abort uninstall because process is running: fatal error msg

The installer does the right thing.

1) It detects that the process is running.

2) It displays my error message.

3) It does not allow the installer to proceed

The only thing wrong is that after it displays my error message, it gives this error dialog box when the installer exits. I'm thinking I have a bad return code somewhere. Or maybe this is a normal message from the XP control panel application.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: abort uninstall because process is running: fatal error msg

Hello,

The "Error Message" custom action returns an ERROR_INSTALL_FAILURE error code. The "Add or Remove Programs" utility is programmed to display the error message you encountered when it receives this error code. A workaround is to create your own custom action that will display your error message, then return the ERROR_INSTALL_USEREXIT code which will still initiate the rollback but prevent "Add or Remove Programs" to display that error.

More about these error codes can be found here.
Please note that a custom error code cannot be returned from an exe. Your custom action should be a script or a dll.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
davidsmith
Posts: 59
Joined: Sun Jul 12, 2009 8:33 pm

Re: abort uninstall because process is running: fatal error msg

If I do something like

Option Explicit
MsgBox "Product cannot be uninstalled when it is running.", vbOKOnly
WScript.Quit(1602)

as a vbs custom action:

1) I see my new message box => great :)

2) I get a 2nd message box that states "There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor.

3) I get a 3rd message box that is the infamous error message dialog box that I'm trying to get rid of.

Even if I set my Quit value to be 0, I still get the above message boxes on "uninstall".


-----

Also tried

UninstallErrorMesg() : Function UninstallErrorMesg() : On Error Resume Next : MsgBox "Product cannot be uninstalled when it is running.", vbOKOnly : UninstallErrorMesg = 2 : Exit Function : End Function

but that gives me the error dialog box, but doesn't abort the uninstall.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: abort uninstall because process is running: fatal error msg

Hello,

Please note that the WScript object is not accessable from a VBScript that runs within the msi context. As stated here, you will have to enclose your code in a function, and use that function's return value as the return code.

Here is an example that should work for you:

Code: Select all

Function MyVBScriptCA()  
   MsgBox "Product cannot be uninstalled when it is running.", vbOKOnly
   MyVBScriptCA = 2
End Function
Note that you will have to fill in the "Function Name" field of the "Launch file or open URL" Custom Action with the name of the function, i.e. "MyVBScriptCA". Also, observe that you should use 2 instead of 1602 as return value. That value is taken from here.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”