3

I am new to JavaFX and only have some basic knowledge about Ant. At the moment I am learning how to use the FX Ant tasks to deploy an application. Edit: By using <fx:deploy nativeBundles="exe" ../> Ant automaticly uses Inno Setup to create a setup file with the .exe extension.

Since our company has some affiliated companies, most of our applications need to be deployed once for each of them. This is because some Windows Registry entries are created and they should look like this (not my idea, the management wants it to be like this!):

"HKCU\Software\affiliated company name\AppName\Settings"

Now I would like to know, if it's possible to pass a parameter from my build.xml to the .iss to insert the bold part dynamically.

I found this question , where passing /DMyParameterName=MyValue to the Inno Setup compiler (ISC) is suggested, but I don't know how to do this from the build.xml since I can't find any direct call to the ISC.

I hope you can understand my problem (English isn't my native language). If you need more information to be able to help me please feel free to ask, I will try to add them as fast as possible.

Community
  • 1
  • 1

1 Answers1

1

The Java FX does not allow you to pass any additional arguments to ISCC.exe.

At least according to OpenJFX source code:

//run candle
ProcessBuilder pb = new ProcessBuilder(
        TOOL_INNO_SETUP_COMPILER_EXECUTABLE.fetchFrom(params),
        "/o"+outdir.getAbsolutePath(),
        getConfig_ExeProjectFile(params).getAbsolutePath());
pb = pb.directory(EXE_IMAGE_DIR.fetchFrom(params));
IOUtils.exec(pb, VERBOSE.fetchFrom(params));

You might do with setting an environment variable instead of parameter and consume it using this syntax:

{%VARNAME}

See Inno Setup Constants documentation.


For those looking for a pure Ant solution (no Java FX):

The Inno Setup compiler (ISCC.exe) is a normal console executable.

You run the compiler using a basic Exec Ant task:

<project>
  <exec executable="ISCC.exe">
    <arg value="Example1.iss"/>
    <arg value="/DMyParameterName=MyValue"/>
  </exec>
</project>
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
  • "When you use fx:deploy, it's the Java FX that creates the .iss file. You do not have any control over its contents." That not true, you can use your own `.iss` file like explained in [this](http://stackoverflow.com/a/28404814/3857722) post. But i gues this won't "The Java FX does not allow you to pass any additional arguments to ISCC.exe". Thank you for you answer. When I have found any work around, I will post it here. – PinkPanther May 22 '15 at 14:57
  • OK, good. I've removed that note. In that case you might use environment variable instead. See my edit. – Martin Prikryl May 22 '15 at 16:34
  • I guess one option (just an idea) would be to dynamically create (e.g. some template processing maybe) the custom .iss file in ant before using fx tasks – Bjarne Boström Aug 14 '15 at 12:51