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!

John Dill
Posts: 9
Joined: Tue Dec 02, 2014 10:23 pm

Command line interface to set JRE Bundle

I have a scenario where our IT will change the installed JRE version when govt IA tells them too. Is there a way to use the command line interface to AdvancedInstaller.com through GetProperty, SetProperty, or SetBuildJreOnly to be able to get and/or set the JRE version in the aip file? My batch script has a method to determine the JDK version of the local machine (like 1.7.0_71), and I can see that the jdk version exists in the SourcePath attribute of the individual files in the JRE. I cannot seem to be able to use the command line interface to change the contents of

<COMPONENT cid="caphyon.advinst.msicomp.MsiFeatsComponent">

or

<COMPONENT cid="caphyon.advinst.msicomp.MsiFilesComponent">

so that the contents would update to a different JRE. I had to manually open the aip project file and set it there.

If I can't set it, I would ask whether it's possible to get the JRE version number from AdvancedInstaller.com using some flag so that I can inform configuration management (CM) of a JRE mismatch between what is installed on the computer they are building on and what the aip file is configured to. I can scan for a mismatch between the installed version and the xml file using 'findstr /R regex file.aip' using the version string I detected (like "jdk1.7.0_71"), but I'd prefer an AdvancedInstaller method if it's available.

Any suggestions?

Best regards,
John Dill
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Command line interface to set JRE Bundle

Hi John,
I have a scenario where our IT will change the installed JRE version when govt IA tells them too. Is there a way to use the command line interface to AdvancedInstaller.com through GetProperty, SetProperty, or SetBuildJreOnly to be able to get and/or set the JRE version in the aip file?
In this case, you can delete the content of the the APPDIR\jre folder.
If you want to use a command line statement, you can use the Delete Folder Command Option to delete the APPDIR\jre folder. This will delete the content of the APPDIR\jre from your project. So, your command line should look like this:

Code: Select all

AdvancedInstaller.com /edit MyProject.aip  /DelFolder APPDIR\jre
Then, you can use the New Synchronized Folder Command Option to sync the jre folder from your project with one from the disk. (e.g C:\Program Files (x86)\Java\jre1.8.0_25)
So, your command line should look like this:

Code: Select all

AdvancedInstaller.com /edit "MyProject" /NewSync APPDIR\jre "C:\Program Files (x86)\Java\jre1.8.0_25"
Whenever the source folder from the disk will be changed, you will have to use Reset Synchronized Folder Command and then use the New Synchronized Folder Command Option.
If I can't set it, I would ask whether it's possible to get the JRE version number from AdvancedInstaller.com using some flag so that I can inform configuration management (CM) of a JRE mismatch between what is installed on the computer they are building on and what the aip file is configured to.
I'm afraid we don't have support for this. So, you can still use your approach to get the version, but I recommend to compare with the version of the jvm.dll from the C:\Program Files (x86)\Java\jre1.8.0_25\bin\client.

If there is anything else I can help you with, please let me know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
John Dill
Posts: 9
Joined: Tue Dec 02, 2014 10:23 pm

Re: Command line interface to set JRE Bundle

In your example code

AdvancedInstaller.com /edit "MyProject" /NewSync APPDIR\jre "C:\Program Files (x86)\Java\jre1.8.0_25"

I do not have a path that corresponds to what your command expects. I have

C:\Program Files\Java\jdk1.7.0_71
C:\Program Files\Java\jre7

There is a jre subdirectory in jdk1.7.0_71. What do you recommend using for my '/NewSync APPDIR\jre' path?

Thanks again,
John D.

Return to “Building Installers”