diff --git a/packages/app-builder-lib/src/targets/nsis/NsisTarget.ts b/packages/app-builder-lib/src/targets/nsis/NsisTarget.ts index 01e935ad9a7..d8e7a06f095 100644 --- a/packages/app-builder-lib/src/targets/nsis/NsisTarget.ts +++ b/packages/app-builder-lib/src/targets/nsis/NsisTarget.ts @@ -86,14 +86,14 @@ export class NsisTarget extends Target { NsisTargetOptions.resolve(this.options) } - protected buildUniversalInstaller() { + get shouldBuildUniversalInstaller() { const buildSeparateInstallers = this.options.buildUniversalInstaller === false return !buildSeparateInstallers } build(appOutDir: string, arch: Arch) { this.archs.set(arch, appOutDir) - if (!this.buildUniversalInstaller()) { + if (!this.shouldBuildUniversalInstaller) { return this.buildInstaller(new Map().set(arch, appOutDir)) } return Promise.resolve() @@ -139,11 +139,10 @@ export class NsisTarget extends Target { } protected installerFilenamePattern(primaryArch?: Arch | null, defaultArch?: string): string { - if (!this.buildUniversalInstaller()) { - return "${productName} " + (this.isPortable ? "" : "Setup ") + "${version}" + (primaryArch != null ? getArchSuffix(primaryArch, defaultArch) : "") + ".${ext}" - } - // tslint:disable:no-invalid-template-strings - return "${productName} " + (this.isPortable ? "" : "Setup ") + "${version}.${ext}" + const setupText = this.isPortable ? "" : "Setup " + const archSuffix = !this.shouldBuildUniversalInstaller && primaryArch != null ? getArchSuffix(primaryArch, defaultArch) : "" + + return "${productName} " + setupText + "${version}" + archSuffix + ".${ext}"; } private get isPortable(): boolean { @@ -151,7 +150,7 @@ export class NsisTarget extends Target { } async finishBuild(): Promise { - if (!this.buildUniversalInstaller()) { + if (!this.shouldBuildUniversalInstaller) { return this.packageHelper.finishBuild() } try { @@ -375,7 +374,7 @@ export class NsisTarget extends Target { protected generateGitHubInstallerName(primaryArch: Arch | null, defaultArch: string | undefined): string { const appInfo = this.packager.appInfo const classifier = appInfo.name.toLowerCase() === appInfo.name ? "setup-" : "Setup-" - const archSuffix = !this.buildUniversalInstaller() && primaryArch != null ? getArchSuffix(primaryArch, defaultArch) : "" + const archSuffix = !this.shouldBuildUniversalInstaller && primaryArch != null ? getArchSuffix(primaryArch, defaultArch) : "" return `${appInfo.name}-${this.isPortable ? "" : classifier}${appInfo.version}${archSuffix}.exe` } diff --git a/packages/app-builder-lib/src/targets/nsis/WebInstallerTarget.ts b/packages/app-builder-lib/src/targets/nsis/WebInstallerTarget.ts index cc64b68dd72..cad495bdc36 100644 --- a/packages/app-builder-lib/src/targets/nsis/WebInstallerTarget.ts +++ b/packages/app-builder-lib/src/targets/nsis/WebInstallerTarget.ts @@ -36,7 +36,7 @@ export class WebInstallerTarget extends NsisTarget { defines.APP_PACKAGE_URL = appPackageUrl } - protected buildUniversalInstaller(): boolean { + get shouldBuildUniversalInstaller() { if (this.options.buildUniversalInstaller === false) { log.warn({ buildUniversalInstaller: true }, "only universal builds are supported for nsis-web installers, overriding setting") }