Browse Source

UpdateController update

pull/24/head
Jannik 4 years ago
parent
commit
e3feebcbb4
  1. 4
      src/main/java/kellerkinder/HomeFlix/controller/UpdateController.java

4
src/main/java/kellerkinder/HomeFlix/controller/UpdateController.java

@ -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);

Loading…
Cancel
Save

Du besuchst diese Seite mit einem veralteten IPv4-Internetzugang. Möglicherweise treten in Zukunft Probleme mit der Erreichbarkeit und Performance auf. Bitte frage deinen Internetanbieter oder Netzwerkadministrator nach IPv6-Unterstützung.
You are visiting this site with an outdated IPv4 internet access. You may experience problems with accessibility and performance in the future. Please ask your ISP or network administrator for IPv6 support.
Weitere Infos | More Information
Klicke zum schließen | Click to close