|
From: <xue...@us...> - 2003-08-10 10:41:51
|
Update of /cvsroot/popfile/windows
In directory sc8-pr-cvs1:/tmp/cvs-serv13659
Modified Files:
installer.nsi pfi-library.nsh
Log Message:
A new NSIS feature makes it easy to avoid using tricky-to-maintain relative jumps in macros.
Index: installer.nsi
===================================================================
RCS file: /cvsroot/popfile/windows/installer.nsi,v
retrieving revision 1.103
retrieving revision 1.104
diff -C2 -d -r1.103 -r1.104
*** installer.nsi 9 Aug 2003 17:53:08 -0000 1.103
--- installer.nsi 10 Aug 2003 10:41:47 -0000 1.104
***************
*** 284,288 ****
;-----------------------------------------
! ; The 'hdr-common.bmp' icon is only 90 x 57 pixels, much smaller than the 150 x 57 pixel
; space provided by the default 'modern_headerbmpr.exe' UI, so we use a custom UI which
; leaves more room for the TITLE and SUBTITLE text.
--- 284,288 ----
;-----------------------------------------
! ; The 'hdr-common.bmp' logo is only 90 x 57 pixels, much smaller than the 150 x 57 pixel
; space provided by the default 'modern_headerbmpr.exe' UI, so we use a custom UI which
; leaves more room for the TITLE and SUBTITLE text.
***************
*** 2151,2163 ****
SetDetailsPrint listonly
! !insertmacro SafeRecursiveRMDir "$INSTDIR\auto"
! !insertmacro SafeRecursiveRMDir "$INSTDIR\Carp"
! !insertmacro SafeRecursiveRMDir "$INSTDIR\File"
! !insertmacro SafeRecursiveRMDir "$INSTDIR\IO"
! !insertmacro SafeRecursiveRMDir "$INSTDIR\MIME"
! !insertmacro SafeRecursiveRMDir "$INSTDIR\Sys"
! !insertmacro SafeRecursiveRMDir "$INSTDIR\Text"
! !insertmacro SafeRecursiveRMDir "$INSTDIR\warnings"
! !insertmacro SafeRecursiveRMDir "$INSTDIR\Win32"
StrCmp ${L_UPGRADE} "yes" Removed
--- 2151,2163 ----
SetDetailsPrint listonly
! !insertmacro SafeRecursiveRMDir ${__LINE__} "$INSTDIR\auto"
! !insertmacro SafeRecursiveRMDir ${__LINE__} "$INSTDIR\Carp"
! !insertmacro SafeRecursiveRMDir ${__LINE__} "$INSTDIR\File"
! !insertmacro SafeRecursiveRMDir ${__LINE__} "$INSTDIR\IO"
! !insertmacro SafeRecursiveRMDir ${__LINE__} "$INSTDIR\MIME"
! !insertmacro SafeRecursiveRMDir ${__LINE__} "$INSTDIR\Sys"
! !insertmacro SafeRecursiveRMDir ${__LINE__} "$INSTDIR\Text"
! !insertmacro SafeRecursiveRMDir ${__LINE__} "$INSTDIR\warnings"
! !insertmacro SafeRecursiveRMDir ${__LINE__} "$INSTDIR\Win32"
StrCmp ${L_UPGRADE} "yes" Removed
Index: pfi-library.nsh
===================================================================
RCS file: /cvsroot/popfile/windows/pfi-library.nsh,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** pfi-library.nsh 8 Aug 2003 00:14:31 -0000 1.9
--- pfi-library.nsh 10 Aug 2003 10:41:47 -0000 1.10
***************
*** 100,126 ****
# (guards against unexpectedly removing the corpus or message history)
#
#--------------------------------------------------------------------------
! !macro SafeRecursiveRMDir PATH
! StrCmp ${L_SUBCORPUS} "no" +6 ; if "no" then goto pseudo-label A
Push ${L_CORPUS}
Push "${PATH}"
Call un.StrStr
Pop ${L_TEMP}
! StrCmp ${L_TEMP} "" 0 +8 ; if not "" then goto pseudo-label C
! ; pseudo-label A
! StrCmp ${L_SUBHISTORY} "no" +6 ; if "no" then goto pseudo-label B
Push ${L_HISTORY}
Push "${PATH}"
Call un.StrStr
Pop ${L_TEMP}
! StrCmp ${L_TEMP} "" 0 +2 ; if not "" then goto pseudo-label C
!
! ; pseudo-label B
RMDir /r "${PATH}"
!
! ; pseudo-label C
!macroend
--- 100,130 ----
# (guards against unexpectedly removing the corpus or message history)
#
+ # Usage:
+ # !insertmacro SafeRecursiveRMDir ${__LINE__} $(L_CORPUS}
+ #
+ # ${__LINE__} holds the linenumber of the '!insertmacro' command
#--------------------------------------------------------------------------
! !macro SafeRecursiveRMDir UNIQUE_ID PATH
! StrCmp ${L_SUBCORPUS} "no" Label_A_${UNIQUE_ID}
Push ${L_CORPUS}
Push "${PATH}"
Call un.StrStr
Pop ${L_TEMP}
! StrCmp ${L_TEMP} "" 0 Label_C_${UNIQUE_ID}
! Label_A_${UNIQUE_ID}:
! StrCmp ${L_SUBHISTORY} "no" Label_B_${UNIQUE_ID}
Push ${L_HISTORY}
Push "${PATH}"
Call un.StrStr
Pop ${L_TEMP}
! StrCmp ${L_TEMP} "" 0 Label_C_${UNIQUE_ID}
!
! Label_B_${UNIQUE_ID}:
RMDir /r "${PATH}"
!
! Label_C_${UNIQUE_ID}:
!macroend
***************
*** 297,301 ****
Call un.GetDataPath
Pop ${L_RESULT}
!
got_result:
Pop ${L_TEMP}
--- 301,305 ----
Call un.GetDataPath
Pop ${L_RESULT}
!
got_result:
Pop ${L_TEMP}
***************
*** 398,402 ****
strip_slash:
StrCpy ${L_HISTORY} ${L_HISTORY} -1
!
no_trailing_slash:
Push ${L_SOURCE}
--- 402,406 ----
strip_slash:
StrCpy ${L_HISTORY} ${L_HISTORY} -1
!
no_trailing_slash:
Push ${L_SOURCE}
***************
*** 404,408 ****
Call un.GetDataPath
Pop ${L_RESULT}
!
got_result:
Pop ${L_TEMP}
--- 408,412 ----
Call un.GetDataPath
Pop ${L_RESULT}
!
got_result:
Pop ${L_TEMP}
***************
*** 461,465 ****
Push ${L_RESULT}
Push ${L_TEMP}
!
StrCmp ${L_DATA} "" 0 strip_quotes
StrCpy ${L_DATA} ${L_BASEDIR}
--- 465,469 ----
Push ${L_RESULT}
Push ${L_TEMP}
!
StrCmp ${L_DATA} "" 0 strip_quotes
StrCpy ${L_DATA} ${L_BASEDIR}
***************
*** 906,918 ****
!define L_FILE_HANDLE $R8
!define L_TIMEOUT $R7 ; used to avoid an infinite loop
!
Exch ${L_EXE}
Push ${L_FILE_HANDLE}
Push ${L_TIMEOUT}
!
! IfFileExists "${L_EXE}" 0 exit_now
SetFileAttributes "${L_EXE}" NORMAL
StrCpy ${L_TIMEOUT} ${C_SHUTDOWN_LIMIT}
!
check_if_unlocked:
Sleep ${C_SHUTDOWN_DELAY}
--- 910,922 ----
!define L_FILE_HANDLE $R8
!define L_TIMEOUT $R7 ; used to avoid an infinite loop
!
Exch ${L_EXE}
Push ${L_FILE_HANDLE}
Push ${L_TIMEOUT}
!
! IfFileExists "${L_EXE}" 0 exit_now
SetFileAttributes "${L_EXE}" NORMAL
StrCpy ${L_TIMEOUT} ${C_SHUTDOWN_LIMIT}
!
check_if_unlocked:
Sleep ${C_SHUTDOWN_DELAY}
***************
*** 923,932 ****
IntOp ${L_TIMEOUT} ${L_TIMEOUT} - 1
IntCmp ${L_TIMEOUT} 0 exit_now exit_now check_if_unlocked
!
exit_now:
Pop ${L_TIMEOUT}
Pop ${L_FILE_HANDLE}
Pop ${L_EXE}
!
!undef L_EXE
!undef L_FILE_HANDLE
--- 927,936 ----
IntOp ${L_TIMEOUT} ${L_TIMEOUT} - 1
IntCmp ${L_TIMEOUT} 0 exit_now exit_now check_if_unlocked
!
exit_now:
Pop ${L_TIMEOUT}
Pop ${L_FILE_HANDLE}
Pop ${L_EXE}
!
!undef L_EXE
!undef L_FILE_HANDLE
|