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