SQL script condition problem - Advanced Installer Community
Ekki
Posts: 8
Joined: Thu Jun 27, 2013 11:26 am

SQL script condition problem

Hello.

I have a problem with compare version of the already installed product on the SQL script page when I try update it.

When I update product I want to run SQL update scripts. For example, I have 5 versions of the product and each installer contains update sql scripts with conditions:

1) 1.1.1
Create DB: NOT OLDPRODUCTS

2) 1.2.1
Create DB: NOT OLDPRODUCTS
Update_1.1.0_to_1.2.1: OLD_VERSION < "1.2.1"

3) 1.3.1
Create DB: NOT OLDPRODUCTS
Update_1.1.1_to_1.2.1: OLD_VERSION < "1.2.1"
Update_1.2.1_to_1.3.1: OLD_VERSION < "1.3.1"

4) 1.4.1
Create DB: NOT OLDPRODUCTS
Update_1.1.1_to_1.2.1: OLD_VERSION < "1.2.1"
Update_1.2.1_to_1.3.1: OLD_VERSION < "1.3.1"
Update_1.3.1_to_1.4.1: OLD_VERSION < "1.4.1"

5) 1.5.1
Create DB: NOT OLDPRODUCTS
Update_1.1.1_to_1.2.1: OLD_VERSION < "1.2.1"
Update_1.2.1_to_1.3.1: OLD_VERSION < "1.3.1"
Update_1.3.1_to_1.4.1: OLD_VERSION < "1.4.1"
Update_1.4.1_to_1.5.1: OLD_VERSION < "1.5.1"

Last version is 1.5.1. I use vbscript to fill property OLD_VERSION with appropriate value from registry path "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\[OLDPRODUCTS]\DisplayVersion".

So, one of the customers has installed version 1.3.1. And when I try update his 1.3.1 version with last 1.5.1 ALL update scripts are executed, but Update_1.1.1_to_1.2.1 and Update_1.2.1_to_1.3.1 shouldn't.
OLD_VERSION in this case has value "1.3.1".

I tried use condition OLD_VERSION < "1.2.1" on dialog in Controls Conditions and it works properly.

Do you have any idea what is wrong?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: SQL script condition problem

Hello,

I'm not sure why this happens. Can you please send us the .AIP (project file) and a verbose log of the installation to support at advancedinstaller dot com so we can investigate them?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Ekki
Posts: 8
Joined: Thu Jun 27, 2013 11:26 am

Re: SQL script condition problem

Hello Daniel,

Thank you for response.

I found out what the problem is. I didn't define property OLD_VERSION on "Install Parameters" page in the "Properties" section. After I defined property installer is working fine.

But it is strange I could operate with property on dialogs level but not on the SQL Script level.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: SQL script condition problem

You're welcome. I'm glad you sorted things out.

If you have any question just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”