Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

customizing installation directory in install4j

I am building a setup in install4j which will be run for each client of a marketing agency. There is one installer, but the user can run it more than once, specifying a different clientId value at the installation time. In the end, I would like to end up with a directory structure like this:

on Mac:

/Applications/MYPRODUCTNAME-clientID1/
/Applications/MYPRODUCTNAME-clientID2/
/Applications/MYPRODUCTNAME-clientID3/

on Windows:

/Program Files/MYPRODUCTNAME-clientID1/
/Program Files/MYPRODUCTNAME-clientID2/
/Program Files/MYPRODUCTNAME-clientID3/

Where the IDs are entered at installation time, in independent installer runs. The IDs are not known in advance - I can't build as many installers as there are IDs. Ideally, on Mac, I would also prefer to change the name of the launcher file, so that it can be easily discerned from the others in Spotlight search. I've been playing with Directory Resolver - no luck, especially on Mac which seams to produce a broken launcher on every attempt to change its directory structure.

Any help will be greatly appreciated!

like image 898
Anatoly Volkhover Avatar asked May 04 '26 15:05

Anatoly Volkhover


1 Answers

You can change the installation directory by calling

context.setInstallationDirectory(...);

in a "Run script" action or any code snippet in install4j.

Changing launcher names at runtime is not directly supported by install4j.

like image 147
Ingo Kegel Avatar answered May 06 '26 06:05

Ingo Kegel