在install4j中自定义安装目录 [英] customizing installation directory in install4j
问题描述
我正在install4j中建立一个安装程序,将为营销代理机构的每个客户端运行。有一个安装程序,但用户可以多次运行它,在安装时指定一个不同的clientId值。最后,我想最终得到一个目录结构:
在Mac上:
/应用程序/ MYPRODUCTNAME-clientID1 /
/ pre>
/应用程序/ MYPRODUCTNAME-clientID2 /
/应用程序/ MYPRODUCTNAME-clientID3 /
在Windows上:
/程序文件/ MYPRODUCTNAME- clientID1 /
/程序文件/ MYPRODUCTNAME-clientID2 /
/程序文件/ MYPRODUCTNAME-clientID3 /
在安装时输入ID,在独立的安装程序运行中。这些ID不是提前知道的 - 我不能像ID一样构建尽可能多的安装程序。
理想情况下,在Mac上,我还要更改启动器文件的名称,以便在Spotlight搜索中轻松识别别人的名称。
我一直在使用目录解析器 - 没有运气,特别是在Mac上,每次尝试更改其目录结构时,都会发生破碎的发射器。
任何帮助将不胜感激!
解决方案您可以通过调用
$ b更改安装目录$ bcontext.setInstallationDirectory(...);
在运行脚本操作或任何代码片段在install4j。
在运行时更改启动器名称不受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!
解决方案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.
这篇关于在install4j中自定义安装目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!