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

own setup return codes (own error codes returned by custom action)

Hello,

I'm using a basic msi project. Installshield pre generates a custum action called ISPreventDowngrade to catch downgrades.

The error code returned by the Setup is 1603 if this action will be executed. This is a common error code if something goes wrong. Is it possible to change the return code of the custom action ISPreventDowngrade to any other code, so that the caller of the setup can decide if there is really a problem with the setup package or if it "only" was an attempt to downgrade?

Basically: is it possible to set a own return code by using custom actions of type 19?
Labels (1)
0 Kudos
(1) Reply
MichaelU
Level 12 Flexeran
Level 12 Flexeran

There are very few return codes that you can convince MSI to return (see Custom Action Return Values on MSDN), and most of them have special meanings. However depending on how smart the caller of your installation is, it could easily perform the downgrade prevention check itself - perhaps dynamically by querying the UpgradeCode property of the MSI - and then by using MsiEnumRelatedProducts (or some wrapper thereof).
0 Kudos