mirror of https://github.com/CGAL/cgal
Update the NSIS script:
- no longer modify the start menu, use the "Add/Remove Programs" features
of Windows (since Windows XP)
- add some comments
This commit is contained in:
parent
e80f0c624a
commit
fae319af0d
|
|
@ -64,8 +64,6 @@
|
||||||
; Variables
|
; Variables
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
|
|
||||||
Var MUI_TEMP
|
|
||||||
Var STARTMENU_FOLDER
|
|
||||||
Var SetCGAL_DIR
|
Var SetCGAL_DIR
|
||||||
Var RegLoc
|
Var RegLoc
|
||||||
Var Add_GMP_LIB_DIR_to_PATH
|
Var Add_GMP_LIB_DIR_to_PATH
|
||||||
|
|
@ -118,13 +116,6 @@
|
||||||
; used to specify paths in vcproj files to be added.
|
; used to specify paths in vcproj files to be added.
|
||||||
Page custom envarsPage
|
Page custom envarsPage
|
||||||
|
|
||||||
;Start Menu Folder Page Configuration
|
|
||||||
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
|
|
||||||
!define MUI_STARTMENUPAGE_REGISTRY_KEY "CGAL-3.8"
|
|
||||||
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
|
|
||||||
|
|
||||||
!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER
|
|
||||||
|
|
||||||
!insertmacro MUI_PAGE_INSTFILES
|
!insertmacro MUI_PAGE_INSTFILES
|
||||||
|
|
||||||
!insertmacro MUI_PAGE_FINISH
|
!insertmacro MUI_PAGE_FINISH
|
||||||
|
|
@ -181,14 +172,31 @@ Section "!Main CGAL" MAIN_Idx
|
||||||
File ".\cgal.ico"
|
File ".\cgal.ico"
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
|
; Write uninstall informations
|
||||||
;Create shortcuts
|
; http://nsis.sourceforge.net/Add_uninstall_information_to_Add/Remove_Programs
|
||||||
CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\CGAL-3.8" \
|
||||||
|
"DisplayName" "CGAL-3.8 -- Computational Geometry Algorithms Library, version 3.8"
|
||||||
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\CGAL-3.8" \
|
||||||
|
"UninstallString" "$\"$INSTDIR\Uninstall.exe$\""
|
||||||
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\CGAL-3.8" \
|
||||||
|
"QuietUninstallString" "$\"$INSTDIR\Uninstall.exe$\" /S"
|
||||||
|
|
||||||
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\CGAL-3.8" \
|
||||||
|
"NoModify" 1
|
||||||
!insertmacro MUI_STARTMENU_WRITE_END
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\CGAL-3.8" \
|
||||||
;Create uninstaller
|
"NoRepair" 1
|
||||||
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\CGAL-3.8" \
|
||||||
|
"InstallLocation" "$\"$INSTDIR$\""
|
||||||
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\CGAL-3.8" \
|
||||||
|
"DisplayIcon" "$\"$INSTDIR$\"\cgal.ico"
|
||||||
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\CGAL-3.8" \
|
||||||
|
"Pusblisher" "The CGAL Project and GeometryFactory"
|
||||||
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\CGAL-3.8" \
|
||||||
|
"URLInfoAbout" "http://www.cgal.org/"
|
||||||
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\CGAL-3.8" \
|
||||||
|
"DisplayedVersion" "3.8.0"
|
||||||
|
|
||||||
|
;Create uninstaller
|
||||||
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
||||||
SectionEnd
|
SectionEnd
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
|
|
@ -261,25 +269,9 @@ Section "Uninstall"
|
||||||
Delete "$INSTDIR\Uninstall.exe"
|
Delete "$INSTDIR\Uninstall.exe"
|
||||||
|
|
||||||
RMDir /r "$INSTDIR"
|
RMDir /r "$INSTDIR"
|
||||||
|
|
||||||
!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
|
|
||||||
|
|
||||||
Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
|
|
||||||
|
|
||||||
;Delete empty start menu parent diretories
|
|
||||||
StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
|
|
||||||
|
|
||||||
startMenuDeleteLoop:
|
|
||||||
ClearErrors
|
|
||||||
RMDir $MUI_TEMP
|
|
||||||
GetFullPathName $MUI_TEMP "$MUI_TEMP\.."
|
|
||||||
|
|
||||||
IfErrors startMenuDeleteLoopDone
|
|
||||||
|
|
||||||
StrCmp $MUI_TEMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop
|
|
||||||
startMenuDeleteLoopDone:
|
|
||||||
|
|
||||||
DeleteRegKey /ifempty HKCU "Software\CGAL-3.8"
|
DeleteRegKey /ifempty HKCU "Software\CGAL-3.8"
|
||||||
|
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\CGAL-3.8"
|
||||||
|
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
|
|
@ -334,10 +326,14 @@ FunctionEnd
|
||||||
Function .onInstSuccess
|
Function .onInstSuccess
|
||||||
|
|
||||||
${If} $SetCGAL_DIR != ""
|
${If} $SetCGAL_DIR != ""
|
||||||
|
; RegLoc can be either HKLM (all users) or HKCU (current user).
|
||||||
${WriteEnvStr} "CGAL_DIR" $SetCGAL_DIR $RegLoc
|
${WriteEnvStr} "CGAL_DIR" $SetCGAL_DIR $RegLoc
|
||||||
${EndIf}
|
${EndIf}
|
||||||
|
|
||||||
${If} $Add_GMP_LIB_DIR_to_PATH = 1
|
${If} $Add_GMP_LIB_DIR_to_PATH = 1
|
||||||
|
; Append "$INSTDIR\auxiliary\gmp\lib" to the PATH.
|
||||||
|
; RegLoc can be either HKLM (all users) or HKCU (current user).
|
||||||
|
; The return value goes to $0
|
||||||
${EnvVarUpdate} $0 "PATH" "A" $RegLoc "$INSTDIR\auxiliary\gmp\lib"
|
${EnvVarUpdate} $0 "PATH" "A" $RegLoc "$INSTDIR\auxiliary\gmp\lib"
|
||||||
${EndIf}
|
${EndIf}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue