Is there a way to preserve VM options between Install4j releases?

Viewed 32

We are currently trying to find a way to reuse user's VM options between major version releases. Currently the application keeps creating new .vmoptions files for each new major release. This has resulted in us having multiple .vmoptions files in the installation directory. It would be ideal if we could detect .vmoptions files from previous releases and include them with the new build. I have not been able to find an easy way to do this. Am I missing something easy?

1 Answers

You can set the content of the generated .vmoptions file to something like

-include-options ~/Library/Preferences/MyApp.vmoptions

and ask the user to edit ~/Library/Preferences/MyApp.vmoptions which will remain fixed for multiple releases. The location of the includes file is platform-specific, you can set it to ${installer:vmOptionsLocation} and use a "Replace installer variables in text files" action to replace it with a value that you set to that installer variable in the installer, for example with a "Set a variable" action.

Related