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!

litu
Posts: 71
Joined: Fri Mar 22, 2013 2:57 pm

Checking the version of my product

Hello,

I need to check the version of my own product and if it's prior to x.y.z version then run an SQL script; but if the customer has a superior version than x.y.z the script must not be executed.
How can I check the version of my own product installed on the target machine and compare to the actual version?

Thanks in advance,
Arnau.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Checking the version of my product

Hi Arnau,

In order to achieve this you can go in the "Upgrades" page of your project and create a new "Upgrade Rule" as described below:
  • Product Info Tab
    Upgrade Code: [|UpgradeCode]
    Min. Version: 0.0.1
    Max. Version: x.y.z (your version)
    Check the "Include maximum version in range" option

    Upgrade Action Tab
    Store in: [YOUR_PROP]
The [YOUR_PROP] property is set only if the version installed on the user's machine is in the "Min. Version - Max. Version" range.

Please note that this property will be set after the "Install Execution Stage -> Searches" action group. If you need it earlier, you will have to create your own custom action that gets the previous version of the application and verifies it.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
litu
Posts: 71
Joined: Fri Mar 22, 2013 2:57 pm

Re: Checking the version of my product

So, If I understood this correctly, I can set a condition like that:

PROP_1 = "something" AND MY_PROP

So, If MY_PROP has some value it will be considered as "true" and if it has none it will be considered as a "false" to this purpose? So, if the installed version is prior to x.y.z, the condition will be true and the script will be executed and not if the version is newer than x.y.z, is that right?

Thanks in advance,
Arnau.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Checking the version of my product

You're right Arnau, this is exactly what will happen. The property will have a value only if the installed version is older than x.y.z.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
litu
Posts: 71
Joined: Fri Mar 22, 2013 2:57 pm

Re: Checking the version of my product

I'm trying to do it, but it shows an error:
"This is the upgrade code of this project, it is not necessary and incorrect to add it in this list.
Packages that have this upgrade code will be upgraded automatically based on the settings made in this page."

This means I have to change the upgrade code?
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Checking the version of my product

That message appears if you try to add the Upgrade Code of the project as it is (i.e. {GUID}), but you should add it as I described in my first post, using its related property ([|UpgradeCode]).

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”