diff --git a/packages/app-builder-lib/src/targets/nsis/WebInstallerTarget.ts b/packages/app-builder-lib/src/targets/nsis/WebInstallerTarget.ts index cad495bdc36..ccc9b4aef75 100644 --- a/packages/app-builder-lib/src/targets/nsis/WebInstallerTarget.ts +++ b/packages/app-builder-lib/src/targets/nsis/WebInstallerTarget.ts @@ -30,9 +30,9 @@ export class WebInstallerTarget extends NsisTarget { } appPackageUrl = computeDownloadUrl(publishConfigs[0], null, packager) + defines.APP_PACKAGE_URL_IS_INCOMPLETE = null } - defines.APP_PACKAGE_URL_IS_INCOMPLETE = null defines.APP_PACKAGE_URL = appPackageUrl } diff --git a/test/src/windows/webInstallerTest.ts b/test/src/windows/webInstallerTest.ts index d3e56fa5bed..495ce923ddc 100644 --- a/test/src/windows/webInstallerTest.ts +++ b/test/src/windows/webInstallerTest.ts @@ -1,5 +1,5 @@ import { Arch, Platform } from "electron-builder" -import { app } from "../helpers/packTester" +import { app, assertPack } from "../helpers/packTester" // tests are heavy, to distribute tests across CircleCI machines evenly, these tests were moved from oneClickInstallerTest @@ -52,3 +52,24 @@ test("web installer, safe name on github", ({ expect }) => }, }, })) + +test("web installer, appPackageUrl is complete URL (no arch paths appended)", ({ expect }) => + assertPack( + expect, + "test-app-one", + { + targets: Platform.WINDOWS.createTarget(["nsis-web"], Arch.x64), + config: { + publish: null, + nsisWeb: { + appPackageUrl: "https://example.com/download/latest", + }, + }, + effectiveOptionComputed: async it => { + const defines = it[0] + expect(defines.APP_PACKAGE_URL).toEqual("https://example.com/download/latest") + expect(defines.APP_PACKAGE_URL_IS_INCOMPLETE).toBeUndefined() + return true + }, + } + ))