From 4f7fc576ebaf71116d666671583eb1950b682209 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Tue, 30 Jan 2018 05:12:32 -0800 Subject: [PATCH] fix(nsis): allow use dot in the productName Close #2291 --- .../src/targets/nsis/NsisTarget.ts | 2 +- .../templates/nsis/common.nsh | 15 +-------------- .../templates/nsis/include/installer.nsh | 11 +++++++++++ 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/packages/electron-builder-lib/src/targets/nsis/NsisTarget.ts b/packages/electron-builder-lib/src/targets/nsis/NsisTarget.ts index fe0f9370959..0e2bbfeee2f 100644 --- a/packages/electron-builder-lib/src/targets/nsis/NsisTarget.ts +++ b/packages/electron-builder-lib/src/targets/nsis/NsisTarget.ts @@ -133,7 +133,7 @@ export class NsisTarget extends Target { APP_GUID: guid, PRODUCT_NAME: appInfo.productName, PRODUCT_FILENAME: appInfo.productFilename, - APP_FILENAME: (!oneClick || options.perMachine === true) && /^[-_+0-9a-zA-Z ]+$/.test(appInfo.productFilename) ? appInfo.productFilename : appInfo.sanitizedName, + APP_FILENAME: (!oneClick || options.perMachine === true) && /^[-_+0-9a-zA-Z .]+$/.test(appInfo.productFilename) ? appInfo.productFilename : appInfo.sanitizedName, APP_DESCRIPTION: appInfo.description, VERSION: appInfo.version, diff --git a/packages/electron-builder-lib/templates/nsis/common.nsh b/packages/electron-builder-lib/templates/nsis/common.nsh index c8cd7d9c3a4..b949005a9a9 100644 --- a/packages/electron-builder-lib/templates/nsis/common.nsh +++ b/packages/electron-builder-lib/templates/nsis/common.nsh @@ -85,17 +85,4 @@ Name "${PRODUCT_NAME}" ${endif} ${StdUtils.ExecShellAsUser} $0 "$launchLink" "open" "$startAppArgs" -!macroend - -!ifndef BUILD_UNINSTALLER - Var isTryToKeepShortcuts - - !macro setIsTryToKeepShortcuts - StrCpy $isTryToKeepShortcuts "true" - !ifdef allowToChangeInstallationDirectory - ${ifNot} ${isUpdated} - StrCpy $isTryToKeepShortcuts "false" - ${endIf} - !endif - !macroend -!endif \ No newline at end of file +!macroend \ No newline at end of file diff --git a/packages/electron-builder-lib/templates/nsis/include/installer.nsh b/packages/electron-builder-lib/templates/nsis/include/installer.nsh index f9e4366befb..9ba100a850c 100644 --- a/packages/electron-builder-lib/templates/nsis/include/installer.nsh +++ b/packages/electron-builder-lib/templates/nsis/include/installer.nsh @@ -235,3 +235,14 @@ ${endIf} !endif !macroend + +Var /GLOBAL isTryToKeepShortcuts + +!macro setIsTryToKeepShortcuts + StrCpy $isTryToKeepShortcuts "true" + !ifdef allowToChangeInstallationDirectory + ${ifNot} ${isUpdated} + StrCpy $isTryToKeepShortcuts "false" + ${endIf} + !endif +!macroend \ No newline at end of file