Cannot rerun Java JPackage installer if already installed, second time just exits without warning

No idea if this helps on Mac or Linux but the Windows installer automatically removes older versions of the application when you run it so you just need to set up a scheme which changes the version number on each build to avoid having to ununstall old version each time.

To do this simply you could set the version number as “YY.MM.DDHH” so version number changes each hour and cuts down on uninstalls.

Ant steps:

<tstamp>
    <format property="appver"     pattern="yy.MM.ddHH" />
</tstamp>

<exec executable="jpackage">
    <arg line="--app-version ${appver}"/>
    ...
</exec>

The CMD version of this:

set appver=%date:~6,2%.%date:~3,2%.%date:~0,2%%time:~0,2%
jpackage --app-version %appver% ...

Leave a Comment