How to change Required Disk space in install4j

落爺英雄遲暮 提交于 2019-12-12 14:51:28

问题


I would appreciate if anyone can help me with this

I am using install4j to create executable file, I need 2Gb of minimum space required , you can put this check ?.

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

thanks in advance

Sanjay


回答1:


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":

For the Java version check, go to General settings->Java version and set the minimum version to 1.6:

If the installer cannot find a 1.6 JRE with that minimum version, it will display a dialog with an appropriate message.



来源:https://stackoverflow.com/questions/7716972/how-to-change-required-disk-space-in-install4j

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!