add -Dsilent=noupdate, to just start the app w/o any updates

This commit is contained in:
Myron Boyle
2019-02-25 14:33:51 +01:00
parent 68341fedc2
commit d24d12a6c4
2 changed files with 17 additions and 0 deletions
@@ -64,6 +64,14 @@ public class SysProps
return System.getProperty("no_install") != null; 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. /** If true, Getdown installs the app without ever bringing up a UI and then launches it.
* Usage: {@code -Dsilent=launch}. */ * Usage: {@code -Dsilent=launch}. */
public static boolean launchInSilent () { 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. // launch, start the application after installing. Otherwise, just install and exit.
_silent = SysProps.silent(); _silent = SysProps.silent();
if (_silent) { if (_silent) {
_noUpdate = SysProps.noUpdate();
_launchInSilent = SysProps.launchInSilent(); _launchInSilent = SysProps.launchInSilent();
} }
// If we're running in a headless environment and have not otherwise customized // If we're running in a headless environment and have not otherwise customized
@@ -306,6 +307,13 @@ public abstract class Getdown extends Thread
_toInstallResources = new HashSet<>(); _toInstallResources = new HashSet<>();
_readyToInstall = false; _readyToInstall = false;
// directly start the app with the noupdate flag
if (_noUpdate) {
log.info("Launching without update!");
launch();
return;
}
// setStep(Step.START); // setStep(Step.START);
for (int ii = 0; ii < MAX_LOOPS; ii++) { for (int ii = 0; ii < MAX_LOOPS; ii++) {
// make sure we have the desired version and that the metadata files are valid... // 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 _dead;
protected boolean _silent; protected boolean _silent;
protected boolean _noUpdate;
protected boolean _launchInSilent; protected boolean _launchInSilent;
protected long _startup; protected long _startup;