Code: Select all
public void CheckForUpdates() {
boolean isUpdate = false;
Thread thread = new Thread() {
public void run() {
Runtime rt = Runtime.getRuntime();
String updater = System.getProperty("user.dir") + File.separator+"MyUpdater.exe";
String[] commands = {updater, "/justcheck"};
Process proc = rt.exec(commands);
int exitValue = proc.waitFor();
if(exitValue == 0){
doUpdates();
}
}
};
thread.start();
}
public void doUpdates(){
Thread thread = new Thread() {
public void run() {
Runtime rt = Runtime.getRuntime();
String updater = System.getProperty("user.dir") + File.separator+"MyUpdater.exe";
File f = new File(updater);
if (f.exists()) {
rt.exec(updater);
}
}
};
thread.start();
}
However, when I double click the WorkClockUpdater.exe, the files are downloaded and the app is updated. Below is the aiu file that is created for the update.
Code: Select all
;aiu;
[myappUpdate]
Name = myapp
NoGUICommandLineSwitch = /exenoui /qn
ProductVersion = 1.0.15.0
URL = https://myappurl/downloads32/myapp_1.0.15.0.exe
Size = 113953141
MD5 = 1590253ad165cd0814b1653de368e515
ServerFileName = myapp_1.0.15.0.exe
Flags = Critical|SilentInstall|NoCache|Advertises|IsPatch
FilePath = [APPDIR]myapp.exe
Version = 1.0.15.0
Description = All
Any ideas on what I am missing here?