Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install4J variable not expanded in the vmoptions file

Tags:

install4j

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).

like image 692
Paul Allen Avatar asked Feb 27 '26 04:02

Paul Allen


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.

like image 70
Ingo Kegel Avatar answered Mar 01 '26 23:03

Ingo Kegel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!