summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2006-04-30 00:01:34 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2006-04-30 00:01:34 (GMT)
commitde4127cdda9dd7effc3d16fc8a1b0c1c9711308b (patch)
treee6b58b01a65dc8ffb92a8161d677ebdb29c5f43d /Modules
parent619ebce6cf2a0b03915387fb3c9bbd1cb39db795 (diff)
downloadCMake-de4127cdda9dd7effc3d16fc8a1b0c1c9711308b.zip
CMake-de4127cdda9dd7effc3d16fc8a1b0c1c9711308b.tar.gz
CMake-de4127cdda9dd7effc3d16fc8a1b0c1c9711308b.tar.bz2
ENH: Add more install registry options
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CPack.cmake2
-rw-r--r--Modules/NSIS.template.in39
2 files changed, 38 insertions, 3 deletions
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index 25785a0..d5e9b41 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -101,6 +101,8 @@ cpack_set_if_not_set(CPACK_INSTALL_CMAKE_PROJECTS
cpack_set_if_not_set(CPACK_CMAKE_GENERATOR "${CMAKE_GENERATOR}")
cpack_set_if_not_set(CPACK_TOPLEVEL_TAG "${CPACK_SYSTEM_NAME}")
+cpack_set_if_not_set(CPACK_NSIS_DISPLAY_NAME "@CPACK_PACKAGE_INSTALL_DIRECTORY@")
+
cpack_encode_variables()
CONFIGURE_FILE("${cpack_input_file}"
"${CMAKE_BINARY_DIR}/CPackConfig.cmake" @ONLY IMMEDIATE)
diff --git a/Modules/NSIS.template.in b/Modules/NSIS.template.in
index b2d69bd..b910a3e 100644
--- a/Modules/NSIS.template.in
+++ b/Modules/NSIS.template.in
@@ -64,7 +64,9 @@ Function .onInit
StrCmp $SV_ALLUSERS "AllUsers" 0 +2
StrCpy $INSTDIR "$PROGRAMFILES\@CPACK_PACKAGE_INSTALL_DIRECTORY@"
- !insertmacro MUI_INSTALLOPTIONS_EXTRACT "NSIS.InstallOptions.ini"
+ StrCmp "@CPACK_NSIS_MODIFY_PATH@" "ON" 0 noOptionsPage
+ !insertmacro MUI_INSTALLOPTIONS_EXTRACT "NSIS.InstallOptions.ini"
+ noOptionsPage:
FunctionEnd
;--------------------------------
@@ -378,6 +380,17 @@ FunctionEnd
!insertmacro StrStr ""
!insertmacro StrStr "un."
+Function ConditionalAddToRegisty
+ Pop $0
+ Pop $1
+ StrCmp "$0" "" ConditionalAddToRegisty_EmptyString
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_DIRECTORY@" \
+ "$1" "$0"
+ ;MessageBox MB_OK "Set Registry: '$1' to '$0'"
+ DetailPrint "Set install registry entry: '$1' to '$0'"
+ ConditionalAddToRegisty_EmptyString:
+FunctionEnd
+
;--------------------------------
; Define some macro setting for the gui
@@ -426,7 +439,6 @@ Section "Add to path"
;Read a value from an InstallOptions INI file
!insertmacro MUI_INSTALLOPTIONS_READ $ADD_TO_PATH "NSIS.InstallOptions.ini" "Field 2" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $ADD_TO_PATH_ALL_USERS "NSIS.InstallOptions.ini" "Field 3" "State"
- ;StrCmp "@CPACK_NSIS_MODIFY_PATH@" "ON" 0 +2
StrCmp $ADD_TO_PATH "1" 0 doNotAddToPath
Call AddToPath
doNotAddToPath:
@@ -445,10 +457,31 @@ 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@"
+ "DisplayName" "@CPACK_NSIS_DISPLAY_NAME@"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_DIRECTORY@" \
+ "DisplayVersion" "@CPACK_PACKAGE_VERSION@"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_DIRECTORY@" \
+ "Publisher" "@CPACK_PACKAGE_VENDOR@"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_DIRECTORY@" \
"UninstallString" "$INSTDIR\Uninstall.exe"
+ ; Optional registration
+ Push "DisplayIcon"
+ Push "$INSTDIR\@CPACK_NSIS_INSTALLED_ICON_NAME@"
+ Call ConditionalAddToRegisty
+ Push "HelpLink"
+ Push "@CPACK_NSIS_HELP_LINK@"
+ Call ConditionalAddToRegisty
+ Push "URLInfoAbout"
+ Push "@CPACK_NSIS_URL_INFO_ABOUT@"
+ Call ConditionalAddToRegisty
+ Push "Contact"
+ Push "@CPACK_NSIS_CONTACT@"
+ Call ConditionalAddToRegisty
+ Push "FooBar"
+ Push ""
+ Call ConditionalAddToRegisty
+
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
;Create shortcuts