From e3fafcf9e7f2945da979c53ce0ba16f71861f57f Mon Sep 17 00:00:00 2001 From: Alex Plumley Date: Fri, 7 Jan 2022 19:33:50 -0400 Subject: [PATCH] fix(msi): remove MSI option `iconId` Also change the fallback value for generated MSI Ids to a unique string for the product. BREAKING CHANGE: remove MSI option `iconId` --- .changeset/serious-peas-help.md | 5 +++++ packages/app-builder-lib/src/options/MsiOptions.ts | 5 ----- packages/app-builder-lib/src/targets/MsiTarget.ts | 10 +++++++--- 3 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 .changeset/serious-peas-help.md diff --git a/.changeset/serious-peas-help.md b/.changeset/serious-peas-help.md new file mode 100644 index 00000000000..9dc1fc01af8 --- /dev/null +++ b/.changeset/serious-peas-help.md @@ -0,0 +1,5 @@ +--- +"app-builder-lib": major +--- + +BREAKING CHANGE: remove MSI option `iconId` diff --git a/packages/app-builder-lib/src/options/MsiOptions.ts b/packages/app-builder-lib/src/options/MsiOptions.ts index 4132ebdb6c1..28d6da3d9d5 100644 --- a/packages/app-builder-lib/src/options/MsiOptions.ts +++ b/packages/app-builder-lib/src/options/MsiOptions.ts @@ -23,9 +23,4 @@ export interface MsiOptions extends CommonWindowsInstallerConfiguration, TargetS * Any additional arguments to be passed to the WiX installer compiler, such as `["-ext", "WixUtilExtension"]` */ readonly additionalWixArgs?: Array | null - - /** - * The [shortcut iconId](https://wixtoolset.org/documentation/manual/v4/reference/wxs/shortcut/). Optional, by default generated using app file name. - */ - readonly iconId?: string } diff --git a/packages/app-builder-lib/src/targets/MsiTarget.ts b/packages/app-builder-lib/src/targets/MsiTarget.ts index e1d6c5ad4d8..b6b4962c5eb 100644 --- a/packages/app-builder-lib/src/targets/MsiTarget.ts +++ b/packages/app-builder-lib/src/targets/MsiTarget.ts @@ -46,11 +46,15 @@ export default class MsiTarget extends Target { */ private get productMsiIdPrefix() { const sanitizedId = this.packager.appInfo.productFilename.replace(/[^\w.]/g, "").replace(/^[^A-Za-z_]+/, "") - return sanitizedId.length > 0 ? sanitizedId : "ElectronApp" + return sanitizedId.length > 0 ? sanitizedId : "App" + this.upgradeCode.replace(/-/g, "") } private get iconId() { - return this.options.iconId ?? `${this.productMsiIdPrefix}Icon.exe` + return `${this.productMsiIdPrefix}Icon.exe` + } + + private get upgradeCode(): string { + return (this.options.upgradeCode || UUID.v5(this.packager.appInfo.id, ELECTRON_BUILDER_UPGRADE_CODE_NS_UUID)).toUpperCase() } async build(appOutDir: string, arch: Arch) { @@ -178,7 +182,7 @@ export default class MsiTarget extends Target { compressionLevel: compression === "store" ? "none" : "high", version: appInfo.getVersionInWeirdWindowsForm(), productName: appInfo.productName, - upgradeCode: (options.upgradeCode || UUID.v5(appInfo.id, ELECTRON_BUILDER_UPGRADE_CODE_NS_UUID)).toUpperCase(), + upgradeCode: this.upgradeCode, manufacturer: companyName || appInfo.productName, appDescription: appInfo.description, // https://stackoverflow.com/questions/1929038/compilation-error-ice80-the-64bitcomponent-uses-32bitdirectory