Merge pull request #193 from myron0815/noUpdate
start GD w/o updating -> directly start app
This commit is contained in:
@@ -64,6 +64,14 @@ public class SysProps
|
||||
return System.getProperty("no_install") != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* If true, Getdown launches the app without updating. Usage:
|
||||
* {@code -Dsilent=noupdate}.
|
||||
*/
|
||||
public static boolean noUpdate() {
|
||||
return "noupdate".equals(System.getProperty("silent"));
|
||||
}
|
||||
|
||||
/** If true, Getdown installs the app without ever bringing up a UI and then launches it.
|
||||
* Usage: {@code -Dsilent=launch}. */
|
||||
public static boolean launchInSilent () {
|
||||
|
||||
@@ -54,6 +54,7 @@ public abstract class Getdown extends Thread
|
||||
// launch, start the application after installing. Otherwise, just install and exit.
|
||||
_silent = SysProps.silent();
|
||||
if (_silent) {
|
||||
_noUpdate = SysProps.noUpdate();
|
||||
_launchInSilent = SysProps.launchInSilent();
|
||||
}
|
||||
// If we're running in a headless environment and have not otherwise customized
|
||||
@@ -269,7 +270,7 @@ public abstract class Getdown extends Thread
|
||||
// and force our UI to be recreated with the updated info
|
||||
createInterfaceAsync(true);
|
||||
}
|
||||
if (!_app.lockForUpdates()) {
|
||||
if (!_noUpdate && !_app.lockForUpdates()) {
|
||||
throw new MultipleGetdownRunning();
|
||||
}
|
||||
|
||||
@@ -306,6 +307,13 @@ public abstract class Getdown extends Thread
|
||||
_toInstallResources = new HashSet<>();
|
||||
_readyToInstall = false;
|
||||
|
||||
// directly start the app with the noupdate flag
|
||||
if (_noUpdate) {
|
||||
log.info("Launching without update!");
|
||||
launch();
|
||||
return;
|
||||
}
|
||||
|
||||
// setStep(Step.START);
|
||||
for (int ii = 0; ii < MAX_LOOPS; ii++) {
|
||||
// make sure we have the desired version and that the metadata files are valid...
|
||||
@@ -1041,6 +1049,7 @@ public abstract class Getdown extends Thread
|
||||
|
||||
protected boolean _dead;
|
||||
protected boolean _silent;
|
||||
protected boolean _noUpdate;
|
||||
protected boolean _launchInSilent;
|
||||
protected long _startup;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user