philk
Posts: 5
Joined: Tue Mar 24, 2009 8:47 am

Automatically generate version number

Hello,

struggling with creating MSI installs by hand I wonder if it is possible with Advanced Installer to create installs in an ANT build that will take the version number each time from an external file. It should also modify the MSI product code so an update installation is triggered on the target system. Is something like this possible with Advanced Installer?

thanks,
Phil
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Automatically generate version number

Hi Phil,

Yes, this can be done in the command line interface by using the "-fromfile" parameter for the /SetVersion command. If the "-noprodcode" parameter is not used, a new Product Code is automatically generated.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
philk
Posts: 5
Joined: Tue Mar 24, 2009 8:47 am

Re: Automatically generate version number

Wow, that was fast! And I have not even purchased your product yet :) Can this be tested with the freeware version too? Purchase would take a little longer to evaluate here at the company.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Automatically generate version number

Hi,

Yes, this should work in the Free version and in the trial version.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jbridges
Posts: 38
Joined: Fri Jun 09, 2006 12:36 am

Re: Automatically generate version number

I use the /SetVersion on a copy of the original project file and do not use the -noprodcode parameter (of which I was not aware). However a grep of the original and modified copy show the ProductCode as identical. So I am puzzled!!

I use the /SetVersion in conjunction with /Edit and so maybe this is the difference. I do want to keep the ProductCode the same as checked in because I use this for tracking purposes.

I am using version 6.9.1.

I started using this technique (edit a copy) because the project is under source control and normally read-only.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Automatically generate version number

Hi,

Please note that a copy of the AIP file will use the same Product Code as the original. I'm not sure why the Product Code was not changed for you, but you can try increasing one of the first three fields of the version through the "/SetVersion" command (without the -noprodcode parameter).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jbridges
Posts: 38
Joined: Fri Jun 09, 2006 12:36 am

Re: Automatically generate version number

Sorry it took me so long to respond. here is the sequence of commands I used in a batch build (following the copy). The VUF is set in the script and the BuildNumber is generated - the changenumber from our Perforce source control.

advancedinstaller.com /edit Xgig-A-4.4.1.aip /SetVersion 4.4.1
advancedinstaller.com /edit Xgig-A-4.4.1.aip /SetProperty BuildNumber="89144"
advancedinstaller.com /edit Xgig-A-4.4.1.aip /SetProperty ProductName="Finisar Xgig Analyzer 4.4.1"
advancedinstaller.com /build Xgig-A-4.4.1.aip

After the build, I do

grep ProductCode Xgig-A.aip
<ROW Property="ProductCode" Value="1033:{17066183-4B91-4E69-9689-04CE53C51365} " Type="16"/>
grep ProductCode Xgig-A-4.4.1.aip
<ROW Property="ProductCode" Value="1033:{17066183-4B91-4E69-9689-04CE53C51365} " Type="16"/>

where the first AIP is the original that is checked into source control. Maybe we are not talking about the same code?? Looks the same to me.

Am I looking at the wrong thing?
jbridges
Posts: 38
Joined: Fri Jun 09, 2006 12:36 am

Re: Automatically generate version number

I think I know the reason. Although I use /SetVersion, I am actually not changing it. Each time we have a new VUF, I make the change in source control. So the /SetVersion in the script is actually redundant. The important parameter is the buildnumber, which identifies the full V.U.F.B

I don't know why anyone would actually feel the need to change the first three parts - the V.U.F - on each build. The V.U.F is how we identify the release version we are working on. I thought this was standard practice. The BuildNumber tells us where we are in the development of the release. In the case of Perforce, the buildnumber increases "forever" as it is really a timestamp. When it exceeds a 16 bit unsigned integer, as ours has, it can't be used in certain places in the version resource files. So for those cases, we store the the BuildNumber.

Maybe my confusion has helped someone else!
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Automatically generate version number

Hi,

Indeed, using the "/SetVersion" command with the existing version does nothing to the project. A new ProductCode is generated only if the version is changed. A workaround would be to call the command twice: once to set a new version (for example 1.0.0) and a second time to set it to the current version. This would change the Product Code and keep the current version.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”