如何在install4j中更改所需的磁盘空间 [英] How to change Required Disk space in install4j
问题描述
如果有人可以帮助我,我将不胜感激
I would appreciate if anyone can help me with this
我正在使用install4j创建可执行文件,我需要2Gb的最小空间,您可以对此进行检查吗?.
I am using install4j to create executable file, I need 2Gb of minimum space required , you can put this check ?.
我还想检查机器是否已安装JDK的1.6X版本,否则我应该终止安装程序.当前我的安装程序正在寻找JRE
I also want to check that machine should have 1.6X version of JDK installed, else I should terminate the installer. currently my installer is looking for JRE
预先感谢
桑杰(Sanjay)
推荐答案
对于磁盘空间检查,将运行脚本"操作添加到安装程序的启动"节点,并将其脚本设置为
For the disk space check, add a "Run script" action to the "Startup" node of your installer and set its script to
if (SystemInfo.getFreeDiskSpace(context.getInstallationDirectory()) < 2000000000) {
Util.showErrorMessage("You need at least 2 GB of free memory");
return false;
}
return true;
然后,将操作的失败策略"属性设置为失败时退出":
Then, set the "Failure strategy" property of the action to "Quit on failure":
对于Java版本检查,请转到常规设置"->"Java版本",然后将最低版本设置为1.6:
For the Java version check, go to General settings->Java version and set the minimum version to 1.6:
如果安装程序找不到最低版本的1.6 JRE,它将显示一个对话框,并显示相应的消息.
If the installer cannot find a 1.6 JRE with that minimum version, it will display a dialog with an appropriate message.
这篇关于如何在install4j中更改所需的磁盘空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!