fixed a bug with the new updater

* fixed update failed caused by bad replacing
This commit is contained in:
Seil0 2017-06-01 18:18:49 +02:00
parent 888a2c5014
commit 0aca3b964a
4 changed files with 3 additions and 2 deletions

Binary file not shown.

Binary file not shown.

View File

@ -90,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) {

Binary file not shown.