This seems simple but I cannot figure out how to reference the installed Java launcher binary as a variable. For example, I want to launch the binary at the end of the installer but I cannot figure out how to reference the installed binary file name. It could be .app for Mac, or .exe for Windows, etc...

asked 06 Mar '13, 13:27

Michael's gravatar image

Michael
21336
accept rate: 100%


Ok, I figured it out. Reading the java section of the docs more carefully, I see there is a platform variable platform_exec_suffix. This what I needed as I can just construct the launcher binary name as usual and append the '.${platform_exec_suffix}' to it and I have the complete launcher name.

link

answered 06 Mar '13, 19:05

Michael's gravatar image

Michael
21336
accept rate: 100%

You can use rules to launch it depending on the platform. For example, if you created this launcher:

<createJavaLaunchers>
  <destination>${installdir}/launchers</destination>
  <javaLauncherList>
    <javaLauncher>
      <binaryName>myLauncher</binaryName>
      <jarFile>testapplication.jar</jarFile>
    </javaLauncher>
  </javaLauncherList>
</createJavaLaunchers>

You could use:

<setInstallerVariable name="binaryName" value="${installdir}/launchers/myLauncher"/>
<setInstallerVariable name="binaryName" value="${binaryName}.exe">
    <ruleList>
         <platformTest type="windows"/>
    </ruleList>
</setInstallerVariable>
<setInstallerVariable name="binaryName" value="${binaryName}.app/Contents/MacOS/installbuilder.sh">
    <ruleList>
         <platformTest type="osx"/>
    </ruleList>
</setInstallerVariable>

And then call ${binaryName}:

<runProgram program="${binaryName}" programArguments="&amp;"/>
link

answered 06 Mar '13, 14:12

juanjo's gravatar image

juanjo ♦♦
5.8k413
accept rate: 23%

Ok. I was trying to avoid that and I was just assuming (incorrectly I guess) that the binary name of the launcher would be available as variable. Thanks for the reply.

(06 Mar '13, 14:46) Michael
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×40
×13
×7

Asked: 06 Mar '13, 13:27

Seen: 1,555 times

Last updated: 06 Mar '13, 19:05