Have separate SQL scripts for Install and Upgrade - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

Dean.Wilson
Posts: 6
Joined: Mon Aug 22, 2011 10:17 am

Have separate SQL scripts for Install and Upgrade

Hi,

I am trying to have some SQL scripts that run when installing the product for the first time (e.g. to install version 2.0), and other SQL scripts that run if a previous version is already installed, that will upgrade the database (e.g. from 1.8 to 2.0).

However I cannot seem to stop the install scripts from running when upgrading.

I have tried every combo I can think of of using !Database = 2, !Database = 3, Not (!Database = 3), Not Installed, in the run condition for each script, but they always seem to run.

Important Node: The way I am testing this is with 2 separate .aip projects, both identical (copied from the same original) except:
v1.8 points to v1.8 code and database creation/population scripts
v2.0 points to v2.0 code and database creation/production scripts, and has upgrade scripts to upgrade 1.8 to 2.0
The Product Version (on the Product Details page) is different

The idea is to test the upgrade by installing the product from the installer created by the v1.8 aip, then running the installer created by the v2.0 .aip and hopefully it will just run the upgrade scripts (and upgrade the code). Should this approach work? And if not how would you suggest working on and testing the upgrade?

Thanks
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Have separate SQL scripts for Install and Upgrade

Hi,

Here is a user guide article to help you with the condition for the SQL scripts.
However I cannot seem to stop the install scripts from running when upgrading.
If you set your scripts' condition with:

Code: Select all

NOT OLDPRODUCTS
in the upgrading project, they will not be executed during an upgrade.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”