mirror of
https://github.com/processing/processing4.git
synced 2026-02-02 21:29:17 +01:00
random fixes heading towards rev 9
This commit is contained in:
@@ -61,74 +61,6 @@ implements ActionListener
|
||||
frame.add("Center", this);
|
||||
init();
|
||||
|
||||
/*
|
||||
// check for updates from the server, if enabled
|
||||
if (getBoolean("update.enabled", false)) {
|
||||
// open the update file to get the latest version
|
||||
long lastUpdate = 0;
|
||||
try {
|
||||
DataInputStream dis = new DataInputStream(new FileInputStream("lib/version"));
|
||||
lastUpdate = dis.readLong();
|
||||
} catch (IOException e) { }
|
||||
|
||||
String baseUrl = get("update.url");
|
||||
try {
|
||||
URL url = new URL(baseUrl + "version");
|
||||
URLConnection conn = url.openConnection();
|
||||
//conn.connect();
|
||||
|
||||
//System.out.println("date of last update" + conn.getDate());
|
||||
long newDate = conn.getDate();
|
||||
if (newDate > lastUpdate) {
|
||||
System.out.println("new update available");
|
||||
|
||||
DataOutputStream vos =
|
||||
new DataOutputStream(new FileOutputStream("lib/version.update"));
|
||||
vos.writeLong(newDate);
|
||||
vos.flush();
|
||||
vos.close();
|
||||
|
||||
url = new URL(baseUrl + "pde.jar");
|
||||
conn = url.openConnection();
|
||||
|
||||
// move the old pde.jar file out of the way
|
||||
//File pdeJar = new File("lib/pde.jar");
|
||||
//pdeJar.renameTo("lib/pde.old.jar");
|
||||
|
||||
// download the new pde.jar file
|
||||
FileOutputStream os = new FileOutputStream("lib/pde.jar.update");
|
||||
//Object object = conn.getContent();
|
||||
//System.out.println(object);
|
||||
InputStream is = conn.getInputStream();
|
||||
copyStream(is, os);
|
||||
os.close();
|
||||
|
||||
// if everything copied ok, rename new/old files
|
||||
// this probably needs to be way more bulletproof
|
||||
File file = new File("lib/version");
|
||||
if (file.exists()) file.renameTo(new File("lib/version.old"));
|
||||
file = new File("lib/version.update");
|
||||
file.renameTo(new File("lib/version"));
|
||||
|
||||
file = new File("lib/pde.jar");
|
||||
file.renameTo(new File("lib/pde.jar.old"));
|
||||
file = new File("lib/pde.jar.update");
|
||||
file.renameTo(new File("lib/pde.jar"));
|
||||
|
||||
// restart or relaunch
|
||||
System.out.println("done copying new version, restart");
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
} catch (IOException e1) {
|
||||
e1.printStackTrace();
|
||||
|
||||
//} catch (MalformedURLException e2) {
|
||||
//e2.printStackTrace();
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
Insets insets = frame.getInsets();
|
||||
Toolkit tk = Toolkit.getDefaultToolkit();
|
||||
Dimension screen = tk.getScreenSize();
|
||||
|
||||
Reference in New Issue
Block a user