Skip to content

Commit 63c67ef

Browse files
committed
fix(nsis): apostrophe in product name
Closes #750
1 parent 517a90b commit 63c67ef

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

templates/nsis/multiUser.nsh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,21 @@ Var installMode
6363

6464
# SHCTX is the hive HKLM if SetShellVarContext all, or HKCU if SetShellVarContext user
6565
!macro registryAddInstallInfo
66-
# Write the installation path into the registry
6766
WriteRegStr SHCTX "${INSTALL_REGISTRY_KEY}" InstallLocation "$INSTDIR"
6867

69-
# Write the uninstall keys for Windows
7068
${if} $installMode == "all"
71-
WriteRegStr SHCTX "${UNINSTALL_REGISTRY_KEY}" DisplayName "${UNINSTALL_DISPLAY_NAME}"
72-
WriteRegStr SHCTX "${UNINSTALL_REGISTRY_KEY}" UninstallString '"$INSTDIR\${UNINSTALL_FILENAME}" /allusers'
69+
StrCpy $0 "/allusers"
70+
StrCpy $1 ""
7371
${else}
74-
WriteRegStr SHCTX "${UNINSTALL_REGISTRY_KEY}" DisplayName "${UNINSTALL_DISPLAY_NAME} (only current user)"
75-
WriteRegStr SHCTX "${UNINSTALL_REGISTRY_KEY}" UninstallString '"$INSTDIR\${UNINSTALL_FILENAME}" /currentuser'
72+
StrCpy $0 "/currentuser"
73+
StrCpy $1 " (only current user)"
7674
${endif}
7775

76+
WriteRegStr SHCTX "${UNINSTALL_REGISTRY_KEY}" DisplayName "${UNINSTALL_DISPLAY_NAME}$1"
77+
# https://github.com/electron-userland/electron-builder/issues/750
78+
StrCpy $2 "$INSTDIR\${UNINSTALL_FILENAME}"
79+
WriteRegStr SHCTX "${UNINSTALL_REGISTRY_KEY}" UninstallString '"$2" $0'
80+
7881
WriteRegStr SHCTX "${UNINSTALL_REGISTRY_KEY}" "DisplayVersion" "${VERSION}"
7982
WriteRegStr SHCTX "${UNINSTALL_REGISTRY_KEY}" "DisplayIcon" "$appExe,0"
8083
WriteRegStr SHCTX "${UNINSTALL_REGISTRY_KEY}" "Publisher" "${COMPANY_NAME}"

0 commit comments

Comments
 (0)