UpdateController update

This commit is contained in:
Jannik 2018-04-08 13:31:27 +02:00
parent e12da3d116
commit e3feebcbb4
1 changed files with 2 additions and 2 deletions

View File

@ -148,8 +148,8 @@ public class UpdateController implements Runnable {
FileUtils.copyInputStreamToFile(pmis, new File("ProjectHomeFlix_update.jar")); // download update
org.apache.commons.io.FileUtils.copyFile(new File("ProjectHomeFlix_update.jar"), new File("ProjectHomeFlix.jar"));
org.apache.commons.io.FileUtils.deleteQuietly(new File("ProjectHomeFlix_update.jar")); // delete update
Runtime.getRuntime().exec("java -jar ProjectHomeFlix.jar"); // start again TODO consider ProcessBuilder to execute
System.exit(0); // finishes itself
new ProcessBuilder("java", "-jar", "ProjectHomeFlix.jar").start(); // start the new application
System.exit(0); // close the current application
} catch (IOException e) {
Platform.runLater(() -> {
LOGGER.info("could not download update files", e);