Browse Source

ENH: Add a line to Add/Remove programs to uninstall

Andy Cedilnik 19 years ago
parent
commit
8bb82f430c
1 changed files with 5 additions and 0 deletions
  1. 5 0
      Modules/NSIS.template.in

+ 5 - 0
Modules/NSIS.template.in

@@ -362,6 +362,10 @@ Section "Installer Section" InstSection
   
   ;Create uninstaller
   WriteUninstaller "$INSTDIR\Uninstall.exe"
+  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_DIRECTORY@" \
+    "DisplayName" "@CPACK_PACKAGE_INSTALL_DIRECTORY@ -- @CPACK_PACKAGE_DESCRIPTION_SUMMARY@"
+WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_DIRECTORY@" \
+    "UninstallString" "$INSTDIR\Uninstall.exe"
 
   !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
     
@@ -416,6 +420,7 @@ Section "Uninstall"
 
   ;Remove the uninstaller itself.
   Delete "$INSTDIR\Uninstall.exe"
+  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_DIRECTORY@"
 
   ;Remove the installation directory if it is empty.
   RMDir "$INSTDIR"