Java Launcher Binary Name

Answered

Comments

2 comments

  • Avatar
    juanjo

    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;"/>
    
  • Avatar
    Michael

    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.

Please sign in to leave a comment.