[Forge installer] bug fixes

This commit is contained in:
khanhduytran0 2020-11-22 13:35:21 +07:00
parent 79ae41a651
commit 7a148a58d5
2 changed files with 4 additions and 1 deletions

View file

@ -108,6 +108,8 @@ public class JavaGUILauncherActivity extends LoggableActivity {
} }
private void doCustomInstall(File modFile, String javaArgs) throws IOException { private void doCustomInstall(File modFile, String javaArgs) throws IOException {
isLogAllow = true;
// Attempt to detects some mod installers // Attempt to detects some mod installers
BaseInstaller installer = new BaseInstaller(); BaseInstaller installer = new BaseInstaller();
installer.setInput(modFile); installer.setInput(modFile);
@ -116,6 +118,7 @@ public class JavaGUILauncherActivity extends LoggableActivity {
appendlnToLog("Detected Forge installer!"); appendlnToLog("Detected Forge installer!");
new ForgeInstaller(installer).install(this); new ForgeInstaller(installer).install(this);
} else { } else {
isLogAllow = false;
mIsCustomInstall = false; mIsCustomInstall = false;
launchJavaRuntime(modFile, javaArgs); launchJavaRuntime(modFile, javaArgs);
} }

View file

@ -35,7 +35,7 @@ public class ForgeInstaller extends BaseInstaller {
String[] libInfos = profile.install.path.split(":"); String[] libInfos = profile.install.path.split(":");
File libraryFile = new File(Tools.libraries, Tools.artifactToPath(libInfos[0], libInfos[1], libInfos[2])); File libraryFile = new File(Tools.libraries, Tools.artifactToPath(libInfos[0], libInfos[1], libInfos[2]));
libraryFile.mkdirs(); libraryFile.mkdirs();
target = libraryFile.getAbsolutePath() + "/" + profile.install.filePath.replace("-universal", ""); target = libraryFile.getAbsolutePath().replace("-universal", "");
ctx.appendlnToLog("Writing " + target); ctx.appendlnToLog("Writing " + target);
FileOutputStream out = new FileOutputStream(target); FileOutputStream out = new FileOutputStream(target);
IOUtils.copy(mJarFile.getInputStream(mJarFile.getEntry(profile.install.filePath)), out); IOUtils.copy(mJarFile.getInputStream(mJarFile.getEntry(profile.install.filePath)), out);