Skip to content

Commit

Permalink
Disable Auto-update (#2139)
Browse files Browse the repository at this point in the history
* autoDownload set to false

* Set default for auto-update to be false

* Autoupdate cmdline overwrite

* Minor cleanup

* * Reverted default of autoupdate from Disable to Enable
* Changed naming for cmdline flag

* Added persisting user config changes

* * Reverted user settings changes due to a bug - will revisit
* Minor fixes

* Changed cmdline naming for autoupdate

* Minor changes

* Changed test for application start up

* Changed batch account name + minor fixes

Co-authored-by: Brandon Klein <bgklein@wisc.edu>
  • Loading branch information
cRui861 and bgklein authored Feb 13, 2020
1 parent 85437d3 commit 0216050
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions dev-app-update.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
owner: Azure
repo: BatchExplorer
provider: github
updaterCacheDirName: BatchExplorer-cache
4 changes: 4 additions & 0 deletions src/client/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@ import * as commander from "commander";
import { app } from "electron";

export interface BatchExplorerArgs {
disableAutoupdate?: boolean;
updated?: boolean;
userDataDir?: string;
ignoreCertificateErrors?: boolean;
args: string[];
}

// add user config options (in Settings) to also let the status of the autoupdate to persist - whether that be on or off
// change naming to "set autoupdate on/off" or "autoupdate set to true/false" -> as Xing/Matt
export function parseArguments(argv: string[]): BatchExplorerArgs {
return commander
.version(app.getVersion())
.option("--disable-auto-update", "Disables autoupdate for one instance of opening up the application")
.option("--updated", "If the application was just updated")
.option("--user-data-dir <path>", "Change the user data directory. Used for tests")
.option("--ignore-certificate-errors", "Ignore https certificate errors")
Expand Down
5 changes: 5 additions & 0 deletions src/client/startup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ export async function startBatchExplorer(args: BatchExplorerArgs) {
app.commandLine.appendSwitch("ignore-certificate-errors", "true");
}

if (args.disableAutoupdate) {
log.warn("Application will not autoupdate");
autoUpdater.autoInstallOnAppQuit = false;
}

const module = await platformDynamicServer().bootstrapModule(BatchExplorerClientModule);
const localeService = module.injector.get(LocaleService) as ClientLocaleService;
await localeService.load();
Expand Down
2 changes: 1 addition & 1 deletion test/spectron/test-app-start.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe("Bundled application is starting correctly", () => {
await app.client.windowByIndex(MAIN_WINDOW_INDEX);
expect(await app.browserWindow.isVisible()).toBe(true);
expect(await app.browserWindow.getTitle()).toEqual("Batch Explorer");
await app.client.waitUntilTextExists("bl-account-list .quick-list-row-title", "prodtest1", 60_000);
await app.client.waitUntilTextExists("bl-account-list .quick-list-row-title", "0prodtest", 60_000);

});

Expand Down

0 comments on commit 0216050

Please sign in to comment.