Skip to content

Commit

Permalink
Add install path to win registry for cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
9prady9 committed Jun 21, 2018
1 parent befa265 commit 0f718fa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions CMakeModules/nsis/NSIS.template.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
;Default installation folder
InstallDir "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_INSTALL_DIRECTORY@\v@CPACK_PACKAGE_VERSION_MAJOR@"

!define cmake_pkg_reg_key 'HKCU "Software\Kitware\CMake\Packages\Forge"'

;--------------------------------
;General

Expand Down Expand Up @@ -695,7 +697,8 @@ Section "-Core installation"
@CPACK_NSIS_CREATE_ICONS_EXTRA@
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe"

CreateShortcut "$INSTDIR\..\cmake.lnk" "$INSTDIR\cmake"
;Add key for CMake package
WriteRegStr ${cmake_pkg_reg_key} Forge_CMake_DIR '$INSTDIR'

;Read a value from an InstallOptions INI file
!insertmacro MUI_INSTALLOPTIONS_READ $DO_NOT_ADD_TO_PATH "NSIS.InstallOptions.ini" "Field 2" "State"
Expand Down Expand Up @@ -852,7 +855,9 @@ Section "Uninstall"
@CPACK_NSIS_DELETE_ICONS@
@CPACK_NSIS_DELETE_ICONS_EXTRA@

Delete "$INSTDIR\..\cmake.lnk"
;Delete cmake package key
DeleteRegValue ${cmake_pkg_reg_key} Forge_CMake_DIR

;Delete empty start menu parent diretories
StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"

Expand Down

0 comments on commit 0f718fa

Please sign in to comment.