Install4J variable not expanded in the vmoptions file

Viewed 133

I'm using Install4J 5.0.8

Under 'Launcher' --> '5. VM options file' --> 'Generate with the following contents'

Some of the variables are expanded after install (such as my 'Compiler variables'), but the ${installer:sys.contentDir} remains unexpanded?

For example:

-Xmx2048m
-Duser.home=${installer:sys.contentDir}/tmp

Here is the XML snippet:

<vmOptionsFile mode="content" overwriteMode="4">
 <content>-Xmx2048m
  -Duser.home=${installer:sys.contentDir}/tmp
 </content>
</vmOptionsFile>

Is there an alternative variable for the install root, as I would like to avoid relative paths (./tmp).

1 Answers

Installer variables in VM parameters are replaced by the main class, which is too late for some VM parameters.

You can use a "Replace installer variables in text files" action in the installer to perform this replacement at installation time.

Related