cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
microstar
Level 5

abort

In my basic msi project I use "abort" in the script. But whatever the setup does, it does not abort!. I also tried Do(EXIT).\
Under certain circumstances I want the script and setup to abort (for example, when the vista version doesn't have SP1 or when XP doesn't have the windows installer 3.1 installed).
How do I force the setup to abort??

Henri
Labels (1)
0 Kudos
(7) Replies
RobertDickau
Flexera Alumni

To test system requirements in a Basic MSI project, you might consider an Install Condition (or launch condition), which you can define in the Product Properties view.

In general, to exit an installer from an InstallScript (or MSI DLL) action, your function should return ERROR_INSTALL_FAILURE. Another approach is to set a property (ACTION1FAILED, say) in your action, and then, follow your action with an Error custom action that's conditioned with ACTION1FAILED, and which displays a custom message.
0 Kudos
microstar
Level 5

Thanks for the answer. (I do have one of your books ;-)) .
I cannot use the settings of the project because this message isn't for all users. Only for the users of winXP/2000 without the windows installer 3.1 and for Vista users without servicepack 1., BUT not for all of them. Only for those who are going to silently install Pervasive 10.1!!
I will try to see if your other suggestions are possible for me...
henri
0 Kudos
microstar
Level 5

The problem is, that it is in the middle of the script. I don't understand where the commands Do(EXIT) or abort are for, if not for aborting the script. The script does not do anything with those commands(??)
Could anyone please explain how to do that?
0 Kudos
RobertDickau
Flexera Alumni

I gather abort and Do(EXIT) are for InstallScript projects (and perhaps InstallScript MSI projects), where InstallScript custom actions in a Basic MSI project expect functions to return ERROR_SUCCESS on success and ERROR_INSTALL_FAILURE otherwise...
0 Kudos
microstar
Level 5

ok. But how can I return an ERROR_INSTALL_FAILURE from the function then as you suggested. I tried to call a function in the middle of the script that returned such an error, but the setup just went on installing 😉
How should such a function look like?
0 Kudos
RobertDickau
Flexera Alumni

The help topic "Writing Entry-Point Functions" has an example; the general idea is:

export prototype ExitInstaller(HWND);

function ExitInstaller(hInstall)
begin

// decide you want to exit...
return ERROR_INSTALL_FAILURE;

end;
0 Kudos
microstar
Level 5

allright. I will try to build in such a function, but i will do it before entering the very long script. Thanks. I will let you know how I will end up. But that will be next monday. Thank you very much....

henri
0 Kudos