Summary
This article discusses custom action return codes of DLL and VBScript type of custom actions.Synopsis
Windows Installer Service has built-in functionality that allows setup developers to exit or continue with the setup based on the custom action return codes.
This article discusses custom action return codes of DLL and VBScript type of custom actions.
Discussion
You can use custom actions of type DLL and VBScript in Express to exit or continue with the installation based on the return codes.
The following chart demonstrates the return codes of DLL and VBScript custom actions to exit or continue setups:
Return Codes
| Custom Action Type | Continue Setup | Exit Setup |
|---|---|---|
| DLL Type Custom Action |
Action Succeeded (ERROR_SUCCESS): Log File Value : 1 or 5 Function Return Value: 0 |
User Cancelled setup (ERROR_INSTALL_USEREXIT): Log File Value: 2 Function Return Value: 1602 Action failed (ERROR_INSTALL_FAILURE): Log File Value: 3 Function Return Value: 1603 |
| VBScript |
Action Succeeded: Log File Value: 1 or 5 Function Return Value: IDOK = 1 |
User Cancelled setup: Log File Value: 2 Function Return Value: IDCANCEL = 2 Action Failed: Log File Value: 4 Function Return Value: IDABORT = 3 |
UINT __stdcall Myfunction(MSIHANDLE hInstall)
{
int nreturnValue;
nreturnValue = MessageBox(0, "Would you like to continue with the setup?", "Exit Code Test", MB_YESNO);
if (nreturnValue == IDYES)
return 0;
else
return 2;
}
Additional Information
Executables being launched via custom actions should always return 0 for success. The Windows Installer errors out if an EXE type custom action returns any number other than 0.
More information on this topic can be found in the MSI Help topic Custom Action Return Values.
Related Articles
HOW TO: Launch a bat file from INSTALLDIR/SUPPORTDIR using Custom Action 24Number of Views HOW TO: Stop a Windows Service using a Custom Action 8Number of Views Installer Exit Codes on Linux when using InstallAnywhere 26Number of Views Enumerating InstallAnywhere Variables at Run Time Using Custom Code Action 3Number of Views Create a Serial Number Validation custom action DLL Using Delphi 3Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Case id: 00001065
Activity: Status change: 2 hours ago