Can I auto increment version of installer on build ? - 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!

gmichelson
Posts: 4
Joined: Wed May 09, 2007 11:36 pm
Location: Chicago, IL
Contact: Yahoo Messenger

Can I auto increment version of installer on build ?

Hi !

I think I saw this somewhere, but can't find this information any more - can I auto increment version if install file ? I am creating installer from ant, and if I have this option, it would be very helpful.

TIA,

George Michelson[/code]
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi George,

To set the package version from command line you can use /SetVersion command. Read more about how to use it here:
http://www.advancedinstaller.com/user-g ... rsion.html

Best Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
gmichelson
Posts: 4
Joined: Wed May 09, 2007 11:36 pm
Location: Chicago, IL
Contact: Yahoo Messenger

Gigi,

I saw this, but it does not answer my question of autoincrementing version - I want to setup fully automated build process that would generate install file what could be installed for users. Correct me if I am wrong, but unless I increment the version, installation is going to fail, because it would think that it's already installed.

TIA,

George
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi George,

You can use [-fromfile <file_path>] switch of the /SetVersion command line. Using this switch the version will be get from the specified file.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
gmichelson
Posts: 4
Joined: Wed May 09, 2007 11:36 pm
Location: Chicago, IL
Contact: Yahoo Messenger

Hi !

This is just for the reference of anybody else who would want to do the same thing.

I created property file that I change with ant task - here is task that manages it, as you can see I am using SVN to keep track of build information :

<target name="build_version">
<!-- let's get file from repository -->
<svn username="${ssc.repository.user}" password="${ssc.repository.passwd}">
<checkout url="${ssc.repository.url}/${ssc.build.folder.url}/" revision="HEAD" destPath="build_temp" recurse="false" />
</svn>

<!-- increment build information -->

<propertyfile file="build_temp/version.properties" comment="Build version info">
<entry key="buildDate" type="date" value="now" />
<entry key="buildNum" default="0" type="int" operation="+" value="1" />
</propertyfile>

<!-- update repository -->
<svn username="${ssc.repository.user}" password="${ssc.repository.passwd}">
<commit file="build_temp/version.properties" message="Updated by bulld process" />
</svn>
</target>

And later on I have actual build setup target, it has following task that changes my build file

<target name="installer_prod_build" depends="installer_prod_setup, build_version" description="--> build prod distribution">
<property file="build_temp/version.properties" />
<echo message="Version: ${buildMajorVersion}.${buildMinorVersion}.${buildNum}" />

<exec executable="${installer.path}/${installer.exe}" dir="${installer.stage.path}">
<arg value="/edit" />
<arg value="${installer.aip.full}" />
<arg value="/SetVersion" />
<arg value="${buildMajorVersion}.${buildMinorVersion}.${buildNum}" />
</exec>

<exec executable="${installer.path}/${installer.exe}" dir="${installer.stage.path}">
<arg value="/build" />
<arg value="${installer.aip.full}" />
</exec>

</target>

Let me know if someone needs a clarification on what I did here or why.

George

Return to “Common Problems”