具有Inno Setup 5的JavaFX Self Installer-允许用户更改安装目录 [英] JavaFX Self Installer With Inno Setup 5 - Allow user to change install directory

查看:141
本文介绍了具有Inno Setup 5的JavaFX Self Installer-允许用户更改安装目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Ant为JavaFX应用程序构建一个自我部署的EXE.

I am using Ant to build a self deploying EXE for a JavaFX application.

当前,Inno Setup将EXE放在此处:C:\ Users \ username \ AppData \ Local \ application name

Currently Inno Setup places the EXE here: C:\Users\username\AppData\Local\application name

我想将其放置在其他位置,并为用户提供覆盖此选项的选项.但是我似乎找不到更改此设置的蚂蚁设置.

I would like to place this in a different location, and provide the user the option to override this. However I can't seem to find the ant settings to change this.

这可能吗?

谢谢!

推荐答案

实际上,您无法使用ANT更改此设置.但是,您已经知道部署机制使用Inno Setup,并且可以修改其行为.

Actually you can't change this using ANT. However, as you already know the deploy mechanism uses Inno Setup and you can modify its behaviour.

fx:deploy ANT任务期间,将创建一个默认的ApplicationName.iss文件.该默认文件包含例如设置,它负责安装目录.仅当您不自行提供任何自定义内容时,才会创建此默认文件.因此,我建议运行ANT脚本,复制默认文件并进行修改.如果启用fx:deploy任务的verbose标志,则可以使用控制台输出来找出创建默认文件的位置,创建默认文件的位置以及ANT任务在创建默认文件之前搜索您的自定义文件的位置:

During the fx:deploy ANT task a default ApplicationName.iss file is created. This default file contains e.g. the setting, which is responsible for the install directory. This default file is only created, if you don't provide any customized on your own. So, I would recommend to run the ANT script, copy the default file and modify it. If you enable the verbose flag of the fx:deploy task you can use the console output to find out, where the default file is created and where the ANT task searches for your customized file before creating the default one:

<fx:deploy
    ...
    verbose="true">

    <fx:info title="${appname}" vendor="${vendor}"/>
    ...
</fx:deploy>

就我而言,我在

C:\Users\gfkri\AppData\Local\Temp\fxbundler3627681647438085792\windows

,并且必须将自定义文件放置到

and had to put the customized file to

package/windows/ApplicationName.iss

相对于ANT构建脚本.

relative to the ANT build script.

如果到目前为止,您将在ApplicationName.iss文件中找到行DisableDirPage=Yes.将其更改为DisableDirPage=No,用户可以更改安装目录.

If you got so far, you'll find the line DisableDirPage=Yes in your ApplicationName.iss file. Change it to DisableDirPage=No and the user gets the possibility to change the install directory.

此外,您将找到参数DefaultDirName.如果要在默认情况下将应用程序安装到C:\Program File\ApplicationName,则可以使用常量{pf},例如:DefaultDirName={pf}\ApplicationName.

Further you will find the parameter DefaultDirName. If you want to install your Application to C:\Program File\ApplicationName by default you can use the constant {pf} e.g.: DefaultDirName={pf}\ApplicationName.

这篇关于具有Inno Setup 5的JavaFX Self Installer-允许用户更改安装目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆