Is there a way to force an MSI to fail with a specific error code?
If you attempt to install an application with ProductCode A and Package Code B but there is already an application installed with ProductCode A and PackageCode C, you get the following error code: 1638. I have repackaged application X but the legacy version of application X exists on most of the machines in the environment right now. My wrapper will take care of removing the legacy version before putting down the repackaged version, however, I would still like to put in a custom action that detects this legacy version and fails. When it fails, I would like it to fail with 1638 not 1603. Is there a way I can accomplish this?
Community Chosen Answer
unfortunately you have very little control over the exit code generated by an MSI installer Custom Action, and only a limited number of available 'choices'..
For more info on this see: http://msdn.microsoft.com/en-us/library/windows/desktop/aa369778%28v=vs.85%29.aspx