View Full Version : how to handle running an SQL script if user is doing a downgrade?

12-01-2014, 02:19 PM
Hi All;
I have a script that I need to run if the user decides to downgrade our product. How would you do that? I am using the SQL Scripts page and I can see how to setup for upgrade using "Installed AND NOT Remove" in the "Specify a conditional Statement". However I'm not sure how to make it work for a downgrade. In fact is there any place that really give the different statements for the state possibilities?

so I know...

only run during initial installation => NOT Installed.
only run during upgrade => Installed AND NOT Remove

but what about:
Run during initial install and repair?

12-03-2014, 03:00 PM
You might want to consider using the Upgrade table in order to detect the newer versions of your product. As a reference, take a look at Preventing the Current Installation from Overwriting a Future Major Version of the Same Product (http://helpnet.flexerasoftware.com/installshield21helplib/installshield21helplib.htm#StartTopic=helplibrary/PreventingDowngrades.htm) help topic to learn how to create a detect-only Upgrade item. The detect property can be used to determine a downgrade in your conditional statement.

Hope that helps.