mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-24 00:47:57 -05:00
Added RecursiveDelete.nsh to assist in above fix Renamed qgis_window_geometry.nsi to qgis_window_geometry.nsh for better file nameing consistency git-svn-id: http://svn.osgeo.org/qgis/trunk@6222 c8812cc2-4d05-0410-92ff-de0c093fc19c
60 lines
1.8 KiB
NSIS
60 lines
1.8 KiB
NSIS
|
|
; ################################################################
|
|
; appends \ to the path if missing
|
|
; example: !insertmacro GetCleanDir "c:\blabla"
|
|
; Pop $0 => "c:\blabla\"
|
|
!macro GetCleanDir INPUTDIR
|
|
; ATTENTION: USE ON YOUR OWN RISK!
|
|
; Please report bugs here: http://stefan.bertels.org/
|
|
!define Index_GetCleanDir 'GetCleanDir_Line${__LINE__}'
|
|
Push $R0
|
|
Push $R1
|
|
StrCpy $R0 "${INPUTDIR}"
|
|
StrCmp $R0 "" ${Index_GetCleanDir}-finish
|
|
StrCpy $R1 "$R0" "" -1
|
|
StrCmp "$R1" "\" ${Index_GetCleanDir}-finish
|
|
StrCpy $R0 "$R0\"
|
|
${Index_GetCleanDir}-finish:
|
|
Pop $R1
|
|
Exch $R0
|
|
!undef Index_GetCleanDir
|
|
!macroend
|
|
|
|
; ################################################################
|
|
; similar to "RMDIR /r DIRECTORY", but does not remove DIRECTORY itself
|
|
; example: !insertmacro RemoveFilesAndSubDirs "$INSTDIR"
|
|
!macro RemoveFilesAndSubDirs DIRECTORY
|
|
; ATTENTION: USE ON YOUR OWN RISK!
|
|
; Please report bugs here: http://stefan.bertels.org/
|
|
!define Index_RemoveFilesAndSubDirs 'RemoveFilesAndSubDirs_${__LINE__}'
|
|
|
|
Push $R0
|
|
Push $R1
|
|
Push $R2
|
|
|
|
!insertmacro GetCleanDir "${DIRECTORY}"
|
|
Pop $R2
|
|
FindFirst $R0 $R1 "$R2*.*"
|
|
${Index_RemoveFilesAndSubDirs}-loop:
|
|
StrCmp $R1 "" ${Index_RemoveFilesAndSubDirs}-done
|
|
StrCmp $R1 "." ${Index_RemoveFilesAndSubDirs}-next
|
|
StrCmp $R1 ".." ${Index_RemoveFilesAndSubDirs}-next
|
|
IfFileExists "$R2$R1\*.*" ${Index_RemoveFilesAndSubDirs}-directory
|
|
; file
|
|
Delete "$R2$R1"
|
|
goto ${Index_RemoveFilesAndSubDirs}-next
|
|
${Index_RemoveFilesAndSubDirs}-directory:
|
|
; directory
|
|
RMDir /r "$R2$R1"
|
|
${Index_RemoveFilesAndSubDirs}-next:
|
|
FindNext $R0 $R1
|
|
Goto ${Index_RemoveFilesAndSubDirs}-loop
|
|
${Index_RemoveFilesAndSubDirs}-done:
|
|
FindClose $R0
|
|
|
|
Pop $R2
|
|
Pop $R1
|
|
Pop $R0
|
|
!undef Index_RemoveFilesAndSubDirs
|
|
!macroend
|