This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallAnywhere
- :
- InstallAnywhere Forum
- :
- Re: How to set component version at build time?
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 15, 2013
09:05 AM
How to set component version at build time?
Hi
I looking for a way to send component version at build time. The only thing that i found is setting the product version, either by defining it directly in the command line with "build.exe MyProduct.iap_xml productVersion=2.1.3.24" or using buildproperties file with following structure:
ProjectVersionMajor="2"
ProjectVersionMinor="3"
ProjectVersionRevision="1"
ProjectVersionSubrevision="24">
…
…
But i don't see a way to change component version. Is it possible without opening InstallAnywhere UI?
Thanks
I looking for a way to send component version at build time. The only thing that i found is setting the product version, either by defining it directly in the command line with "build.exe MyProduct.iap_xml productVersion=2.1.3.24" or using buildproperties file with following structure:
ProjectVersionMajor="2"
ProjectVersionMinor="3"
ProjectVersionRevision="1"
ProjectVersionSubrevision="24">
…
…
But i don't see a way to change component version. Is it possible without opening InstallAnywhere UI?
Thanks
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 16, 2013
07:56 AM
Hi,
I am not sure, i think the following links may helpful to you.
http://community.flexerasoftware.com/showthread.php?203256-changing-InstallerTitle-at-run-time&highlight=version+number
http://kb.flexerasoftware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=Q201360
Regards,
Sree
I am not sure, i think the following links may helpful to you.
http://community.flexerasoftware.com/showthread.php?203256-changing-InstallerTitle-at-run-time&highlight=version+number
http://kb.flexerasoftware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=Q201360
Regards,
Sree
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 27, 2013
12:14 PM
I don't think you can. I posted about this in http://community.flexerasoftware.com/forumdisplay.php?288-InstallAnywhere-2012.
No one has answered me yet, I would like to find a Flexera approved method of supporting this. I resorted to modifying the component version contents using Python scripting with some XPath navigation and XML document manipulation libraries (lxml etree). For such, PowerShell, VBScript + MSXML, Ruby, etc. should work just fine. Just be sure that the XML declaration of the modified project that you save is NOT or you will get some freakish error messages echoed to STDOUT about the xml attributes being invalid when doing a command line build. The package will still build, and the single quotes are standard and should work, but InstallAnywhere's build give you some spooky messages.
The best way to find the component you are interested in is using the following XPath expression: (NOTE: This is Python 3)
r = root.xpath('/InstallAnywhere_Deployment_Project/installationObjects//object[@class="com.zerog.ia.installer.InstallComponent" and ./property[@name="componentName"]/string[.="YOUR_COMPONENT_NAME_HERE"] ]')
if len(r):
prjFileIsModified = True
r[0].find("property[@name='versionMajor']/int").text = vers[0]
r[0].find("property[@name='versionMinor']/int").text = vers[1]
r[0].find("property[@name='versionRevision']/int").text = vers[2]
r[0].find("property[@name='versionSubRevision']/int").text = vers[3]
Where "YOUR_COMPONENT_NAME_HERE" is the name of your component. That frees you from having to use the objectID attribute or the component guid. You see, I think that the ... in the XML forces you to use and integer as opposed to a build variable. Advanced designer won't even let you enter a variable for any of the 4 version values (Major, Minor, etc.).
Good luck. This should be more easily addressed for automated builds.
I tried to use the InstallAnywhere automation API, but I can't get it to work reliably. If you open up a project in Java and simply save it someplace else, I have been getting a lot of information stripped out. If you managed to get that to work, I would love some advice.
No one has answered me yet, I would like to find a Flexera approved method of supporting this. I resorted to modifying the component version contents using Python scripting with some XPath navigation and XML document manipulation libraries (lxml etree). For such, PowerShell, VBScript + MSXML, Ruby, etc. should work just fine. Just be sure that the XML declaration of the modified project that you save is NOT or you will get some freakish error messages echoed to STDOUT about the xml attributes being invalid when doing a command line build. The package will still build, and the single quotes are standard and should work, but InstallAnywhere's build give you some spooky messages.
The best way to find the component you are interested in is using the following XPath expression: (NOTE: This is Python 3)
r = root.xpath('/InstallAnywhere_Deployment_Project/installationObjects//object[@class="com.zerog.ia.installer.InstallComponent" and ./property[@name="componentName"]/string[.="YOUR_COMPONENT_NAME_HERE"] ]')
if len(r):
prjFileIsModified = True
r[0].find("property[@name='versionMajor']/int").text = vers[0]
r[0].find("property[@name='versionMinor']/int").text = vers[1]
r[0].find("property[@name='versionRevision']/int").text = vers[2]
r[0].find("property[@name='versionSubRevision']/int").text = vers[3]
Where "YOUR_COMPONENT_NAME_HERE" is the name of your component. That frees you from having to use the objectID attribute or the component guid. You see, I think that the
Good luck. This should be more easily addressed for automated builds.
I tried to use the InstallAnywhere automation API, but I can't get it to work reliably. If you open up a project in Java and simply save it someplace else, I have been getting a lot of information stripped out. If you managed to get that to work, I would love some advice.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 08, 2013
02:42 PM
I also resorted to modifying the .iap_xml file. I did it with a java program, and I was unable to use the regular java DOM API because when it wrote out the resulting file, it wrote out as , which should be equivalent, but IA treats it differently and I got some strange errors about "null" when it should have given me an empty string. So I had to use textual manipulation, which fails when IA changes something just a little bit.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 17, 2014
04:39 PM
Maybe you have already figured this out but I'll post anyway how we handle it and maybe help others. We use a template.iap_xml project file checked into source code that has @VERSION_MAJOR@, @VERSION_MINOR@, @VERSION_REV@, and @VERSION_SUBREV@ tokens in place for the product's and components' versions. We use ant to build our installers. Ant loads a properties file containing the version (and other) properties. Ant first creates a modified.iap_xml that has the correct version numbers, then builds installer(s) from that. One caveat to this process is you cannot load template.iap_xml in the Advanced Designer because it doesn't like @VERSION_MAJOR@ . You must work in the modified project file and merge your changes back to the template before check-ins. Another option could be to use XSLT.
-Jeff
-Jeff