View Full Version : Abort Install Prior To 1st Dialog

06-17-2005, 05:38 AM
As part of my Basic MSI I have a requirement to perform a check and abort the MSI if the check fails. This MUST happen before any dialog is displayed.

My custom action calls a C DLL which returns ERROR_INSTALL_USEREXIT, the custom action is SYNCHRONOUS (CHECK EXIT CODE), and it's scheduled as AFTER LAUNCH CONDITIONS in the UI sequence. It doesn't work, the install carries on as normal! :eek:

Any ideas? :confused:

Christopher Painter
06-17-2005, 07:44 AM
Have you looked at LaunchConditions? You can schedule your CA to do your check and populate a property, then use LaunchConditions ( property condition ) to display a message and abort the install.

06-17-2005, 07:53 AM
I don't want to display a message, but display the SETUPINTERRUPTED dialog instead. (should have mentioned that in 1st post :o )

08-23-2005, 06:47 PM
In C or InstallScript code, a custom action function can return the value ERROR_INSTALL_FAILURE to abort the running installation.

For example, the following C code for an MSI DLL function will abort the installation when encountered.

UINT __stdcall ExitSetupFromCA(MSIHANDLE hInstall)
// ...do some work...
// abort the installation

A custom action that does not exit the installation should return ERROR_SUCCESS, with value 0.