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!

areifinger
Posts: 6
Joined: Tue Oct 22, 2013 10:42 am

Automated build of msi

Hi,

I use AdvancedInstaller in our buildserver to create an msi on every commit to the repository. I use the command line api for this (/build foo.aip). Unfortunately, this creates a setup that always has the same version number. I want the setup to have the version major.minor.svn-revision. So I added a few lines to the build server that alters the aip file before building:
  • Set <ROW Property="ProductVersion"> to the intended version
  • Set <ROW Property="ProductCode"> to "1031:newguid 1033:anothernewguid" to make this a major upgrade
But the resulting setup always says "The system administrator has created policies that forbid this installation" (German: Der Systemadministrator hat Richtlinien erlassen um diese Installation zu verhindern"). Googling this message only tells me that this happens with missing admin rights, which is not the cause here.
Is this a valid approach? What am I doing wrong?

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

Re: Automated build of msi

Hi Alexander and welcome to Advanced Installer forums.

Please keep in mind that if you want to edit the Product Version of a package when you build it from the command line you can use the /SetProperty command. When you change the Product Version, new Product Codes will be generated automatically.

Let us know if this helped.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
areifinger
Posts: 6
Joined: Tue Oct 22, 2013 10:42 am

Re: Automated build of msi

I used this:
advinst.exe /edit "foo.aip" /SetProperty ProductVersion="8.0.18114"
advinst.exe /build "foo.aip"
The first command does not change the Version, though. It reflects the changes in the dir structure correctly, so it actually works on the file, but the Version stays the same.
Any obvious (to everyone except me) bug?
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Automated build of msi

Hi Alexander,

Sorry for my mistake. There is a special command that allows you to change the version of a product, the /SetVersion command.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
areifinger
Posts: 6
Joined: Tue Oct 22, 2013 10:42 am

Re: Automated build of msi

I tried SetVersion instead of SetProperty, that actually changed the Version and ProductCode. Testing now...
areifinger
Posts: 6
Joined: Tue Oct 22, 2013 10:42 am

Re: Automated build of msi

:-) Saw your reply after I sent mine...
areifinger
Posts: 6
Joined: Tue Oct 22, 2013 10:42 am

Re: Automated build of msi

Thank you very much for your help, now our build server creates a fresh setup on every commit, and I can install it without uninstalling the last setup. Perfect!
Do you have any idea what could have caused the message I got when manually changing the version and code? I guess /SetVersion does not do much more.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Automated build of msi

Hi Alexander,

You're welcome. I'm glad it works.

I'm not sure why did you get that message when you manually changed the Product Version and the Product Code, I tried to reproduce the behavior, but it worked well to me, although this approach is not recommended.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Teodor
Posts: 73
Joined: Thu Jul 25, 2013 9:56 am

Automated build of msi

Hi

Starting with Advanced Installer v9.8 it is much easier to retrieve the Product Version from a file: right-click in the edit box and select the “Set version from file...” menu item on the Product Details tab. This will keep in sync the product version of the package with the version of the selected file, which can be for example your main application executable.

This feature is especially useful for automated builds. I just thought to mention this in case you don't know about it.

Best regards
Teodor Micu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
areifinger
Posts: 6
Joined: Tue Oct 22, 2013 10:42 am

Re: Automated build of msi

Thank you for this - looks good. I might just use this instead...

Return to “Building Installers”