[Cmake-commits] [cmake-commits] david.cole committed NSIS.template.in 1.40 1.41

cmake-commits at cmake.org cmake-commits at cmake.org
Tue Dec 15 13:12:08 EST 2009


Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv1480

Modified Files:
	NSIS.template.in 
Log Message:
Fix issue #9011 - eliminate unnecessary uses of CPACK_PACKAGE_INSTALL_DIRECTORY.

Replace them with CPACK_PACKAGE_NAME. The registry keys involved in this commit are used by Windows to track things in the Add/Remove programs portion of the Control Panel. With '\' characters in the keyname, the calls do not do what they are intended to do and the installed program never shows up in the control panel view. (Details noted in the issue itself.) Thanks to 'killerfox' for the patch.


Index: NSIS.template.in
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/NSIS.template.in,v
retrieving revision 1.40
retrieving revision 1.41
diff -C 2 -d -r1.40 -r1.41
*** NSIS.template.in	26 Oct 2009 21:14:56 -0000	1.40
--- NSIS.template.in	15 Dec 2009 18:12:05 -0000	1.41
***************
*** 75,79 ****
    ClearErrors
    ;Reading component status from registry
!   ReadRegDWORD $AR_RegFlags HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_DIRECTORY@\Components\${SecName}" "Installed"
    IfErrors "default_${SecName}"
      ;Status will stay default if registry value not found
--- 75,79 ----
    ClearErrors
    ;Reading component status from registry
!   ReadRegDWORD $AR_RegFlags HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@\Components\${SecName}" "Installed"
    IfErrors "default_${SecName}"
      ;Status will stay default if registry value not found
***************
*** 108,112 ****
      ;Calling Section uninstall macro and writing zero installed flag
      !insertmacro "Remove_${${SecName}}"
!     WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_DIRECTORY@\Components\${SecName}" \
    "Installed" 0
      Goto "exit_${SecName}"
--- 108,112 ----
      ;Calling Section uninstall macro and writing zero installed flag
      !insertmacro "Remove_${${SecName}}"
!     WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@\Components\${SecName}" \
    "Installed" 0
      Goto "exit_${SecName}"
***************
*** 114,118 ****
   "leave_${SecName}:"
      ;Section is selected:
!     WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_DIRECTORY@\Components\${SecName}" \
    "Installed" 1
   
--- 114,118 ----
   "leave_${SecName}:"
      ;Section is selected:
!     WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@\Components\${SecName}" \
    "Installed" 1
   
***************
*** 485,489 ****
    Pop $1
    StrCmp "$0" "" ConditionalAddToRegisty_EmptyString
!     WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_DIRECTORY@" \
      "$1" "$0"
      ;MessageBox MB_OK "Set Registry: '$1' to '$0'"
--- 485,489 ----
    Pop $1
    StrCmp "$0" "" ConditionalAddToRegisty_EmptyString
!     WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" \
      "$1" "$0"
      ;MessageBox MB_OK "Set Registry: '$1' to '$0'"
***************
*** 795,809 ****
  Section "Uninstall"
    ReadRegStr $START_MENU SHCTX \
!    "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_DIRECTORY@" "StartMenu"
    ;MessageBox MB_OK "Start menu is in: $START_MENU"
    ReadRegStr $DO_NOT_ADD_TO_PATH SHCTX \
!     "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_DIRECTORY@" "DoNotAddToPath"
    ReadRegStr $ADD_TO_PATH_ALL_USERS SHCTX \
!     "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_DIRECTORY@" "AddToPathAllUsers"
    ReadRegStr $ADD_TO_PATH_CURRENT_USER SHCTX \
!     "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_DIRECTORY@" "AddToPathCurrentUser"
    ;MessageBox MB_OK "Add to path: $DO_NOT_ADD_TO_PATH all users: $ADD_TO_PATH_ALL_USERS"
    ReadRegStr $INSTALL_DESKTOP SHCTX \
!     "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_DIRECTORY@" "InstallToDesktop"
    ;MessageBox MB_OK "Install to desktop: $INSTALL_DESKTOP "
  
--- 795,809 ----
  Section "Uninstall"
    ReadRegStr $START_MENU SHCTX \
!    "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "StartMenu"
    ;MessageBox MB_OK "Start menu is in: $START_MENU"
    ReadRegStr $DO_NOT_ADD_TO_PATH SHCTX \
!     "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "DoNotAddToPath"
    ReadRegStr $ADD_TO_PATH_ALL_USERS SHCTX \
!     "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "AddToPathAllUsers"
    ReadRegStr $ADD_TO_PATH_CURRENT_USER SHCTX \
!     "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "AddToPathCurrentUser"
    ;MessageBox MB_OK "Add to path: $DO_NOT_ADD_TO_PATH all users: $ADD_TO_PATH_ALL_USERS"
    ReadRegStr $INSTALL_DESKTOP SHCTX \
!     "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "InstallToDesktop"
    ;MessageBox MB_OK "Install to desktop: $INSTALL_DESKTOP "
  
***************
*** 822,826 ****
    ;Remove the uninstaller itself.
    Delete "$INSTDIR\Uninstall.exe"
!   DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_DIRECTORY@"
  
    ;Remove the installation directory if it is empty.
--- 822,826 ----
    ;Remove the uninstaller itself.
    Delete "$INSTDIR\Uninstall.exe"
!   DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@"
  
    ;Remove the installation directory if it is empty.



More information about the Cmake-commits mailing list