In Install4j - How can I read the version from an external file?

346 views Asked by At

I run install4j from the gradle plugin but use the user interface to edit the install4j file. But I find it annoying to always have to manually update my General Settings -> Application Info -> Version every time I make a new version. This is stored in a file in our source code already so I want to just read that file to avoid the extra input.

How can I read this file, get the version info, then use that in General Settings -> Appplication Info -> Version?

Thanks in advance.

1

There are 1 answers

4
Ingo Kegel On BEST ANSWER

I would suggest invoking install4j from your build process, install4j supports ant, gradle and maven and can also be invoked with a command line executable.

In that case, you can set the version

  • with the release attribute of the ant task
  • with the release attribute of the gradle task
  • by overriding the release property of the maven plugin, the maven plugin automatically uses the version in the POM.
  • by passing the --release argument to the command line compiler

For other things that you want to customize from the build process, you can use compiler variables.