[FEATURE] Расширенные настройки Launch4J

This commit is contained in:
Gravit 2019-05-26 09:57:22 +07:00
parent 07ba774ed9
commit 30c34d4ce9
2 changed files with 5 additions and 0 deletions

View file

@ -252,6 +252,8 @@ public void close() {
public static class ExeConf {
public boolean enabled;
public boolean setMaxVersion;
public String maxVersion;
public String productName;
public String productVer;
public String fileDesc;
@ -705,6 +707,7 @@ private void generateConfigIfNotExists(boolean testEnv) throws IOException {
newConfig.launch4j.txtProductVersion = "%s, build %d";
newConfig.launch4j.productName = "GravitLauncher";
newConfig.launch4j.productVer = newConfig.launch4j.fileVer;
newConfig.launch4j.maxVersion = "1.8.999";
newConfig.env = LauncherConfig.LauncherEnvironment.STD;
newConfig.startScript = JVMHelper.OS_TYPE.equals(JVMHelper.OS.MUSTDIE) ? "." + File.separator + "start.bat" : "." + File.separator + "start.sh";
newConfig.hwidHandler = new AcceptHWIDHandler();

View file

@ -78,6 +78,8 @@ private void setConfig() {
// Prepare JRE
Jre jre = new Jre();
jre.setMinVersion("1.8.0");
if(server.config.launch4j.setMaxVersion)
jre.setMaxVersion(server.config.launch4j.maxVersion);
jre.setRuntimeBits(Jre.RUNTIME_BITS_64_AND_32);
jre.setJdkPreference(Jre.JDK_PREFERENCE_PREFER_JRE);
config.setJre(jre);