diff --git a/bin/application/DBController.class b/bin/application/DBController.class index 6a474fe..9f604cf 100644 Binary files a/bin/application/DBController.class and b/bin/application/DBController.class differ diff --git a/bin/application/updater.class b/bin/application/updater.class index 74eb3a1..53dccc4 100644 Binary files a/bin/application/updater.class and b/bin/application/updater.class differ diff --git a/src/application/updater.java b/src/application/updater.java index af41994..755a2a6 100644 --- a/src/application/updater.java +++ b/src/application/updater.java @@ -49,8 +49,9 @@ public class updater implements Runnable{ apiOutput = ina.readLine(); ina.close(); } catch (IOException e1) { - mainWindowController.showErrorMsg(mainWindowController.errorUpdateV, e1); - e1.printStackTrace(); + Platform.runLater(() -> { + mainWindowController.showErrorMsg(mainWindowController.errorUpdateV, e1); + }); } JsonObject object = Json.parse(apiOutput).asObject(); @@ -89,8 +90,9 @@ public class updater implements Runnable{ pm.setMillisToPopup(0); pm.setMinimum(0);// tell the progress bar that we start at the beginning of the stream pm.setMaximum(conn.getContentLength());// tell the progress bar the total number of bytes we are going to read. - FileUtils.copyInputStreamToFile(pmis, new File("ProjectHomeFlix.jar")); - + 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")); //TODO rename update to old name + org.apache.commons.io.FileUtils.deleteQuietly(new File("ProjectHomeFlix_update.jar")); //delete update Runtime.getRuntime().exec("java -jar ProjectHomeFlix.jar"); //start again System.exit(0); //finishes itself } catch (IOException e) { diff --git a/updates/ProjectHomeFlix.jar b/updates/ProjectHomeFlix.jar index 8003967..31122e3 100644 Binary files a/updates/ProjectHomeFlix.jar and b/updates/ProjectHomeFlix.jar differ