fixed a bug with the new updater
* fixed update failed caused by bad replacing
This commit is contained in:
parent
888a2c5014
commit
0aca3b964a
Binary file not shown.
Binary file not shown.
@ -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.
Loading…
Reference in New Issue
Block a user