manishc_dbi
Posts: 7
Joined: Mon Apr 17, 2006 10:13 am

How to abort the installation from a custom action

I want the installation to terminate immediately when a certain condition is encountered in the custom action.

I am using a VC++ dll method for custom action. When the function returns with a value ERROR_INVALID_FUNCTION, the MSI is terminated, but it shows the last dialog. I dont want this dialog to appear on termination.

Please help

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

Hi,

Basically if a error resides during the installation of a package a message box will appear describing the error. After that the FatalError dialog will appear. That dialog says that the package was ended prematurely. This is the windows installer behavior.

Regards,
Gigi
________________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
Pepa
Posts: 15
Joined: Fri Jul 07, 2006 7:59 pm
Location: USA
Contact: Website

I was wondering about this because I may have a need to do it eventualy, too.

I figured that I could find the process by name (MSIEXEC) (GetProcessByName) and just kill it. Since the msiexec is doing nothing at the time (just waiting for the custom action's return value), I think it would be safe to do. As long as the custom action is called at the early stages of the process when nothing is actually installed yet ...

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

Hi,
I figured that I could find the process by name (MSIEXEC) (GetProcessByName) and just kill it. Since the msiexec is doing nothing at the time (just waiting for the custom action's return value), I think it would be safe to do. As long as the custom action is called at the early stages of the process when nothing is actually installed yet ...
I don't recommend this. If you don't want dialogs to be displayed during installation then you can run your package in "Basic UI". Run your package with the following command line:

Code: Select all

msiexec /i package.msi /qb
Or you can use the "Exe Bootstrapped" ("Media" page). Type in the "MSI Command Line": /qb

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

Return to “Common Problems”