Skip to content

Commit

Permalink
Fix NSIS uninstaller registry entries
Browse files Browse the repository at this point in the history
- Fix registry entry to include the app in the Windows "Uninstall programs" list
- Fix to remove registry uninstall keys after uninstallation
- Add "win" to installer name to clarify that it is a Windows-specific installer
  • Loading branch information
yoda-vid committed May 2, 2021
1 parent e0e9579 commit 71d20dc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/packager.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

; application name and output installer file
Name "${APP_NAME} ${VER}"
OutFile "${BASEDIR}\${APP_NAME_VER}-installer.exe"
OutFile "${BASEDIR}\${APP_NAME_VER}-win-installer.exe"

; default installation folder, overriding with registry key if available
InstallDir "$LOCALAPPDATA\${APP_NAME}\${APP_NAME_VER}"
Expand Down Expand Up @@ -120,9 +120,9 @@ Section "MagellanMapper" SecMagMap
WriteUninstaller "$INSTDIR\Uninstall.exe"

; write apps add/remove descriptions
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" \
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" \
"DisplayName" "${APP_NAME}: a graphical imaging informatics suite for 3D reconstruction"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" \
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" \
"UninstallString" "$\"$INSTDIR\uninstall.exe$\""

!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
Expand Down Expand Up @@ -177,6 +177,6 @@ Section "Uninstall"
; remove installation directory path to avoid reinstalling to old version num
DeleteRegKey HKCU "Software\${APP_NAME_VER}"
DeleteRegKey /ifempty HKCU "Software\${APP_NAME_VER}"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}"
DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}"

SectionEnd

0 comments on commit 71d20dc

Please sign in to comment.