简体   繁体   中英

Install4j: How to prevent file overwrites when using 'Add VM options' installation action?

We are using some calculations with 'Add VM options' installer actions. Now every time we update our system using the installer all user changes in '*.vmoptions' files are lost. Is there a good way to prevent it?

NB: We considered to use a 'Condition expression' to check if the vmoptions file is already present but have not found a way to determine proper filename because it is computed internally based on Launcher's name.

Set your condition expression to

new File(context.getLauncherById("123").getRelativeFileName().
    replaceAll(".exe", ".vmoptions")).exists()

then the action will only be executed if the .vmoptions file does not exist.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM