diff --git a/dev-app-update.yml b/dev-app-update.yml index b9b63ecee9..317abe7413 100644 --- a/dev-app-update.yml +++ b/dev-app-update.yml @@ -1,3 +1,4 @@ owner: Azure repo: BatchExplorer provider: github +updaterCacheDirName: BatchExplorer-cache diff --git a/src/client/cli.ts b/src/client/cli.ts index d42e534b32..a4e1ce2156 100644 --- a/src/client/cli.ts +++ b/src/client/cli.ts @@ -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 ", "Change the user data directory. Used for tests") .option("--ignore-certificate-errors", "Ignore https certificate errors") diff --git a/src/client/startup.ts b/src/client/startup.ts index 58b54173f1..32ff594116 100644 --- a/src/client/startup.ts +++ b/src/client/startup.ts @@ -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(); diff --git a/test/spectron/test-app-start.spec.ts b/test/spectron/test-app-start.spec.ts index a82c5990f8..4f3c812862 100644 --- a/test/spectron/test-app-start.spec.ts +++ b/test/spectron/test-app-start.spec.ts @@ -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); });