diff --git a/Docs/src/headers.but b/Docs/src/headers.but
index 9f5882c3..9710beb6 100644
--- a/Docs/src/headers.but
+++ b/Docs/src/headers.but
@@ -10,13 +10,6 @@ Include header:
\c !include "FileFunc.nsh"
-
-Include function "GetFileExt" for install and "GetParent" for uninstall:
-
-\c !insertmacro GetFileExt
-\c !insertmacro un.GetParent
-
-
Call functions:
\c Section Install
@@ -25,7 +18,7 @@ Call functions:
\c SectionEnd
\c Section un.Install
-\c ${un.GetParent} "C:\My Downloads\Index.html" $R0
+\c ${GetParent} "C:\My Downloads\Index.html" $R0
\c ; $R0="C:\My Downloads"
\c SectionEnd
@@ -868,7 +861,6 @@ Call functions:
\c !include "WinMessages.nsh"
\c !include "FileFunc.nsh"
-\c !insertmacro Locate
\c
\c Section
\c Banner::show /NOUNLOAD "Starting..."
@@ -896,7 +888,6 @@ Call functions:
\\Example (\W{http://nsis.sourceforge.net/Nxs_plug-in}{NxS plugin}):\\
\c !include "FileFunc.nsh"
-\c !insertmacro Locate
\c
\c Section
\c nxs::Show /NOUNLOAD `$(^Name) Setup`\
@@ -972,13 +963,6 @@ Include header:
\c !include "TextFunc.nsh"
-
-Include function "LineRead" for install and "TrimNewLines" for uninstall:
-
-\c !insertmacro LineRead
-\c !insertmacro un.TrimNewLines
-
-
Call functions:
\c Section Install
@@ -987,7 +971,7 @@ Call functions:
\c SectionEnd
\c Section un.Install
-\c ${un.TrimNewLines} "Last line$\r$\n" $R0
+\c ${TrimNewLines} "Last line$\r$\n" $R0
\c ; $R0="Last line"
\c SectionEnd
@@ -1105,7 +1089,6 @@ Call functions:
\\Example5 (replace in file with count of changes - "WordFunc.nsh" required):\\
\c !include "WordFunc.nsh"
-\c !insertmacro WordReplace
\c
\c Section
\c StrCpy $R0 0
@@ -1648,13 +1631,6 @@ Include header:
\c !include "WordFunc.nsh"
-
-Include function "WordFind" for install and "WordReplace" for uninstall:
-
-\c !insertmacro WordFind
-\c !insertmacro un.WordReplace
-
-
Call functions:
\c Section Install
@@ -1663,7 +1639,7 @@ Call functions:
\c SectionEnd
\c Section un.Install
-\c ${un.WordReplace} "A--H---S" "-" "x" "+3*" $R0
+\c ${WordReplace} "A--H---S" "-" "x" "+3*" $R0
\c ; $R0="A--HxS"
\c SectionEnd
diff --git a/Include/FileFunc.nsh b/Include/FileFunc.nsh
index ff649a7f..0dc5f753 100644
--- a/Include/FileFunc.nsh
+++ b/Include/FileFunc.nsh
@@ -10,8 +10,7 @@ _____________________________________________________________________________
Usage in script:
1. !include "FileFunc.nsh"
- 2. !insertmacro FileFunction
- 3. [Section|Function]
+ 2. [Section|Function]
${FileFunction} "Param1" "Param2" "..." $var
[SectionEnd|FunctionEnd]
@@ -21,12 +20,6 @@ _____________________________________________________________________________
GetOptionsS|GetRoot|GetParent|GetFileName|GetBaseName|GetFileExt|
BannerTrimPath|DirState|RefreshShellIcons]
- un.FileFunction=[un.Locate|un.GetSize|un.DriveSpace|un.GetDrives|un.GetTime|
- un.GetFileAttributes|un.GetFileVersion|un.GetExeName|
- un.GetExePath|un.GetParameters|un.GetOptions|un.GetOptionsS|
- un.GetRoot|un.GetParent|un.GetFileName|un.GetBaseName|
- un.GetFileExt|un.BannerTrimPath|un.DirState|un.RefreshShellIcons]
-
_____________________________________________________________________________
Thanks to:
@@ -76,6 +69,8 @@ RefreshShellIcons
!ifndef FILEFUNC_INCLUDED
!define FILEFUNC_INCLUDED
+!include Util.nsh
+
!verbose push
!verbose 3
!ifndef _FILEFUNC_VERBOSE
@@ -83,8 +78,6 @@ RefreshShellIcons
!endif
!verbose ${_FILEFUNC_VERBOSE}
!define FILEFUNC_VERBOSE `!insertmacro FILEFUNC_VERBOSE`
-!define _FILEFUNC_UN
-!define _FILEFUNC_S
!verbose pop
!macro FILEFUNC_VERBOSE _VERBOSE
@@ -95,9 +88,6 @@ RefreshShellIcons
!verbose pop
!macroend
-
-# Install. Case insensitive. #
-
!macro LocateCall _PATH _OPTIONS _FUNC
!verbose push
!verbose ${_FILEFUNC_VERBOSE}
@@ -106,7 +96,7 @@ RefreshShellIcons
Push `${_OPTIONS}`
GetFunctionAddress $0 `${_FUNC}`
Push `$0`
- Call Locate
+ ${CallArtificialFunction} Locate_
Pop $0
!verbose pop
!macroend
@@ -116,7 +106,7 @@ RefreshShellIcons
!verbose ${_FILEFUNC_VERBOSE}
Push `${_PATH}`
Push `${_OPTIONS}`
- Call GetSize
+ ${CallArtificialFunction} GetSize_
Pop ${_RESULT1}
Pop ${_RESULT2}
Pop ${_RESULT3}
@@ -128,7 +118,7 @@ RefreshShellIcons
!verbose ${_FILEFUNC_VERBOSE}
Push `${_DRIVE}`
Push `${_OPTIONS}`
- Call DriveSpace
+ ${CallArtificialFunction} DriveSpace_
Pop ${_RESULT}
!verbose pop
!macroend
@@ -140,7 +130,7 @@ RefreshShellIcons
Push `${_DRV}`
GetFunctionAddress $0 `${_FUNC}`
Push `$0`
- Call GetDrives
+ ${CallArtificialFunction} GetDrives_
Pop $0
!verbose pop
!macroend
@@ -150,7 +140,7 @@ RefreshShellIcons
!verbose ${_FILEFUNC_VERBOSE}
Push `${_FILE}`
Push `${_OPTION}`
- Call GetTime
+ ${CallArtificialFunction} GetTime_
Pop ${_RESULT1}
Pop ${_RESULT2}
Pop ${_RESULT3}
@@ -166,7 +156,7 @@ RefreshShellIcons
!verbose ${_FILEFUNC_VERBOSE}
Push `${_PATH}`
Push `${_ATTR}`
- Call GetFileAttributes
+ ${CallArtificialFunction} GetFileAttributes_
Pop ${_RESULT}
!verbose pop
!macroend
@@ -175,7 +165,7 @@ RefreshShellIcons
!verbose push
!verbose ${_FILEFUNC_VERBOSE}
Push `${_FILE}`
- Call GetFileVersion
+ ${CallArtificialFunction} GetFileVersion_
Pop ${_RESULT}
!verbose pop
!macroend
@@ -183,7 +173,7 @@ RefreshShellIcons
!macro GetExeNameCall _RESULT
!verbose push
!verbose ${_FILEFUNC_VERBOSE}
- Call GetExeName
+ ${CallArtificialFunction} GetExeName_
Pop ${_RESULT}
!verbose pop
!macroend
@@ -191,7 +181,7 @@ RefreshShellIcons
!macro GetExePathCall _RESULT
!verbose push
!verbose ${_FILEFUNC_VERBOSE}
- Call GetExePath
+ ${CallArtificialFunction} GetExePath_
Pop ${_RESULT}
!verbose pop
!macroend
@@ -199,7 +189,7 @@ RefreshShellIcons
!macro GetParametersCall _RESULT
!verbose push
!verbose ${_FILEFUNC_VERBOSE}
- Call GetParameters
+ ${CallArtificialFunction} GetParameters_
Pop ${_RESULT}
!verbose pop
!macroend
@@ -209,7 +199,17 @@ RefreshShellIcons
!verbose ${_FILEFUNC_VERBOSE}
Push `${_PARAMETERS}`
Push `${_OPTION}`
- Call GetOptions
+ ${CallArtificialFunction} GetOptions_
+ Pop ${_RESULT}
+ !verbose pop
+!macroend
+
+!macro GetOptionsSCall _PARAMETERS _OPTION _RESULT
+ !verbose push
+ !verbose ${_FILEFUNC_VERBOSE}
+ Push `${_PARAMETERS}`
+ Push `${_OPTION}`
+ ${CallArtificialFunction} GetOptionsS_
Pop ${_RESULT}
!verbose pop
!macroend
@@ -218,7 +218,7 @@ RefreshShellIcons
!verbose push
!verbose ${_FILEFUNC_VERBOSE}
Push `${_FULLPATH}`
- Call GetRoot
+ ${CallArtificialFunction} GetRoot_
Pop ${_RESULT}
!verbose pop
!macroend
@@ -227,7 +227,7 @@ RefreshShellIcons
!verbose push
!verbose ${_FILEFUNC_VERBOSE}
Push `${_PATHSTRING}`
- Call GetParent
+ ${CallArtificialFunction} GetParent_
Pop ${_RESULT}
!verbose pop
!macroend
@@ -236,7 +236,7 @@ RefreshShellIcons
!verbose push
!verbose ${_FILEFUNC_VERBOSE}
Push `${_PATHSTRING}`
- Call GetFileName
+ ${CallArtificialFunction} GetFileName_
Pop ${_RESULT}
!verbose pop
!macroend
@@ -245,7 +245,7 @@ RefreshShellIcons
!verbose push
!verbose ${_FILEFUNC_VERBOSE}
Push `${_FILESTRING}`
- Call GetBaseName
+ ${CallArtificialFunction} GetBaseName_
Pop ${_RESULT}
!verbose pop
!macroend
@@ -254,7 +254,7 @@ RefreshShellIcons
!verbose push
!verbose ${_FILEFUNC_VERBOSE}
Push `${_FILESTRING}`
- Call GetFileExt
+ ${CallArtificialFunction} GetFileExt_
Pop ${_RESULT}
!verbose pop
!macroend
@@ -264,7 +264,7 @@ RefreshShellIcons
!verbose ${_FILEFUNC_VERBOSE}
Push `${_PATH}`
Push `${_LENGHT}`
- Call BannerTrimPath
+ ${CallArtificialFunction} BannerTrimPath_
Pop ${_RESULT}
!verbose pop
!macroend
@@ -273,7 +273,7 @@ RefreshShellIcons
!verbose push
!verbose ${_FILEFUNC_VERBOSE}
Push `${_PATH}`
- Call DirState
+ ${CallArtificialFunction} DirState_
Pop ${_RESULT}
!verbose pop
!macroend
@@ -281,2173 +281,1737 @@ RefreshShellIcons
!macro RefreshShellIconsCall
!verbose push
!verbose ${_FILEFUNC_VERBOSE}
- Call RefreshShellIcons
+ ${CallArtificialFunction} RefreshShellIcons_
!verbose pop
!macroend
+!define Locate `!insertmacro LocateCall`
+!define un.Locate `!insertmacro LocateCall`
+
!macro Locate
- !ifndef ${_FILEFUNC_UN}Locate
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !define ${_FILEFUNC_UN}Locate `!insertmacro ${_FILEFUNC_UN}LocateCall`
-
- Function ${_FILEFUNC_UN}Locate
- Exch $2
- Exch
- Exch $1
- Exch
- Exch 2
- Exch $0
- Exch 2
- Push $3
- Push $4
- Push $5
- Push $6
- Push $7
- Push $8
- Push $9
- Push $R6
- Push $R7
- Push $R8
- Push $R9
- ClearErrors
-
- StrCpy $3 ''
- StrCpy $4 ''
- StrCpy $5 ''
- StrCpy $6 ''
- StrCpy $7 ''
- StrCpy $8 0
- StrCpy $R7 ''
-
- StrCpy $R9 $0 1 -1
- StrCmp $R9 '\' 0 +3
- StrCpy $0 $0 -1
- goto -3
- IfFileExists '$0\*.*' 0 error
-
- option:
- StrCpy $R9 $1 1
- StrCpy $1 $1 '' 1
- StrCmp $R9 ' ' -2
- StrCmp $R9 '' sizeset
- StrCmp $R9 '/' 0 -4
- StrCpy $9 -1
- IntOp $9 $9 + 1
- StrCpy $R9 $1 1 $9
- StrCmp $R9 '' +2
- StrCmp $R9 '/' 0 -3
- StrCpy $R8 $1 $9
- StrCpy $R8 $R8 '' 2
- StrCpy $R9 $R8 '' -1
- StrCmp $R9 ' ' 0 +3
- StrCpy $R8 $R8 -1
- goto -3
- StrCpy $R9 $1 2
- StrCpy $1 $1 '' $9
-
- StrCmp $R9 'L=' 0 mask
- StrCpy $3 $R8
- StrCmp $3 '' +6
- StrCmp $3 'FD' +5
- StrCmp $3 'F' +4
- StrCmp $3 'D' +3
- StrCmp $3 'DE' +2
- StrCmp $3 'FDE' 0 error
- goto option
-
- mask:
- StrCmp $R9 'M=' 0 size
- StrCpy $4 $R8
- goto option
-
- size:
- StrCmp $R9 'S=' 0 gotosubdir
- StrCpy $6 $R8
- goto option
-
- gotosubdir:
- StrCmp $R9 'G=' 0 banner
- StrCpy $7 $R8
- StrCmp $7 '' +3
- StrCmp $7 '1' +2
- StrCmp $7 '0' 0 error
- goto option
-
- banner:
- StrCmp $R9 'B=' 0 error
- StrCpy $R7 $R8
- StrCmp $R7 '' +3
- StrCmp $R7 '1' +2
- StrCmp $R7 '0' 0 error
- goto option
-
- sizeset:
- StrCmp $6 '' default
- StrCpy $9 0
- StrCpy $R9 $6 1 $9
- StrCmp $R9 '' +4
- StrCmp $R9 ':' +3
- IntOp $9 $9 + 1
- goto -4
- StrCpy $5 $6 $9
- IntOp $9 $9 + 1
- StrCpy $1 $6 1 -1
- StrCpy $6 $6 -1 $9
- StrCmp $5 '' +2
- IntOp $5 $5 + 0
- StrCmp $6 '' +2
- IntOp $6 $6 + 0
-
- StrCmp $1 'B' 0 +3
- StrCpy $1 1
- goto default
- StrCmp $1 'K' 0 +3
- StrCpy $1 1024
- goto default
- StrCmp $1 'M' 0 +3
- StrCpy $1 1048576
- goto default
- StrCmp $1 'G' 0 error
- StrCpy $1 1073741824
-
- default:
- StrCmp $3 '' 0 +2
- StrCpy $3 'FD'
- StrCmp $4 '' 0 +2
- StrCpy $4 '*.*'
- StrCmp $7 '' 0 +2
- StrCpy $7 '1'
- StrCmp $R7 '' 0 +2
- StrCpy $R7 '0'
- StrCpy $7 'G$7B$R7'
-
- StrCpy $8 1
- Push $0
- SetDetailsPrint textonly
-
- nextdir:
- IntOp $8 $8 - 1
- Pop $R8
-
- StrCpy $9 $7 2 2
- StrCmp $9 'B0' +3
- GetLabelAddress $9 findfirst
- goto call
- DetailPrint 'Search in: $R8'
-
- findfirst:
- FindFirst $0 $R7 '$R8\$4'
- IfErrors subdir
- StrCmp $R7 '.' 0 dir
- FindNext $0 $R7
- StrCmp $R7 '..' 0 dir
- FindNext $0 $R7
- IfErrors 0 dir
- FindClose $0
- goto subdir
-
- dir:
- IfFileExists '$R8\$R7\*.*' 0 file
- StrCpy $R6 ''
- StrCmp $3 'DE' +4
- StrCmp $3 'FDE' +3
- StrCmp $3 'FD' precall
- StrCmp $3 'F' findnext precall
- FindFirst $9 $R9 '$R8\$R7\*.*'
- StrCmp $R9 '.' 0 +4
- FindNext $9 $R9
- StrCmp $R9 '..' 0 +2
- FindNext $9 $R9
- FindClose $9
- IfErrors precall findnext
-
- file:
- StrCmp $3 'FDE' +3
- StrCmp $3 'FD' +2
- StrCmp $3 'F' 0 findnext
- StrCpy $R6 0
- StrCmp $5$6 '' precall
- FileOpen $9 '$R8\$R7' r
- IfErrors +3
- FileSeek $9 0 END $R6
- FileClose $9
- System::Int64Op $R6 / $1
- Pop $R6
- StrCmp $5 '' +2
- IntCmp $R6 $5 0 findnext
- StrCmp $6 '' +2
- IntCmp $R6 $6 0 0 findnext
-
- precall:
- StrCpy $9 0
- StrCpy $R9 '$R8\$R7'
-
- call:
- Push $0
- Push $1
- Push $2
- Push $3
- Push $4
- Push $5
- Push $6
- Push $7
- Push $8
- Push $9
- Push $R7
- Push $R8
- StrCmp $9 0 +4
- StrCpy $R6 ''
- StrCpy $R7 ''
- StrCpy $R9 ''
- Call $2
- Pop $R9
- Pop $R8
- Pop $R7
- Pop $9
- Pop $8
- Pop $7
- Pop $6
- Pop $5
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Pop $0
-
- IfErrors 0 +3
- FindClose $0
- goto error
- StrCmp $R9 'StopLocate' 0 +3
- FindClose $0
- goto clearstack
- goto $9
-
- findnext:
- FindNext $0 $R7
- IfErrors 0 dir
- FindClose $0
-
- subdir:
- StrCpy $9 $7 2
- StrCmp $9 'G0' end
- FindFirst $0 $R7 '$R8\*.*'
- StrCmp $R7 '.' 0 pushdir
- FindNext $0 $R7
- StrCmp $R7 '..' 0 pushdir
- FindNext $0 $R7
- IfErrors 0 pushdir
- FindClose $0
- StrCmp $8 0 end nextdir
-
- pushdir:
- IfFileExists '$R8\$R7\*.*' 0 +3
- Push '$R8\$R7'
- IntOp $8 $8 + 1
- FindNext $0 $R7
- IfErrors 0 pushdir
- FindClose $0
- StrCmp $8 0 end nextdir
-
- error:
- SetErrors
-
- clearstack:
- StrCmp $8 0 end
- IntOp $8 $8 - 1
- Pop $R8
- goto clearstack
-
- end:
- SetDetailsPrint both
- Pop $R9
- Pop $R8
- Pop $R7
- Pop $R6
- Pop $9
- Pop $8
- Pop $7
- Pop $6
- Pop $5
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Pop $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro GetSize
- !ifndef ${_FILEFUNC_UN}GetSize
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !define ${_FILEFUNC_UN}GetSize `!insertmacro ${_FILEFUNC_UN}GetSizeCall`
-
- Function ${_FILEFUNC_UN}GetSize
- Exch $1
- Exch
- Exch $0
- Exch
- Push $2
- Push $3
- Push $4
- Push $5
- Push $6
- Push $7
- Push $8
- Push $9
- Push $R3
- Push $R4
- Push $R5
- Push $R6
- Push $R7
- Push $R8
- Push $R9
- ClearErrors
-
- StrCpy $R9 $0 1 -1
- StrCmp $R9 '\' 0 +3
- StrCpy $0 $0 -1
- goto -3
- IfFileExists '$0\*.*' 0 error
-
- StrCpy $3 ''
- StrCpy $4 ''
- StrCpy $5 ''
- StrCpy $6 ''
- StrCpy $8 0
- StrCpy $R3 ''
- StrCpy $R4 ''
- StrCpy $R5 ''
-
- option:
- StrCpy $R9 $1 1
- StrCpy $1 $1 '' 1
- StrCmp $R9 ' ' -2
- StrCmp $R9 '' sizeset
- StrCmp $R9 '/' 0 -4
-
- StrCpy $9 -1
- IntOp $9 $9 + 1
- StrCpy $R9 $1 1 $9
- StrCmp $R9 '' +2
- StrCmp $R9 '/' 0 -3
- StrCpy $8 $1 $9
- StrCpy $8 $8 '' 2
- StrCpy $R9 $8 '' -1
- StrCmp $R9 ' ' 0 +3
- StrCpy $8 $8 -1
- goto -3
- StrCpy $R9 $1 2
- StrCpy $1 $1 '' $9
-
- StrCmp $R9 'M=' 0 size
- StrCpy $4 $8
- goto option
-
- size:
- StrCmp $R9 'S=' 0 gotosubdir
- StrCpy $6 $8
- goto option
-
- gotosubdir:
- StrCmp $R9 'G=' 0 error
- StrCpy $7 $8
- StrCmp $7 '' +3
- StrCmp $7 '1' +2
- StrCmp $7 '0' 0 error
- goto option
-
- sizeset:
- StrCmp $6 '' default
- StrCpy $9 0
- StrCpy $R9 $6 1 $9
- StrCmp $R9 '' +4
- StrCmp $R9 ':' +3
- IntOp $9 $9 + 1
- goto -4
- StrCpy $5 $6 $9
- IntOp $9 $9 + 1
- StrCpy $1 $6 1 -1
- StrCpy $6 $6 -1 $9
- StrCmp $5 '' +2
- IntOp $5 $5 + 0
- StrCmp $6 '' +2
- IntOp $6 $6 + 0
-
- StrCmp $1 'B' 0 +4
- StrCpy $1 1
- StrCpy $2 bytes
- goto default
- StrCmp $1 'K' 0 +4
- StrCpy $1 1024
- StrCpy $2 Kb
- goto default
- StrCmp $1 'M' 0 +4
- StrCpy $1 1048576
- StrCpy $2 Mb
- goto default
- StrCmp $1 'G' 0 error
- StrCpy $1 1073741824
- StrCpy $2 Gb
-
- default:
- StrCmp $4 '' 0 +2
- StrCpy $4 '*.*'
- StrCmp $7 '' 0 +2
- StrCpy $7 '1'
-
- StrCpy $8 1
- Push $0
- SetDetailsPrint textonly
-
- nextdir:
- IntOp $8 $8 - 1
- Pop $R8
- FindFirst $0 $R7 '$R8\$4'
- IfErrors show
- StrCmp $R7 '.' 0 dir
- FindNext $0 $R7
- StrCmp $R7 '..' 0 dir
- FindNext $0 $R7
- IfErrors 0 dir
- FindClose $0
- goto show
-
- dir:
- IfFileExists '$R8\$R7\*.*' 0 file
- IntOp $R5 $R5 + 1
- goto findnext
-
- file:
- StrCpy $R6 0
- StrCmp $5$6 '' 0 +3
- IntOp $R4 $R4 + 1
- goto findnext
- FileOpen $9 '$R8\$R7' r
- IfErrors +3
- FileSeek $9 0 END $R6
- FileClose $9
- StrCmp $5 '' +2
- IntCmp $R6 $5 0 findnext
- StrCmp $6 '' +2
- IntCmp $R6 $6 0 0 findnext
- IntOp $R4 $R4 + 1
- System::Int64Op /NOUNLOAD $R3 + $R6
- Pop $R3
-
- findnext:
- FindNext $0 $R7
- IfErrors 0 dir
- FindClose $0
-
- show:
- StrCmp $5$6 '' nosize
- System::Int64Op /NOUNLOAD $R3 / $1
- Pop $9
- DetailPrint 'Size:$9 $2 Files:$R4 Folders:$R5'
- goto subdir
- nosize:
- DetailPrint 'Files:$R4 Folders:$R5'
-
- subdir:
- StrCmp $7 0 preend
- FindFirst $0 $R7 '$R8\*.*'
- StrCmp $R7 '.' 0 pushdir
- FindNext $0 $R7
- StrCmp $R7 '..' 0 pushdir
- FindNext $0 $R7
- IfErrors 0 pushdir
- FindClose $0
- StrCmp $8 0 preend nextdir
-
- pushdir:
- IfFileExists '$R8\$R7\*.*' 0 +3
- Push '$R8\$R7'
- IntOp $8 $8 + 1
- FindNext $0 $R7
- IfErrors 0 pushdir
- FindClose $0
- StrCmp $8 0 preend nextdir
-
- preend:
- StrCmp $R3 '' nosizeend
- System::Int64Op $R3 / $1
- Pop $R3
- nosizeend:
- StrCpy $2 $R4
- StrCpy $1 $R5
- StrCpy $0 $R3
- goto end
-
- error:
- SetErrors
- StrCpy $0 ''
- StrCpy $1 ''
- StrCpy $2 ''
-
- end:
- SetDetailsPrint both
- Pop $R9
- Pop $R8
- Pop $R7
- Pop $R6
- Pop $R5
- Pop $R4
- Pop $R3
- Pop $9
- Pop $8
- Pop $7
- Pop $6
- Pop $5
- Pop $4
- Pop $3
- Exch $2
- Exch
- Exch $1
- Exch 2
- Exch $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro DriveSpace
- !ifndef ${_FILEFUNC_UN}DriveSpace
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !define ${_FILEFUNC_UN}DriveSpace `!insertmacro ${_FILEFUNC_UN}DriveSpaceCall`
-
- Function ${_FILEFUNC_UN}DriveSpace
- Exch $1
- Exch
- Exch $0
- Exch
- Push $2
- Push $3
- Push $4
- Push $5
- Push $6
- ClearErrors
-
- StrCpy $2 $0 1 -1
- StrCmp $2 '\' 0 +3
- StrCpy $0 $0 -1
- goto -3
- IfFileExists '$0\NUL' 0 error
-
- StrCpy $5 ''
- StrCpy $6 ''
-
- option:
- StrCpy $2 $1 1
- StrCpy $1 $1 '' 1
- StrCmp $2 ' ' -2
- StrCmp $2 '' default
- StrCmp $2 '/' 0 -4
- StrCpy $3 -1
- IntOp $3 $3 + 1
- StrCpy $2 $1 1 $3
- StrCmp $2 '' +2
- StrCmp $2 '/' 0 -3
- StrCpy $4 $1 $3
- StrCpy $4 $4 '' 2
- StrCpy $2 $4 1 -1
- StrCmp $2 ' ' 0 +3
- StrCpy $4 $4 -1
- goto -3
- StrCpy $2 $1 2
- StrCpy $1 $1 '' $3
-
- StrCmp $2 'D=' 0 unit
- StrCpy $5 $4
- StrCmp $5 '' +4
- StrCmp $5 'T' +3
- StrCmp $5 'O' +2
- StrCmp $5 'F' 0 error
- goto option
-
- unit:
- StrCmp $2 'S=' 0 error
- StrCpy $6 $4
- goto option
-
- default:
- StrCmp $5 '' 0 +2
- StrCpy $5 'T'
- StrCmp $6 '' 0 +3
- StrCpy $6 '1'
- goto getspace
-
- StrCmp $6 'B' 0 +3
- StrCpy $6 1
- goto getspace
- StrCmp $6 'K' 0 +3
- StrCpy $6 1024
- goto getspace
- StrCmp $6 'M' 0 +3
- StrCpy $6 1048576
- goto getspace
- StrCmp $6 'G' 0 error
- StrCpy $6 1073741824
-
- getspace:
- System::Call /NOUNLOAD 'kernel32::GetDiskFreeSpaceExA(t, *l, *l, *l)i(r0,.r2,.r3,.)'
-
- StrCmp $5 T 0 +3
- StrCpy $0 $3
- goto getsize
- StrCmp $5 O 0 +4
- System::Int64Op /NOUNLOAD $3 - $2
- Pop $0
- goto getsize
- StrCmp $5 F 0 +2
- StrCpy $0 $2
-
- getsize:
- System::Int64Op $0 / $6
- Pop $0
- goto end
-
- error:
- SetErrors
- StrCpy $0 ''
-
- end:
- Pop $6
- Pop $5
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Exch $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro GetDrives
- !ifndef ${_FILEFUNC_UN}GetDrives
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !define ${_FILEFUNC_UN}GetDrives `!insertmacro ${_FILEFUNC_UN}GetDrivesCall`
-
- Function ${_FILEFUNC_UN}GetDrives
- Exch $1
- Exch
- Exch $0
- Exch
- Push $2
- Push $3
- Push $4
- Push $5
- Push $6
- Push $8
- Push $9
-
- System::Alloc /NOUNLOAD 1024
- Pop $2
- System::Call /NOUNLOAD 'kernel32::GetLogicalDriveStringsA(i,i) i(1024, r2)'
-
- StrCmp $0 ALL drivestring
- StrCmp $0 '' 0 typeset
- StrCpy $0 ALL
- goto drivestring
-
- typeset:
- StrCpy $6 -1
- IntOp $6 $6 + 1
- StrCpy $8 $0 1 $6
- StrCmp $8$0 '' enumex
- StrCmp $8 '' +2
- StrCmp $8 '+' 0 -4
- StrCpy $8 $0 $6
- IntOp $6 $6 + 1
- StrCpy $0 $0 '' $6
-
- StrCmp $8 'FDD' 0 +3
- StrCpy $6 2
- goto drivestring
- StrCmp $8 'HDD' 0 +3
- StrCpy $6 3
- goto drivestring
- StrCmp $8 'NET' 0 +3
- StrCpy $6 4
- goto drivestring
- StrCmp $8 'CDROM' 0 +3
- StrCpy $6 5
- goto drivestring
- StrCmp $8 'RAM' 0 typeset
- StrCpy $6 6
-
- drivestring:
- StrCpy $3 $2
-
- enumok:
- System::Call /NOUNLOAD 'kernel32::lstrlenA(t) i(i r3) .r4'
- StrCmp $4$0 '0ALL' enumex
- StrCmp $4 0 typeset
- System::Call /NOUNLOAD 'kernel32::GetDriveTypeA(t) i(i r3) .r5'
-
- StrCmp $0 ALL +2
- StrCmp $5 $6 letter enumnext
- StrCmp $5 2 0 +3
- StrCpy $8 FDD
- goto letter
- StrCmp $5 3 0 +3
- StrCpy $8 HDD
- goto letter
- StrCmp $5 4 0 +3
- StrCpy $8 NET
- goto letter
- StrCmp $5 5 0 +3
- StrCpy $8 CDROM
- goto letter
- StrCmp $5 6 0 enumex
- StrCpy $8 RAM
-
- letter:
- System::Call /NOUNLOAD '*$3(&t1024 .r9)'
-
- Push $0
- Push $1
- Push $2
- Push $3
- Push $4
- Push $5
- Push $6
- Push $8
- Call $1
- Pop $9
- Pop $8
- Pop $6
- Pop $5
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Pop $0
- StrCmp $9 'StopGetDrives' enumex
-
- enumnext:
- IntOp $3 $3 + $4
- IntOp $3 $3 + 1
- goto enumok
-
- enumex:
- System::Free $2
-
- Pop $9
- Pop $8
- Pop $6
- Pop $5
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Pop $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro GetTime
- !ifndef ${_FILEFUNC_UN}GetTime
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !define ${_FILEFUNC_UN}GetTime `!insertmacro ${_FILEFUNC_UN}GetTimeCall`
-
- Function ${_FILEFUNC_UN}GetTime
- Exch $1
- Exch
- Exch $0
- Exch
- Push $2
- Push $3
- Push $4
- Push $5
- Push $6
- Push $7
- ClearErrors
-
- StrCmp $1 'L' gettime
- StrCmp $1 'A' getfile
- StrCmp $1 'C' getfile
- StrCmp $1 'M' getfile
- StrCmp $1 'LS' gettime
- StrCmp $1 'AS' getfile
- StrCmp $1 'CS' getfile
- StrCmp $1 'MS' getfile
- goto error
-
- getfile:
- IfFileExists $0 0 error
- System::Call /NOUNLOAD '*(i,l,l,l,i,i,i,i,&t260,&t14) i .r6'
- System::Call /NOUNLOAD 'kernel32::FindFirstFileA(t,i)i(r0,r6) .r2'
- System::Call /NOUNLOAD 'kernel32::FindClose(i)i(r2)'
-
- gettime:
- System::Call /NOUNLOAD '*(&i2,&i2,&i2,&i2,&i2,&i2,&i2,&i2) i .r7'
- StrCmp $1 'L' 0 systemtime
- System::Call /NOUNLOAD 'kernel32::GetLocalTime(i)i(r7)'
- goto convert
- systemtime:
- StrCmp $1 'LS' 0 filetime
- System::Call /NOUNLOAD 'kernel32::GetSystemTime(i)i(r7)'
- goto convert
-
- filetime:
- System::Call /NOUNLOAD '*$6(i,l,l,l,i,i,i,i,&t260,&t14)i(,.r4,.r3,.r2)'
- System::Free /NOUNLOAD $6
- StrCmp $1 'A' 0 +3
- StrCpy $2 $3
- goto tolocal
- StrCmp $1 'C' 0 +3
- StrCpy $2 $4
- goto tolocal
- StrCmp $1 'M' tolocal
-
- StrCmp $1 'AS' tosystem
- StrCmp $1 'CS' 0 +3
- StrCpy $3 $4
- goto tosystem
- StrCmp $1 'MS' 0 +3
- StrCpy $3 $2
- goto tosystem
-
- tolocal:
- System::Call /NOUNLOAD 'kernel32::FileTimeToLocalFileTime(*l,*l)i(r2,.r3)'
- tosystem:
- System::Call /NOUNLOAD 'kernel32::FileTimeToSystemTime(*l,i)i(r3,r7)'
-
- convert:
- System::Call /NOUNLOAD '*$7(&i2,&i2,&i2,&i2,&i2,&i2,&i2,&i2)i(.r5,.r6,.r4,.r0,.r3,.r2,.r1,)'
- System::Free $7
-
- IntCmp $0 9 0 0 +2
- StrCpy $0 '0$0'
- IntCmp $1 9 0 0 +2
- StrCpy $1 '0$1'
- IntCmp $2 9 0 0 +2
- StrCpy $2 '0$2'
- IntCmp $6 9 0 0 +2
- StrCpy $6 '0$6'
-
- StrCmp $4 0 0 +3
- StrCpy $4 Sunday
- goto end
- StrCmp $4 1 0 +3
- StrCpy $4 Monday
- goto end
- StrCmp $4 2 0 +3
- StrCpy $4 Tuesday
- goto end
- StrCmp $4 3 0 +3
- StrCpy $4 Wednesday
- goto end
- StrCmp $4 4 0 +3
- StrCpy $4 Thursday
- goto end
- StrCmp $4 5 0 +3
- StrCpy $4 Friday
- goto end
- StrCmp $4 6 0 error
- StrCpy $4 Saturday
- goto end
-
- error:
- SetErrors
- StrCpy $0 ''
- StrCpy $1 ''
- StrCpy $2 ''
- StrCpy $3 ''
- StrCpy $4 ''
- StrCpy $5 ''
- StrCpy $6 ''
-
- end:
- Pop $7
- Exch $6
- Exch
- Exch $5
- Exch 2
- Exch $4
- Exch 3
- Exch $3
- Exch 4
- Exch $2
- Exch 5
- Exch $1
- Exch 6
- Exch $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro GetFileAttributes
- !ifndef ${_FILEFUNC_UN}GetFileAttributes
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !define ${_FILEFUNC_UN}GetFileAttributes `!insertmacro ${_FILEFUNC_UN}GetFileAttributesCall`
-
- Function ${_FILEFUNC_UN}GetFileAttributes
- Exch $1
- Exch
- Exch $0
- Exch
- Push $2
- Push $3
- Push $4
- Push $5
-
- System::Call 'kernel32::GetFileAttributes(t r0)i .r2'
- StrCmp $2 -1 error
- StrCpy $3 ''
-
- IntOp $0 $2 & 0x4000
- IntCmp $0 0 +2
- StrCpy $3 'ENCRYPTED|'
-
- IntOp $0 $2 & 0x2000
- IntCmp $0 0 +2
- StrCpy $3 'NOT_CONTENT_INDEXED|$3'
-
- IntOp $0 $2 & 0x1000
- IntCmp $0 0 +2
- StrCpy $3 'OFFLINE|$3'
-
- IntOp $0 $2 & 0x0800
- IntCmp $0 0 +2
- StrCpy $3 'COMPRESSED|$3'
-
- IntOp $0 $2 & 0x0400
- IntCmp $0 0 +2
- StrCpy $3 'REPARSE_POINT|$3'
-
- IntOp $0 $2 & 0x0200
- IntCmp $0 0 +2
- StrCpy $3 'SPARSE_FILE|$3'
-
- IntOp $0 $2 & 0x0100
- IntCmp $0 0 +2
- StrCpy $3 'TEMPORARY|$3'
-
- IntOp $0 $2 & 0x0080
- IntCmp $0 0 +2
- StrCpy $3 'NORMAL|$3'
-
- IntOp $0 $2 & 0x0040
- IntCmp $0 0 +2
- StrCpy $3 'DEVICE|$3'
-
- IntOp $0 $2 & 0x0020
- IntCmp $0 0 +2
- StrCpy $3 'ARCHIVE|$3'
-
- IntOp $0 $2 & 0x0010
- IntCmp $0 0 +2
- StrCpy $3 'DIRECTORY|$3'
-
- IntOp $0 $2 & 0x0004
- IntCmp $0 0 +2
- StrCpy $3 'SYSTEM|$3'
-
- IntOp $0 $2 & 0x0002
- IntCmp $0 0 +2
- StrCpy $3 'HIDDEN|$3'
-
- IntOp $0 $2 & 0x0001
- IntCmp $0 0 +2
- StrCpy $3 'READONLY|$3'
-
- StrCpy $0 $3 -1
- StrCmp $1 '' end
- StrCmp $1 'ALL' end
-
- attrcmp:
- StrCpy $5 0
- IntOp $5 $5 + 1
- StrCpy $4 $1 1 $5
- StrCmp $4 '' +2
- StrCmp $4 '|' 0 -3
- StrCpy $2 $1 $5
- IntOp $5 $5 + 1
- StrCpy $1 $1 '' $5
- StrLen $3 $2
- StrCpy $5 -1
- IntOp $5 $5 + 1
- StrCpy $4 $0 $3 $5
- StrCmp $4 '' notfound
- StrCmp $4 $2 0 -3
- StrCmp $1 '' 0 attrcmp
- StrCpy $0 1
- goto end
-
- notfound:
- StrCpy $0 0
- goto end
-
- error:
- SetErrors
- StrCpy $0 ''
-
- end:
- Pop $5
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Exch $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro GetFileVersion
- !ifndef ${_FILEFUNC_UN}GetFileVersion
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !define ${_FILEFUNC_UN}GetFileVersion `!insertmacro ${_FILEFUNC_UN}GetFileVersionCall`
-
- Function ${_FILEFUNC_UN}GetFileVersion
- Exch $0
- Push $1
- Push $2
- Push $3
- Push $4
- Push $5
- Push $6
- ClearErrors
-
- GetDllVersion '$0' $1 $2
- IfErrors error
- IntOp $3 $1 >> 16
- IntOp $3 $3 & 0x0000FFFF
- IntOp $4 $1 & 0x0000FFFF
- IntOp $5 $2 >> 16
- IntOp $5 $5 & 0x0000FFFF
- IntOp $6 $2 & 0x0000FFFF
- StrCpy $0 '$3.$4.$5.$6'
- goto end
-
- error:
- SetErrors
- StrCpy $0 ''
-
- end:
- Pop $6
- Pop $5
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Exch $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro GetExeName
- !ifndef ${_FILEFUNC_UN}GetExeName
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !define ${_FILEFUNC_UN}GetExeName `!insertmacro ${_FILEFUNC_UN}GetExeNameCall`
-
- Function ${_FILEFUNC_UN}GetExeName
- Push $0
- Push $1
- Push $2
- System::Call /NOUNLOAD 'kernel32::GetModuleFileNameA(i 0, t .r0, i 1024)'
- System::Call 'kernel32::GetLongPathNameA(t r0, t .r1, i 1024)i .r2'
- StrCmp $2 error +2
- StrCpy $0 $1
- Pop $2
- Pop $1
- Exch $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro GetExePath
- !ifndef ${_FILEFUNC_UN}GetExePath
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !define ${_FILEFUNC_UN}GetExePath `!insertmacro ${_FILEFUNC_UN}GetExePathCall`
-
- Function ${_FILEFUNC_UN}GetExePath
- Push $0
- Push $1
- Push $2
- StrCpy $0 $EXEDIR
- System::Call 'kernel32::GetLongPathNameA(t r0, t .r1, i 1024)i .r2'
- StrCmp $2 error +2
- StrCpy $0 $1
- Pop $2
- Pop $1
- Exch $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro GetParameters
- !ifndef ${_FILEFUNC_UN}GetParameters
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !define ${_FILEFUNC_UN}GetParameters `!insertmacro ${_FILEFUNC_UN}GetParametersCall`
-
- Function ${_FILEFUNC_UN}GetParameters
- ;cmdline-check
- StrCmp $CMDLINE "" 0 +3
- Push ""
- Return
-
- ;vars
- Push $0 ;tmp
- Push $1 ;length
- Push $2 ;parameter offset
- Push $3 ;separator
-
- ;length/offset
- StrLen $1 $CMDLINE
- StrCpy $2 2 ;start with third character
-
- ;separator
- StrCpy $3 $CMDLINE 1 ;first character
- StrCmp $3 '"' +2
- StrCpy $3 ' '
-
- token: ;finding second separator
- IntCmp $2 $1 strip 0 strip
- StrCpy $0 $CMDLINE 1 $2
- IntOp $2 $2 + 1
- StrCmp $3 $0 0 token
-
- strip: ;strip white space
- IntCmp $2 $1 copy 0 copy
- StrCpy $0 $CMDLINE 1 $2
- StrCmp $0 ' ' 0 copy
- IntOp $2 $2 + 1
- Goto strip
-
- copy:
- StrCpy $0 $CMDLINE "" $2
-
- ;strip white spaces from end
- rstrip:
- StrCpy $1 $0 1 -1
- StrCmp $1 ' ' 0 done
- StrCpy $0 $0 -1
- Goto rstrip
-
- done:
- Pop $3
- Pop $2
- Pop $1
- Exch $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro GetOptions
- !ifndef ${_FILEFUNC_UN}GetOptions${_FILEFUNC_S}
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !define ${_FILEFUNC_UN}GetOptions${_FILEFUNC_S} `!insertmacro ${_FILEFUNC_UN}GetOptions${_FILEFUNC_S}Call`
-
- Function ${_FILEFUNC_UN}GetOptions${_FILEFUNC_S}
- Exch $1
- Exch
- Exch $0
- Exch
- Push $2
- Push $3
- Push $4
- Push $5
- Push $6
- Push $7
- ClearErrors
-
- StrCpy $2 $1 '' 1
- StrCpy $1 $1 1
- StrLen $3 $2
- StrCpy $7 0
-
- begin:
- StrCpy $4 -1
- StrCpy $6 ''
-
- quote:
- IntOp $4 $4 + 1
- StrCpy $5 $0 1 $4
- StrCmp${_FILEFUNC_S} $5$7 '0' notfound
- StrCmp${_FILEFUNC_S} $5 '' trimright
- StrCmp${_FILEFUNC_S} $5 '"' 0 +7
- StrCmp${_FILEFUNC_S} $6 '' 0 +3
- StrCpy $6 '"'
- goto quote
- StrCmp${_FILEFUNC_S} $6 '"' 0 +3
- StrCpy $6 ''
- goto quote
- StrCmp${_FILEFUNC_S} $5 `'` 0 +7
- StrCmp${_FILEFUNC_S} $6 `` 0 +3
- StrCpy $6 `'`
- goto quote
- StrCmp${_FILEFUNC_S} $6 `'` 0 +3
- StrCpy $6 ``
- goto quote
- StrCmp${_FILEFUNC_S} $5 '`' 0 +7
- StrCmp${_FILEFUNC_S} $6 '' 0 +3
- StrCpy $6 '`'
- goto quote
- StrCmp${_FILEFUNC_S} $6 '`' 0 +3
- StrCpy $6 ''
- goto quote
- StrCmp${_FILEFUNC_S} $6 '"' quote
- StrCmp${_FILEFUNC_S} $6 `'` quote
- StrCmp${_FILEFUNC_S} $6 '`' quote
- StrCmp${_FILEFUNC_S} $5 $1 0 quote
- StrCmp${_FILEFUNC_S} $7 0 trimleft trimright
-
- trimleft:
- IntOp $4 $4 + 1
- StrCpy $5 $0 $3 $4
- StrCmp${_FILEFUNC_S} $5 '' notfound
- StrCmp${_FILEFUNC_S} $5 $2 0 quote
- IntOp $4 $4 + $3
- StrCpy $0 $0 '' $4
- StrCpy $4 $0 1
- StrCmp${_FILEFUNC_S} $4 ' ' 0 +3
- StrCpy $0 $0 '' 1
- goto -3
- StrCpy $7 1
- goto begin
-
- trimright:
- StrCpy $0 $0 $4
- StrCpy $4 $0 1 -1
- StrCmp${_FILEFUNC_S} $4 ' ' 0 +3
- StrCpy $0 $0 -1
- goto -3
- StrCpy $3 $0 1
- StrCpy $4 $0 1 -1
- StrCmp${_FILEFUNC_S} $3 $4 0 end
- StrCmp${_FILEFUNC_S} $3 '"' +3
- StrCmp${_FILEFUNC_S} $3 `'` +2
- StrCmp${_FILEFUNC_S} $3 '`' 0 end
- StrCpy $0 $0 -1 1
- goto end
-
- notfound:
- SetErrors
- StrCpy $0 ''
-
- end:
- Pop $7
- Pop $6
- Pop $5
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Exch $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-
-!macro GetRoot
- !ifndef ${_FILEFUNC_UN}GetRoot
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !define ${_FILEFUNC_UN}GetRoot `!insertmacro ${_FILEFUNC_UN}GetRootCall`
-
- Function ${_FILEFUNC_UN}GetRoot
- Exch $0
- Push $1
- Push $2
- Push $3
-
- StrCpy $1 $0 2
- StrCmp $1 '\\' UNC
- StrCpy $2 $1 1 1
- StrCmp $2 ':' 0 empty
- StrCpy $0 $1
- goto end
-
- UNC:
- StrCpy $2 1
- StrCpy $3 ''
-
- loop:
- IntOp $2 $2 + 1
- StrCpy $1 $0 1 $2
- StrCmp $1$3 '' empty
- StrCmp $1 '' +5
- StrCmp $1 '\' 0 loop
- StrCmp $3 '1' +3
- StrCpy $3 '1'
- goto loop
- StrCpy $0 $0 $2
- StrCpy $2 $0 1 -1
- StrCmp $2 '\' 0 end
-
- empty:
- StrCpy $0 ''
-
- end:
- Pop $3
- Pop $2
- Pop $1
- Exch $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro GetParent
- !ifndef ${_FILEFUNC_UN}GetParent
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !define ${_FILEFUNC_UN}GetParent `!insertmacro ${_FILEFUNC_UN}GetParentCall`
-
- Function ${_FILEFUNC_UN}GetParent
- Exch $0
- Push $1
- Push $2
-
- StrCpy $2 $0 1 -1
- StrCmp $2 '\' 0 +3
- StrCpy $0 $0 -1
- goto -3
-
- StrCpy $1 0
- IntOp $1 $1 - 1
- StrCpy $2 $0 1 $1
- StrCmp $2 '\' +2
- StrCmp $2 '' 0 -3
- StrCpy $0 $0 $1
-
- Pop $2
- Pop $1
- Exch $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro GetFileName
- !ifndef ${_FILEFUNC_UN}GetFileName
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !define ${_FILEFUNC_UN}GetFileName `!insertmacro ${_FILEFUNC_UN}GetFileNameCall`
-
- Function ${_FILEFUNC_UN}GetFileName
- Exch $0
- Push $1
- Push $2
-
- StrCpy $2 $0 1 -1
- StrCmp $2 '\' 0 +3
- StrCpy $0 $0 -1
- goto -3
-
- StrCpy $1 0
- IntOp $1 $1 - 1
- StrCpy $2 $0 1 $1
- StrCmp $2 '' end
- StrCmp $2 '\' 0 -3
- IntOp $1 $1 + 1
- StrCpy $0 $0 '' $1
-
- end:
- Pop $2
- Pop $1
- Exch $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro GetBaseName
- !ifndef ${_FILEFUNC_UN}GetBaseName
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !define ${_FILEFUNC_UN}GetBaseName `!insertmacro ${_FILEFUNC_UN}GetBaseNameCall`
-
- Function ${_FILEFUNC_UN}GetBaseName
- Exch $0
- Push $1
- Push $2
- Push $3
-
- StrCpy $1 0
- StrCpy $3 ''
-
- loop:
- IntOp $1 $1 - 1
- StrCpy $2 $0 1 $1
- StrCmp $2 '' trimpath
- StrCmp $2 '\' trimpath
- StrCmp $3 'noext' loop
- StrCmp $2 '.' 0 loop
- StrCpy $0 $0 $1
- StrCpy $3 'noext'
- StrCpy $1 0
- goto loop
-
- trimpath:
- StrCmp $1 -1 empty
- IntOp $1 $1 + 1
- StrCpy $0 $0 '' $1
- goto end
-
- empty:
- StrCpy $0 ''
-
- end:
- Pop $3
- Pop $2
- Pop $1
- Exch $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro GetFileExt
- !ifndef ${_FILEFUNC_UN}GetFileExt
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !define ${_FILEFUNC_UN}GetFileExt `!insertmacro ${_FILEFUNC_UN}GetFileExtCall`
-
- Function ${_FILEFUNC_UN}GetFileExt
- Exch $0
- Push $1
- Push $2
-
- StrCpy $1 0
-
- loop:
- IntOp $1 $1 - 1
- StrCpy $2 $0 1 $1
- StrCmp $2 '' empty
- StrCmp $2 '\' empty
- StrCmp $2 '.' 0 loop
-
- StrCmp $1 -1 empty
- IntOp $1 $1 + 1
- StrCpy $0 $0 '' $1
- goto end
-
- empty:
- StrCpy $0 ''
-
- end:
- Pop $2
- Pop $1
- Exch $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro BannerTrimPath
- !ifndef ${_FILEFUNC_UN}BannerTrimPath
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !define ${_FILEFUNC_UN}BannerTrimPath `!insertmacro ${_FILEFUNC_UN}BannerTrimPathCall`
-
- Function ${_FILEFUNC_UN}BannerTrimPath
- Exch $1
- Exch
- Exch $0
- Exch
- Push $2
- Push $3
- Push $4
-
- StrCpy $3 $1 1 -1
- IntOp $1 $1 + 0
- StrLen $2 $0
- IntCmp $2 $1 end end
- IntOp $1 $1 - 3
- IntCmp $1 0 empty empty
- StrCmp $3 'A' A-trim
- StrCmp $3 'B' B-trim
- StrCmp $3 'C' C-trim
- StrCmp $3 'D' D-trim
-
- A-trim:
- StrCpy $3 $0 1 1
- StrCpy $2 0
- StrCmp $3 ':' 0 +2
- IntOp $2 $2 + 2
-
- loopleft:
- IntOp $2 $2 + 1
- StrCpy $3 $0 1 $2
- StrCmp $2 $1 C-trim
- StrCmp $3 '\' 0 loopleft
- StrCpy $3 $0 $2
- IntOp $2 $2 - $1
- IntCmp $2 0 B-trim 0 B-trim
-
- loopright:
- IntOp $2 $2 + 1
- StrCpy $4 $0 1 $2
- StrCmp $2 0 B-trim
- StrCmp $4 '\' 0 loopright
- StrCpy $4 $0 '' $2
- StrCpy $0 '$3\...$4'
- goto end
-
- B-trim:
- StrCpy $2 $1
- IntOp $2 $2 - 1
- StrCmp $2 -1 C-trim
- StrCpy $3 $0 1 $2
- StrCmp $3 '\' 0 -3
- StrCpy $0 $0 $2
- StrCpy $0 '$0\...'
- goto end
-
- C-trim:
- StrCpy $0 $0 $1
- StrCpy $0 '$0...'
- goto end
-
- D-trim:
- StrCpy $3 -1
- IntOp $3 $3 - 1
- StrCmp $3 -$2 C-trim
- StrCpy $4 $0 1 $3
- StrCmp $4 '\' 0 -3
- StrCpy $4 $0 '' $3
- IntOp $3 $1 + $3
- IntCmp $3 2 C-trim C-trim
- StrCpy $0 $0 $3
- StrCpy $0 '$0...$4'
- goto end
-
- empty:
- StrCpy $0 ''
-
- end:
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Exch $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro DirState
- !ifndef ${_FILEFUNC_UN}DirState
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !define ${_FILEFUNC_UN}DirState `!insertmacro ${_FILEFUNC_UN}DirStateCall`
-
- Function ${_FILEFUNC_UN}DirState
- Exch $0
- Push $1
- ClearErrors
-
- FindFirst $1 $0 '$0\*.*'
- IfErrors 0 +3
- StrCpy $0 -1
- goto end
- StrCmp $0 '.' 0 +4
- FindNext $1 $0
- StrCmp $0 '..' 0 +2
- FindNext $1 $0
- FindClose $1
- IfErrors 0 +3
- StrCpy $0 0
- goto end
- StrCpy $0 1
-
- end:
- Pop $1
- Exch $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro RefreshShellIcons
- !ifndef ${_FILEFUNC_UN}RefreshShellIcons
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !define ${_FILEFUNC_UN}RefreshShellIcons `!insertmacro ${_FILEFUNC_UN}RefreshShellIconsCall`
-
- Function ${_FILEFUNC_UN}RefreshShellIcons
- System::Call 'shell32::SHChangeNotify(i 0x08000000, i 0, i 0, i 0)'
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-
-# Uninstall. Case insensitive. #
-
-!macro un.LocateCall _PATH _OPTIONS _FUNC
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- Push $0
- Push `${_PATH}`
- Push `${_OPTIONS}`
- GetFunctionAddress $0 `${_FUNC}`
- Push `$0`
- Call un.Locate
- Pop $0
- !verbose pop
-!macroend
-
-!macro un.GetSizeCall _PATH _OPTIONS _RESULT1 _RESULT2 _RESULT3
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- Push `${_PATH}`
- Push `${_OPTIONS}`
- Call un.GetSize
- Pop ${_RESULT1}
- Pop ${_RESULT2}
- Pop ${_RESULT3}
- !verbose pop
-!macroend
-
-!macro un.DriveSpaceCall _DRIVE _OPTIONS _RESULT
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- Push `${_DRIVE}`
- Push `${_OPTIONS}`
- Call un.DriveSpace
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.GetDrivesCall _DRV _FUNC
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- Push $0
- Push `${_DRV}`
- GetFunctionAddress $0 `${_FUNC}`
- Push `$0`
- Call un.GetDrives
- Pop $0
- !verbose pop
-!macroend
-
-!macro un.GetTimeCall _FILE _OPTION _RESULT1 _RESULT2 _RESULT3 _RESULT4 _RESULT5 _RESULT6 _RESULT7
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- Push `${_FILE}`
- Push `${_OPTION}`
- Call un.GetTime
- Pop ${_RESULT1}
- Pop ${_RESULT2}
- Pop ${_RESULT3}
- Pop ${_RESULT4}
- Pop ${_RESULT5}
- Pop ${_RESULT6}
- Pop ${_RESULT7}
- !verbose pop
-!macroend
-
-!macro un.GetFileAttributesCall _PATH _ATTR _RESULT
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- Push `${_PATH}`
- Push `${_ATTR}`
- Call un.GetFileAttributes
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.GetFileVersionCall _FILE _RESULT
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- Push `${_FILE}`
- Call un.GetFileVersion
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.GetExeNameCall _RESULT
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- Call un.GetExeName
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.GetExePathCall _RESULT
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- Call un.GetExePath
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.GetParametersCall _RESULT
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- Call un.GetParameters
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.GetOptionsCall _PARAMETERS _OPTION _RESULT
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- Push `${_PARAMETERS}`
- Push `${_OPTION}`
- Call un.GetOptions
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.GetRootCall _FULLPATH _RESULT
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- Push `${_FULLPATH}`
- Call un.GetRoot
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.GetParentCall _PATHSTRING _RESULT
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- Push `${_PATHSTRING}`
- Call un.GetParent
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.GetFileNameCall _PATHSTRING _RESULT
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- Push `${_PATHSTRING}`
- Call un.GetFileName
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.GetBaseNameCall _FILESTRING _RESULT
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- Push `${_FILESTRING}`
- Call un.GetBaseName
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.GetFileExtCall _FILESTRING _RESULT
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- Push `${_FILESTRING}`
- Call un.GetFileExt
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.BannerTrimPathCall _PATH _LENGHT _RESULT
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- Push `${_PATH}`
- Push `${_LENGHT}`
- Call un.BannerTrimPath
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.DirStateCall _PATH _RESULT
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- Push `${_PATH}`
- Call un.DirState
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.RefreshShellIconsCall
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- Call un.RefreshShellIcons
- !verbose pop
!macroend
!macro un.Locate
- !ifndef un.Locate
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN `un.`
+!macroend
- !insertmacro Locate
+!macro Locate_
+ !verbose push
+ !verbose ${_FILEFUNC_VERBOSE}
+
+ Exch $2
+ Exch
+ Exch $1
+ Exch
+ Exch 2
+ Exch $0
+ Exch 2
+ Push $3
+ Push $4
+ Push $5
+ Push $6
+ Push $7
+ Push $8
+ Push $9
+ Push $R6
+ Push $R7
+ Push $R8
+ Push $R9
+ ClearErrors
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN
- !verbose pop
- !endif
+ StrCpy $3 ''
+ StrCpy $4 ''
+ StrCpy $5 ''
+ StrCpy $6 ''
+ StrCpy $7 ''
+ StrCpy $8 0
+ StrCpy $R7 ''
+
+ StrCpy $R9 $0 1 -1
+ StrCmp $R9 '\' 0 +3
+ StrCpy $0 $0 -1
+ goto -3
+ IfFileExists '$0\*.*' 0 FileFunc_Locate_error
+
+ FileFunc_Locate_option:
+ StrCpy $R9 $1 1
+ StrCpy $1 $1 '' 1
+ StrCmp $R9 ' ' -2
+ StrCmp $R9 '' FileFunc_Locate_sizeset
+ StrCmp $R9 '/' 0 -4
+ StrCpy $9 -1
+ IntOp $9 $9 + 1
+ StrCpy $R9 $1 1 $9
+ StrCmp $R9 '' +2
+ StrCmp $R9 '/' 0 -3
+ StrCpy $R8 $1 $9
+ StrCpy $R8 $R8 '' 2
+ StrCpy $R9 $R8 '' -1
+ StrCmp $R9 ' ' 0 +3
+ StrCpy $R8 $R8 -1
+ goto -3
+ StrCpy $R9 $1 2
+ StrCpy $1 $1 '' $9
+
+ StrCmp $R9 'L=' 0 FileFunc_Locate_mask
+ StrCpy $3 $R8
+ StrCmp $3 '' +6
+ StrCmp $3 'FD' +5
+ StrCmp $3 'F' +4
+ StrCmp $3 'D' +3
+ StrCmp $3 'DE' +2
+ StrCmp $3 'FDE' 0 FileFunc_Locate_error
+ goto FileFunc_Locate_option
+
+ FileFunc_Locate_mask:
+ StrCmp $R9 'M=' 0 FileFunc_Locate_size
+ StrCpy $4 $R8
+ goto FileFunc_Locate_option
+
+ FileFunc_Locate_size:
+ StrCmp $R9 'S=' 0 FileFunc_Locate_gotosubdir
+ StrCpy $6 $R8
+ goto FileFunc_Locate_option
+
+ FileFunc_Locate_gotosubdir:
+ StrCmp $R9 'G=' 0 FileFunc_Locate_banner
+ StrCpy $7 $R8
+ StrCmp $7 '' +3
+ StrCmp $7 '1' +2
+ StrCmp $7 '0' 0 FileFunc_Locate_error
+ goto FileFunc_Locate_option
+
+ FileFunc_Locate_banner:
+ StrCmp $R9 'B=' 0 FileFunc_Locate_error
+ StrCpy $R7 $R8
+ StrCmp $R7 '' +3
+ StrCmp $R7 '1' +2
+ StrCmp $R7 '0' 0 FileFunc_Locate_error
+ goto FileFunc_Locate_option
+
+ FileFunc_Locate_sizeset:
+ StrCmp $6 '' FileFunc_Locate_default
+ StrCpy $9 0
+ StrCpy $R9 $6 1 $9
+ StrCmp $R9 '' +4
+ StrCmp $R9 ':' +3
+ IntOp $9 $9 + 1
+ goto -4
+ StrCpy $5 $6 $9
+ IntOp $9 $9 + 1
+ StrCpy $1 $6 1 -1
+ StrCpy $6 $6 -1 $9
+ StrCmp $5 '' +2
+ IntOp $5 $5 + 0
+ StrCmp $6 '' +2
+ IntOp $6 $6 + 0
+
+ StrCmp $1 'B' 0 +3
+ StrCpy $1 1
+ goto FileFunc_Locate_default
+ StrCmp $1 'K' 0 +3
+ StrCpy $1 1024
+ goto FileFunc_Locate_default
+ StrCmp $1 'M' 0 +3
+ StrCpy $1 1048576
+ goto FileFunc_Locate_default
+ StrCmp $1 'G' 0 FileFunc_Locate_error
+ StrCpy $1 1073741824
+
+ FileFunc_Locate_default:
+ StrCmp $3 '' 0 +2
+ StrCpy $3 'FD'
+ StrCmp $4 '' 0 +2
+ StrCpy $4 '*.*'
+ StrCmp $7 '' 0 +2
+ StrCpy $7 '1'
+ StrCmp $R7 '' 0 +2
+ StrCpy $R7 '0'
+ StrCpy $7 'G$7B$R7'
+
+ StrCpy $8 1
+ Push $0
+ SetDetailsPrint textonly
+
+ FileFunc_Locate_nextdir:
+ IntOp $8 $8 - 1
+ Pop $R8
+
+ StrCpy $9 $7 2 2
+ StrCmp $9 'B0' +3
+ GetLabelAddress $9 FileFunc_Locate_findfirst
+ goto call
+ DetailPrint 'Search in: $R8'
+
+ FileFunc_Locate_findfirst:
+ FindFirst $0 $R7 '$R8\$4'
+ IfErrors FileFunc_Locate_subdir
+ StrCmp $R7 '.' 0 FileFunc_Locate_dir
+ FindNext $0 $R7
+ StrCmp $R7 '..' 0 FileFunc_Locate_dir
+ FindNext $0 $R7
+ IfErrors 0 FileFunc_Locate_dir
+ FindClose $0
+ goto FileFunc_Locate_subdir
+
+ FileFunc_Locate_dir:
+ IfFileExists '$R8\$R7\*.*' 0 FileFunc_Locate_file
+ StrCpy $R6 ''
+ StrCmp $3 'DE' +4
+ StrCmp $3 'FDE' +3
+ StrCmp $3 'FD' FileFunc_Locate_precall
+ StrCmp $3 'F' FileFunc_Locate_findnext FileFunc_Locate_precall
+ FindFirst $9 $R9 '$R8\$R7\*.*'
+ StrCmp $R9 '.' 0 +4
+ FindNext $9 $R9
+ StrCmp $R9 '..' 0 +2
+ FindNext $9 $R9
+ FindClose $9
+ IfErrors FileFunc_Locate_precall FileFunc_Locate_findnext
+
+ FileFunc_Locate_file:
+ StrCmp $3 'FDE' +3
+ StrCmp $3 'FD' +2
+ StrCmp $3 'F' 0 FileFunc_Locate_findnext
+ StrCpy $R6 0
+ StrCmp $5$6 '' FileFunc_Locate_precall
+ FileOpen $9 '$R8\$R7' r
+ IfErrors +3
+ FileSeek $9 0 END $R6
+ FileClose $9
+ System::Int64Op $R6 / $1
+ Pop $R6
+ StrCmp $5 '' +2
+ IntCmp $R6 $5 0 FileFunc_Locate_findnext
+ StrCmp $6 '' +2
+ IntCmp $R6 $6 0 0 FileFunc_Locate_findnext
+
+ FileFunc_Locate_precall:
+ StrCpy $9 0
+ StrCpy $R9 '$R8\$R7'
+
+ call:
+ Push $0
+ Push $1
+ Push $2
+ Push $3
+ Push $4
+ Push $5
+ Push $6
+ Push $7
+ Push $8
+ Push $9
+ Push $R7
+ Push $R8
+ StrCmp $9 0 +4
+ StrCpy $R6 ''
+ StrCpy $R7 ''
+ StrCpy $R9 ''
+ Call $2
+ Pop $R9
+ Pop $R8
+ Pop $R7
+ Pop $9
+ Pop $8
+ Pop $7
+ Pop $6
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Pop $0
+
+ IfErrors 0 +3
+ FindClose $0
+ goto FileFunc_Locate_error
+ StrCmp $R9 'StopLocate' 0 +3
+ FindClose $0
+ goto FileFunc_Locate_clearstack
+ goto $9
+
+ FileFunc_Locate_findnext:
+ FindNext $0 $R7
+ IfErrors 0 FileFunc_Locate_dir
+ FindClose $0
+
+ FileFunc_Locate_subdir:
+ StrCpy $9 $7 2
+ StrCmp $9 'G0' FileFunc_Locate_end
+ FindFirst $0 $R7 '$R8\*.*'
+ StrCmp $R7 '.' 0 FileFunc_Locate_pushdir
+ FindNext $0 $R7
+ StrCmp $R7 '..' 0 FileFunc_Locate_pushdir
+ FindNext $0 $R7
+ IfErrors 0 FileFunc_Locate_pushdir
+ FindClose $0
+ StrCmp $8 0 FileFunc_Locate_end FileFunc_Locate_nextdir
+
+ FileFunc_Locate_pushdir:
+ IfFileExists '$R8\$R7\*.*' 0 +3
+ Push '$R8\$R7'
+ IntOp $8 $8 + 1
+ FindNext $0 $R7
+ IfErrors 0 FileFunc_Locate_pushdir
+ FindClose $0
+ StrCmp $8 0 FileFunc_Locate_end FileFunc_Locate_nextdir
+
+ FileFunc_Locate_error:
+ SetErrors
+
+ FileFunc_Locate_clearstack:
+ StrCmp $8 0 FileFunc_Locate_end
+ IntOp $8 $8 - 1
+ Pop $R8
+ goto FileFunc_Locate_clearstack
+
+ FileFunc_Locate_end:
+ SetDetailsPrint both
+ Pop $R9
+ Pop $R8
+ Pop $R7
+ Pop $R6
+ Pop $9
+ Pop $8
+ Pop $7
+ Pop $6
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Pop $0
+
+ !verbose pop
+!macroend
+
+!define GetSize `!insertmacro GetSizeCall`
+!define un.GetSize `!insertmacro GetSizeCall`
+
+!macro GetSize
!macroend
!macro un.GetSize
- !ifndef un.GetSize
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN `un.`
+!macroend
- !insertmacro GetSize
+!macro GetSize_
+ !verbose push
+ !verbose ${_FILEFUNC_VERBOSE}
+
+ Exch $1
+ Exch
+ Exch $0
+ Exch
+ Push $2
+ Push $3
+ Push $4
+ Push $5
+ Push $6
+ Push $7
+ Push $8
+ Push $9
+ Push $R3
+ Push $R4
+ Push $R5
+ Push $R6
+ Push $R7
+ Push $R8
+ Push $R9
+ ClearErrors
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN
- !verbose pop
- !endif
+ StrCpy $R9 $0 1 -1
+ StrCmp $R9 '\' 0 +3
+ StrCpy $0 $0 -1
+ goto -3
+ IfFileExists '$0\*.*' 0 FileFunc_GetSize_error
+
+ StrCpy $3 ''
+ StrCpy $4 ''
+ StrCpy $5 ''
+ StrCpy $6 ''
+ StrCpy $8 0
+ StrCpy $R3 ''
+ StrCpy $R4 ''
+ StrCpy $R5 ''
+
+ FileFunc_GetSize_option:
+ StrCpy $R9 $1 1
+ StrCpy $1 $1 '' 1
+ StrCmp $R9 ' ' -2
+ StrCmp $R9 '' FileFunc_GetSize_sizeset
+ StrCmp $R9 '/' 0 -4
+
+ StrCpy $9 -1
+ IntOp $9 $9 + 1
+ StrCpy $R9 $1 1 $9
+ StrCmp $R9 '' +2
+ StrCmp $R9 '/' 0 -3
+ StrCpy $8 $1 $9
+ StrCpy $8 $8 '' 2
+ StrCpy $R9 $8 '' -1
+ StrCmp $R9 ' ' 0 +3
+ StrCpy $8 $8 -1
+ goto -3
+ StrCpy $R9 $1 2
+ StrCpy $1 $1 '' $9
+
+ StrCmp $R9 'M=' 0 FileFunc_GetSize_size
+ StrCpy $4 $8
+ goto FileFunc_GetSize_option
+
+ FileFunc_GetSize_size:
+ StrCmp $R9 'S=' 0 FileFunc_GetSize_gotosubdir
+ StrCpy $6 $8
+ goto FileFunc_GetSize_option
+
+ FileFunc_GetSize_gotosubdir:
+ StrCmp $R9 'G=' 0 FileFunc_GetSize_error
+ StrCpy $7 $8
+ StrCmp $7 '' +3
+ StrCmp $7 '1' +2
+ StrCmp $7 '0' 0 FileFunc_GetSize_error
+ goto FileFunc_GetSize_option
+
+ FileFunc_GetSize_sizeset:
+ StrCmp $6 '' FileFunc_GetSize_default
+ StrCpy $9 0
+ StrCpy $R9 $6 1 $9
+ StrCmp $R9 '' +4
+ StrCmp $R9 ':' +3
+ IntOp $9 $9 + 1
+ goto -4
+ StrCpy $5 $6 $9
+ IntOp $9 $9 + 1
+ StrCpy $1 $6 1 -1
+ StrCpy $6 $6 -1 $9
+ StrCmp $5 '' +2
+ IntOp $5 $5 + 0
+ StrCmp $6 '' +2
+ IntOp $6 $6 + 0
+
+ StrCmp $1 'B' 0 +4
+ StrCpy $1 1
+ StrCpy $2 bytes
+ goto FileFunc_GetSize_default
+ StrCmp $1 'K' 0 +4
+ StrCpy $1 1024
+ StrCpy $2 Kb
+ goto FileFunc_GetSize_default
+ StrCmp $1 'M' 0 +4
+ StrCpy $1 1048576
+ StrCpy $2 Mb
+ goto FileFunc_GetSize_default
+ StrCmp $1 'G' 0 FileFunc_GetSize_error
+ StrCpy $1 1073741824
+ StrCpy $2 Gb
+
+ FileFunc_GetSize_default:
+ StrCmp $4 '' 0 +2
+ StrCpy $4 '*.*'
+ StrCmp $7 '' 0 +2
+ StrCpy $7 '1'
+
+ StrCpy $8 1
+ Push $0
+ SetDetailsPrint textonly
+
+ FileFunc_GetSize_nextdir:
+ IntOp $8 $8 - 1
+ Pop $R8
+ FindFirst $0 $R7 '$R8\$4'
+ IfErrors FileFunc_GetSize_show
+ StrCmp $R7 '.' 0 FileFunc_GetSize_dir
+ FindNext $0 $R7
+ StrCmp $R7 '..' 0 FileFunc_GetSize_dir
+ FindNext $0 $R7
+ IfErrors 0 FileFunc_GetSize_dir
+ FindClose $0
+ goto FileFunc_GetSize_show
+
+ FileFunc_GetSize_dir:
+ IfFileExists '$R8\$R7\*.*' 0 FileFunc_GetSize_file
+ IntOp $R5 $R5 + 1
+ goto FileFunc_GetSize_findnext
+
+ FileFunc_GetSize_file:
+ StrCpy $R6 0
+ StrCmp $5$6 '' 0 +3
+ IntOp $R4 $R4 + 1
+ goto FileFunc_GetSize_findnext
+ FileOpen $9 '$R8\$R7' r
+ IfErrors +3
+ FileSeek $9 0 END $R6
+ FileClose $9
+ StrCmp $5 '' +2
+ IntCmp $R6 $5 0 FileFunc_GetSize_findnext
+ StrCmp $6 '' +2
+ IntCmp $R6 $6 0 0 FileFunc_GetSize_findnext
+ IntOp $R4 $R4 + 1
+ System::Int64Op /NOUNLOAD $R3 + $R6
+ Pop $R3
+
+ FileFunc_GetSize_findnext:
+ FindNext $0 $R7
+ IfErrors 0 FileFunc_GetSize_dir
+ FindClose $0
+
+ FileFunc_GetSize_show:
+ StrCmp $5$6 '' FileFunc_GetSize_nosize
+ System::Int64Op /NOUNLOAD $R3 / $1
+ Pop $9
+ DetailPrint 'Size:$9 $2 Files:$R4 Folders:$R5'
+ goto FileFunc_GetSize_subdir
+ FileFunc_GetSize_nosize:
+ DetailPrint 'Files:$R4 Folders:$R5'
+
+ FileFunc_GetSize_subdir:
+ StrCmp $7 0 FileFunc_GetSize_preend
+ FindFirst $0 $R7 '$R8\*.*'
+ StrCmp $R7 '.' 0 FileFunc_GetSize_pushdir
+ FindNext $0 $R7
+ StrCmp $R7 '..' 0 FileFunc_GetSize_pushdir
+ FindNext $0 $R7
+ IfErrors 0 FileFunc_GetSize_pushdir
+ FindClose $0
+ StrCmp $8 0 FileFunc_GetSize_preend FileFunc_GetSize_nextdir
+
+ FileFunc_GetSize_pushdir:
+ IfFileExists '$R8\$R7\*.*' 0 +3
+ Push '$R8\$R7'
+ IntOp $8 $8 + 1
+ FindNext $0 $R7
+ IfErrors 0 FileFunc_GetSize_pushdir
+ FindClose $0
+ StrCmp $8 0 FileFunc_GetSize_preend FileFunc_GetSize_nextdir
+
+ FileFunc_GetSize_preend:
+ StrCmp $R3 '' FileFunc_GetSize_nosizeend
+ System::Int64Op $R3 / $1
+ Pop $R3
+ FileFunc_GetSize_nosizeend:
+ StrCpy $2 $R4
+ StrCpy $1 $R5
+ StrCpy $0 $R3
+ goto FileFunc_GetSize_end
+
+ FileFunc_GetSize_error:
+ SetErrors
+ StrCpy $0 ''
+ StrCpy $1 ''
+ StrCpy $2 ''
+
+ FileFunc_GetSize_end:
+ SetDetailsPrint both
+ Pop $R9
+ Pop $R8
+ Pop $R7
+ Pop $R6
+ Pop $R5
+ Pop $R4
+ Pop $R3
+ Pop $9
+ Pop $8
+ Pop $7
+ Pop $6
+ Pop $5
+ Pop $4
+ Pop $3
+ Exch $2
+ Exch
+ Exch $1
+ Exch 2
+ Exch $0
+
+ !verbose pop
+!macroend
+
+!define DriveSpace `!insertmacro DriveSpaceCall`
+!define un.DriveSpace `!insertmacro DriveSpaceCall`
+
+!macro DriveSpace
!macroend
!macro un.DriveSpace
- !ifndef un.DriveSpace
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN `un.`
+!macroend
- !insertmacro DriveSpace
+!macro DriveSpace_
+ !verbose push
+ !verbose ${_FILEFUNC_VERBOSE}
+
+ Exch $1
+ Exch
+ Exch $0
+ Exch
+ Push $2
+ Push $3
+ Push $4
+ Push $5
+ Push $6
+ ClearErrors
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN
- !verbose pop
- !endif
+ StrCpy $2 $0 1 -1
+ StrCmp $2 '\' 0 +3
+ StrCpy $0 $0 -1
+ goto -3
+ IfFileExists '$0\NUL' 0 FileFunc_DriveSpace_error
+
+ StrCpy $5 ''
+ StrCpy $6 ''
+
+ FileFunc_DriveSpace_option:
+ StrCpy $2 $1 1
+ StrCpy $1 $1 '' 1
+ StrCmp $2 ' ' -2
+ StrCmp $2 '' FileFunc_DriveSpace_default
+ StrCmp $2 '/' 0 -4
+ StrCpy $3 -1
+ IntOp $3 $3 + 1
+ StrCpy $2 $1 1 $3
+ StrCmp $2 '' +2
+ StrCmp $2 '/' 0 -3
+ StrCpy $4 $1 $3
+ StrCpy $4 $4 '' 2
+ StrCpy $2 $4 1 -1
+ StrCmp $2 ' ' 0 +3
+ StrCpy $4 $4 -1
+ goto -3
+ StrCpy $2 $1 2
+ StrCpy $1 $1 '' $3
+
+ StrCmp $2 'D=' 0 FileFunc_DriveSpace_unit
+ StrCpy $5 $4
+ StrCmp $5 '' +4
+ StrCmp $5 'T' +3
+ StrCmp $5 'O' +2
+ StrCmp $5 'F' 0 FileFunc_DriveSpace_error
+ goto FileFunc_DriveSpace_option
+
+ FileFunc_DriveSpace_unit:
+ StrCmp $2 'S=' 0 FileFunc_DriveSpace_error
+ StrCpy $6 $4
+ goto FileFunc_DriveSpace_option
+
+ FileFunc_DriveSpace_default:
+ StrCmp $5 '' 0 +2
+ StrCpy $5 'T'
+ StrCmp $6 '' 0 +3
+ StrCpy $6 '1'
+ goto FileFunc_DriveSpace_getspace
+
+ StrCmp $6 'B' 0 +3
+ StrCpy $6 1
+ goto FileFunc_DriveSpace_getspace
+ StrCmp $6 'K' 0 +3
+ StrCpy $6 1024
+ goto FileFunc_DriveSpace_getspace
+ StrCmp $6 'M' 0 +3
+ StrCpy $6 1048576
+ goto FileFunc_DriveSpace_getspace
+ StrCmp $6 'G' 0 FileFunc_DriveSpace_error
+ StrCpy $6 1073741824
+
+ FileFunc_DriveSpace_getspace:
+ System::Call /NOUNLOAD 'kernel32::GetDiskFreeSpaceExA(t, *l, *l, *l)i(r0,.r2,.r3,.)'
+
+ StrCmp $5 T 0 +3
+ StrCpy $0 $3
+ goto FileFunc_DriveSpace_getsize
+ StrCmp $5 O 0 +4
+ System::Int64Op /NOUNLOAD $3 - $2
+ Pop $0
+ goto FileFunc_DriveSpace_getsize
+ StrCmp $5 F 0 +2
+ StrCpy $0 $2
+
+ FileFunc_DriveSpace_getsize:
+ System::Int64Op $0 / $6
+ Pop $0
+ goto FileFunc_DriveSpace_end
+
+ FileFunc_DriveSpace_error:
+ SetErrors
+ StrCpy $0 ''
+
+ FileFunc_DriveSpace_end:
+ Pop $6
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Exch $0
+
+ !verbose pop
+!macroend
+
+!define GetDrives `!insertmacro GetDrivesCall`
+!define un.GetDrives `!insertmacro GetDrivesCall`
+
+!macro GetDrives
!macroend
!macro un.GetDrives
- !ifndef un.GetDrives
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN `un.`
+!macroend
- !insertmacro GetDrives
+!macro GetDrives_
+ !verbose push
+ !verbose ${_FILEFUNC_VERBOSE}
+
+ Exch $1
+ Exch
+ Exch $0
+ Exch
+ Push $2
+ Push $3
+ Push $4
+ Push $5
+ Push $6
+ Push $8
+ Push $9
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN
- !verbose pop
- !endif
+ System::Alloc /NOUNLOAD 1024
+ Pop $2
+ System::Call /NOUNLOAD 'kernel32::GetLogicalDriveStringsA(i,i) i(1024, r2)'
+
+ StrCmp $0 ALL FileFunc_GetDrives_drivestring
+ StrCmp $0 '' 0 FileFunc_GetDrives_typeset
+ StrCpy $0 ALL
+ goto FileFunc_GetDrives_drivestring
+
+ FileFunc_GetDrives_typeset:
+ StrCpy $6 -1
+ IntOp $6 $6 + 1
+ StrCpy $8 $0 1 $6
+ StrCmp $8$0 '' FileFunc_GetDrives_enumex
+ StrCmp $8 '' +2
+ StrCmp $8 '+' 0 -4
+ StrCpy $8 $0 $6
+ IntOp $6 $6 + 1
+ StrCpy $0 $0 '' $6
+
+ StrCmp $8 'FDD' 0 +3
+ StrCpy $6 2
+ goto FileFunc_GetDrives_drivestring
+ StrCmp $8 'HDD' 0 +3
+ StrCpy $6 3
+ goto FileFunc_GetDrives_drivestring
+ StrCmp $8 'NET' 0 +3
+ StrCpy $6 4
+ goto FileFunc_GetDrives_drivestring
+ StrCmp $8 'CDROM' 0 +3
+ StrCpy $6 5
+ goto FileFunc_GetDrives_drivestring
+ StrCmp $8 'RAM' 0 FileFunc_GetDrives_typeset
+ StrCpy $6 6
+
+ FileFunc_GetDrives_drivestring:
+ StrCpy $3 $2
+
+ FileFunc_GetDrives_enumok:
+ System::Call /NOUNLOAD 'kernel32::lstrlenA(t) i(i r3) .r4'
+ StrCmp $4$0 '0ALL' FileFunc_GetDrives_enumex
+ StrCmp $4 0 FileFunc_GetDrives_typeset
+ System::Call /NOUNLOAD 'kernel32::GetDriveTypeA(t) i(i r3) .r5'
+
+ StrCmp $0 ALL +2
+ StrCmp $5 $6 FileFunc_GetDrives_letter FileFunc_GetDrives_enumnext
+ StrCmp $5 2 0 +3
+ StrCpy $8 FDD
+ goto FileFunc_GetDrives_letter
+ StrCmp $5 3 0 +3
+ StrCpy $8 HDD
+ goto FileFunc_GetDrives_letter
+ StrCmp $5 4 0 +3
+ StrCpy $8 NET
+ goto FileFunc_GetDrives_letter
+ StrCmp $5 5 0 +3
+ StrCpy $8 CDROM
+ goto FileFunc_GetDrives_letter
+ StrCmp $5 6 0 FileFunc_GetDrives_enumex
+ StrCpy $8 RAM
+
+ FileFunc_GetDrives_letter:
+ System::Call /NOUNLOAD '*$3(&t1024 .r9)'
+
+ Push $0
+ Push $1
+ Push $2
+ Push $3
+ Push $4
+ Push $5
+ Push $6
+ Push $8
+ Call $1
+ Pop $9
+ Pop $8
+ Pop $6
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Pop $0
+ StrCmp $9 'StopGetDrives' FileFunc_GetDrives_enumex
+
+ FileFunc_GetDrives_enumnext:
+ IntOp $3 $3 + $4
+ IntOp $3 $3 + 1
+ goto FileFunc_GetDrives_enumok
+
+ FileFunc_GetDrives_enumex:
+ System::Free $2
+
+ Pop $9
+ Pop $8
+ Pop $6
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Pop $0
+
+ !verbose pop
+!macroend
+
+!define GetTime `!insertmacro GetTimeCall`
+!define un.GetTime `!insertmacro GetTimeCall`
+
+!macro GetTime
!macroend
!macro un.GetTime
- !ifndef un.GetTime
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN `un.`
+!macroend
- !insertmacro GetTime
+!macro GetTime_
+ !verbose push
+ !verbose ${_FILEFUNC_VERBOSE}
+
+ Exch $1
+ Exch
+ Exch $0
+ Exch
+ Push $2
+ Push $3
+ Push $4
+ Push $5
+ Push $6
+ Push $7
+ ClearErrors
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN
- !verbose pop
- !endif
+ StrCmp $1 'L' FileFunc_GetTime_gettime
+ StrCmp $1 'A' FileFunc_GetTime_getfile
+ StrCmp $1 'C' FileFunc_GetTime_getfile
+ StrCmp $1 'M' FileFunc_GetTime_getfile
+ StrCmp $1 'LS' FileFunc_GetTime_gettime
+ StrCmp $1 'AS' FileFunc_GetTime_getfile
+ StrCmp $1 'CS' FileFunc_GetTime_getfile
+ StrCmp $1 'MS' FileFunc_GetTime_getfile
+ goto FileFunc_GetTime_error
+
+ FileFunc_GetTime_getfile:
+ IfFileExists $0 0 FileFunc_GetTime_error
+ System::Call /NOUNLOAD '*(i,l,l,l,i,i,i,i,&t260,&t14) i .r6'
+ System::Call /NOUNLOAD 'kernel32::FindFirstFileA(t,i)i(r0,r6) .r2'
+ System::Call /NOUNLOAD 'kernel32::FindClose(i)i(r2)'
+
+ FileFunc_GetTime_gettime:
+ System::Call /NOUNLOAD '*(&i2,&i2,&i2,&i2,&i2,&i2,&i2,&i2) i .r7'
+ StrCmp $1 'L' 0 FileFunc_GetTime_systemtime
+ System::Call /NOUNLOAD 'kernel32::GetLocalTime(i)i(r7)'
+ goto FileFunc_GetTime_convert
+ FileFunc_GetTime_systemtime:
+ StrCmp $1 'LS' 0 FileFunc_GetTime_filetime
+ System::Call /NOUNLOAD 'kernel32::GetSystemTime(i)i(r7)'
+ goto FileFunc_GetTime_convert
+
+ FileFunc_GetTime_filetime:
+ System::Call /NOUNLOAD '*$6(i,l,l,l,i,i,i,i,&t260,&t14)i(,.r4,.r3,.r2)'
+ System::Free /NOUNLOAD $6
+ StrCmp $1 'A' 0 +3
+ StrCpy $2 $3
+ goto FileFunc_GetTime_tolocal
+ StrCmp $1 'C' 0 +3
+ StrCpy $2 $4
+ goto FileFunc_GetTime_tolocal
+ StrCmp $1 'M' FileFunc_GetTime_tolocal
+
+ StrCmp $1 'AS' FileFunc_GetTime_tosystem
+ StrCmp $1 'CS' 0 +3
+ StrCpy $3 $4
+ goto FileFunc_GetTime_tosystem
+ StrCmp $1 'MS' 0 +3
+ StrCpy $3 $2
+ goto FileFunc_GetTime_tosystem
+
+ FileFunc_GetTime_tolocal:
+ System::Call /NOUNLOAD 'kernel32::FileTimeToLocalFileTime(*l,*l)i(r2,.r3)'
+ FileFunc_GetTime_tosystem:
+ System::Call /NOUNLOAD 'kernel32::FileTimeToSystemTime(*l,i)i(r3,r7)'
+
+ FileFunc_GetTime_convert:
+ System::Call /NOUNLOAD '*$7(&i2,&i2,&i2,&i2,&i2,&i2,&i2,&i2)i(.r5,.r6,.r4,.r0,.r3,.r2,.r1,)'
+ System::Free $7
+
+ IntCmp $0 9 0 0 +2
+ StrCpy $0 '0$0'
+ IntCmp $1 9 0 0 +2
+ StrCpy $1 '0$1'
+ IntCmp $2 9 0 0 +2
+ StrCpy $2 '0$2'
+ IntCmp $6 9 0 0 +2
+ StrCpy $6 '0$6'
+
+ StrCmp $4 0 0 +3
+ StrCpy $4 Sunday
+ goto FileFunc_GetTime_end
+ StrCmp $4 1 0 +3
+ StrCpy $4 Monday
+ goto FileFunc_GetTime_end
+ StrCmp $4 2 0 +3
+ StrCpy $4 Tuesday
+ goto FileFunc_GetTime_end
+ StrCmp $4 3 0 +3
+ StrCpy $4 Wednesday
+ goto FileFunc_GetTime_end
+ StrCmp $4 4 0 +3
+ StrCpy $4 Thursday
+ goto FileFunc_GetTime_end
+ StrCmp $4 5 0 +3
+ StrCpy $4 Friday
+ goto FileFunc_GetTime_end
+ StrCmp $4 6 0 FileFunc_GetTime_error
+ StrCpy $4 Saturday
+ goto FileFunc_GetTime_end
+
+ FileFunc_GetTime_error:
+ SetErrors
+ StrCpy $0 ''
+ StrCpy $1 ''
+ StrCpy $2 ''
+ StrCpy $3 ''
+ StrCpy $4 ''
+ StrCpy $5 ''
+ StrCpy $6 ''
+
+ FileFunc_GetTime_end:
+ Pop $7
+ Exch $6
+ Exch
+ Exch $5
+ Exch 2
+ Exch $4
+ Exch 3
+ Exch $3
+ Exch 4
+ Exch $2
+ Exch 5
+ Exch $1
+ Exch 6
+ Exch $0
+
+ !verbose pop
+!macroend
+
+!define GetFileAttributes `!insertmacro GetFileAttributesCall`
+!define un.GetFileAttributes `!insertmacro GetFileAttributesCall`
+
+!macro GetFileAttributes
!macroend
!macro un.GetFileAttributes
- !ifndef un.GetFileAttributes
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN `un.`
+!macroend
- !insertmacro GetFileAttributes
+!macro GetFileAttributes_
+ !verbose push
+ !verbose ${_FILEFUNC_VERBOSE}
+
+ Exch $1
+ Exch
+ Exch $0
+ Exch
+ Push $2
+ Push $3
+ Push $4
+ Push $5
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN
- !verbose pop
- !endif
+ System::Call 'kernel32::GetFileAttributes(t r0)i .r2'
+ StrCmp $2 -1 FileFunc_GetFileAttributes_error
+ StrCpy $3 ''
+
+ IntOp $0 $2 & 0x4000
+ IntCmp $0 0 +2
+ StrCpy $3 'ENCRYPTED|'
+
+ IntOp $0 $2 & 0x2000
+ IntCmp $0 0 +2
+ StrCpy $3 'NOT_CONTENT_INDEXED|$3'
+
+ IntOp $0 $2 & 0x1000
+ IntCmp $0 0 +2
+ StrCpy $3 'OFFLINE|$3'
+
+ IntOp $0 $2 & 0x0800
+ IntCmp $0 0 +2
+ StrCpy $3 'COMPRESSED|$3'
+
+ IntOp $0 $2 & 0x0400
+ IntCmp $0 0 +2
+ StrCpy $3 'REPARSE_POINT|$3'
+
+ IntOp $0 $2 & 0x0200
+ IntCmp $0 0 +2
+ StrCpy $3 'SPARSE_FILE|$3'
+
+ IntOp $0 $2 & 0x0100
+ IntCmp $0 0 +2
+ StrCpy $3 'TEMPORARY|$3'
+
+ IntOp $0 $2 & 0x0080
+ IntCmp $0 0 +2
+ StrCpy $3 'NORMAL|$3'
+
+ IntOp $0 $2 & 0x0040
+ IntCmp $0 0 +2
+ StrCpy $3 'DEVICE|$3'
+
+ IntOp $0 $2 & 0x0020
+ IntCmp $0 0 +2
+ StrCpy $3 'ARCHIVE|$3'
+
+ IntOp $0 $2 & 0x0010
+ IntCmp $0 0 +2
+ StrCpy $3 'DIRECTORY|$3'
+
+ IntOp $0 $2 & 0x0004
+ IntCmp $0 0 +2
+ StrCpy $3 'SYSTEM|$3'
+
+ IntOp $0 $2 & 0x0002
+ IntCmp $0 0 +2
+ StrCpy $3 'HIDDEN|$3'
+
+ IntOp $0 $2 & 0x0001
+ IntCmp $0 0 +2
+ StrCpy $3 'READONLY|$3'
+
+ StrCpy $0 $3 -1
+ StrCmp $1 '' FileFunc_GetFileAttributes_end
+ StrCmp $1 'ALL' FileFunc_GetFileAttributes_end
+
+ FileFunc_GetFileAttributes_attrcmp:
+ StrCpy $5 0
+ IntOp $5 $5 + 1
+ StrCpy $4 $1 1 $5
+ StrCmp $4 '' +2
+ StrCmp $4 '|' 0 -3
+ StrCpy $2 $1 $5
+ IntOp $5 $5 + 1
+ StrCpy $1 $1 '' $5
+ StrLen $3 $2
+ StrCpy $5 -1
+ IntOp $5 $5 + 1
+ StrCpy $4 $0 $3 $5
+ StrCmp $4 '' FileFunc_GetFileAttributes_notfound
+ StrCmp $4 $2 0 -3
+ StrCmp $1 '' 0 FileFunc_GetFileAttributes_attrcmp
+ StrCpy $0 1
+ goto FileFunc_GetFileAttributes_end
+
+ FileFunc_GetFileAttributes_notfound:
+ StrCpy $0 0
+ goto FileFunc_GetFileAttributes_end
+
+ FileFunc_GetFileAttributes_error:
+ SetErrors
+ StrCpy $0 ''
+
+ FileFunc_GetFileAttributes_end:
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Exch $0
+
+ !verbose pop
+!macroend
+
+!define GetFileVersion `!insertmacro GetFileVersionCall`
+!define un.GetFileVersion `!insertmacro GetFileVersionCall`
+
+!macro GetFileVersion
!macroend
!macro un.GetFileVersion
- !ifndef un.GetFileVersion
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN `un.`
+!macroend
- !insertmacro GetFileVersion
+!macro GetFileVersion_
+ !verbose push
+ !verbose ${_FILEFUNC_VERBOSE}
+
+ Exch $0
+ Push $1
+ Push $2
+ Push $3
+ Push $4
+ Push $5
+ Push $6
+ ClearErrors
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN
- !verbose pop
- !endif
+ GetDllVersion '$0' $1 $2
+ IfErrors FileFunc_GetFileVersion_error
+ IntOp $3 $1 >> 16
+ IntOp $3 $3 & 0x0000FFFF
+ IntOp $4 $1 & 0x0000FFFF
+ IntOp $5 $2 >> 16
+ IntOp $5 $5 & 0x0000FFFF
+ IntOp $6 $2 & 0x0000FFFF
+ StrCpy $0 '$3.$4.$5.$6'
+ goto FileFunc_GetFileVersion_end
+
+ FileFunc_GetFileVersion_error:
+ SetErrors
+ StrCpy $0 ''
+
+ FileFunc_GetFileVersion_end:
+ Pop $6
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Exch $0
+
+ !verbose pop
+!macroend
+
+!define GetExeName `!insertmacro GetExeNameCall`
+!define un.GetExeName `!insertmacro GetExeNameCall`
+
+!macro GetExeName
!macroend
!macro un.GetExeName
- !ifndef un.GetExeName
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN `un.`
+!macroend
- !insertmacro GetExeName
+!macro GetExeName_
+ !verbose push
+ !verbose ${_FILEFUNC_VERBOSE}
+
+ Push $0
+ Push $1
+ Push $2
+ System::Call /NOUNLOAD 'kernel32::GetModuleFileNameA(i 0, t .r0, i 1024)'
+ System::Call 'kernel32::GetLongPathNameA(t r0, t .r1, i 1024)i .r2'
+ StrCmp $2 error +2
+ StrCpy $0 $1
+ Pop $2
+ Pop $1
+ Exch $0
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN
- !verbose pop
- !endif
+ !verbose pop
+!macroend
+
+!define GetExePath `!insertmacro GetExePathCall`
+!define un.GetExePath `!insertmacro GetExePathCall`
+
+!macro GetExePath
!macroend
!macro un.GetExePath
- !ifndef un.GetExePath
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN `un.`
+!macroend
- !insertmacro GetExePath
+!macro GetExePath_
+ !verbose push
+ !verbose ${_FILEFUNC_VERBOSE}
+
+ Push $0
+ Push $1
+ Push $2
+ StrCpy $0 $EXEDIR
+ System::Call 'kernel32::GetLongPathNameA(t r0, t .r1, i 1024)i .r2'
+ StrCmp $2 error +2
+ StrCpy $0 $1
+ Pop $2
+ Pop $1
+ Exch $0
+
+ !verbose pop
+!macroend
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN
- !verbose pop
- !endif
+!define GetParameters `!insertmacro GetParametersCall`
+!define un.GetParameters `!insertmacro GetParametersCall`
+
+!macro GetParameters
!macroend
!macro un.GetParameters
- !ifndef un.GetParameters
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN `un.`
+!macroend
- !insertmacro GetParameters
+!macro GetParameters_
+ !verbose push
+ !verbose ${_FILEFUNC_VERBOSE}
+
+ ;cmdline-check
+ StrCmp $CMDLINE "" 0 +3
+ Push ""
+ Return
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN
- !verbose pop
- !endif
+ ;vars
+ Push $0 ;tmp
+ Push $1 ;length
+ Push $2 ;parameter offset
+ Push $3 ;separator
+
+ ;length/offset
+ StrLen $1 $CMDLINE
+ StrCpy $2 2 ;start with third character
+
+ ;separator
+ StrCpy $3 $CMDLINE 1 ;first character
+ StrCmp $3 '"' +2
+ StrCpy $3 ' '
+
+ FileFunc_GetParameters_token: ;finding second separator
+ IntCmp $2 $1 FileFunc_GetParameters_strip 0 FileFunc_GetParameters_strip
+ StrCpy $0 $CMDLINE 1 $2
+ IntOp $2 $2 + 1
+ StrCmp $3 $0 0 FileFunc_GetParameters_token
+
+ FileFunc_GetParameters_strip: ;strip white space
+ IntCmp $2 $1 FileFunc_GetParameters_copy 0 FileFunc_GetParameters_copy
+ StrCpy $0 $CMDLINE 1 $2
+ StrCmp $0 ' ' 0 FileFunc_GetParameters_copy
+ IntOp $2 $2 + 1
+ Goto FileFunc_GetParameters_strip
+
+ FileFunc_GetParameters_copy:
+ StrCpy $0 $CMDLINE "" $2
+
+ ;strip white spaces from end
+ FileFunc_GetParameters_rstrip:
+ StrCpy $1 $0 1 -1
+ StrCmp $1 ' ' 0 FileFunc_GetParameters_done
+ StrCpy $0 $0 -1
+ Goto FileFunc_GetParameters_rstrip
+
+ FileFunc_GetParameters_done:
+ Pop $3
+ Pop $2
+ Pop $1
+ Exch $0
+
+ !verbose pop
+!macroend
+
+!macro GetOptionsBody _FILEFUNC_S
+
+ Exch $1
+ Exch
+ Exch $0
+ Exch
+ Push $2
+ Push $3
+ Push $4
+ Push $5
+ Push $6
+ Push $7
+ ClearErrors
+
+ StrCpy $2 $1 '' 1
+ StrCpy $1 $1 1
+ StrLen $3 $2
+ StrCpy $7 0
+
+ FileFunc_GetOptions${_FILEFUNC_S}_begin:
+ StrCpy $4 -1
+ StrCpy $6 ''
+
+ FileFunc_GetOptions${_FILEFUNC_S}_quote:
+ IntOp $4 $4 + 1
+ StrCpy $5 $0 1 $4
+ StrCmp${_FILEFUNC_S} $5$7 '0' FileFunc_GetOptions${_FILEFUNC_S}_notfound
+ StrCmp${_FILEFUNC_S} $5 '' FileFunc_GetOptions${_FILEFUNC_S}_trimright
+ StrCmp${_FILEFUNC_S} $5 '"' 0 +7
+ StrCmp${_FILEFUNC_S} $6 '' 0 +3
+ StrCpy $6 '"'
+ goto FileFunc_GetOptions${_FILEFUNC_S}_quote
+ StrCmp${_FILEFUNC_S} $6 '"' 0 +3
+ StrCpy $6 ''
+ goto FileFunc_GetOptions${_FILEFUNC_S}_quote
+ StrCmp${_FILEFUNC_S} $5 `'` 0 +7
+ StrCmp${_FILEFUNC_S} $6 `` 0 +3
+ StrCpy $6 `'`
+ goto FileFunc_GetOptions${_FILEFUNC_S}_quote
+ StrCmp${_FILEFUNC_S} $6 `'` 0 +3
+ StrCpy $6 ``
+ goto FileFunc_GetOptions${_FILEFUNC_S}_quote
+ StrCmp${_FILEFUNC_S} $5 '`' 0 +7
+ StrCmp${_FILEFUNC_S} $6 '' 0 +3
+ StrCpy $6 '`'
+ goto FileFunc_GetOptions${_FILEFUNC_S}_quote
+ StrCmp${_FILEFUNC_S} $6 '`' 0 +3
+ StrCpy $6 ''
+ goto FileFunc_GetOptions${_FILEFUNC_S}_quote
+ StrCmp${_FILEFUNC_S} $6 '"' FileFunc_GetOptions${_FILEFUNC_S}_quote
+ StrCmp${_FILEFUNC_S} $6 `'` FileFunc_GetOptions${_FILEFUNC_S}_quote
+ StrCmp${_FILEFUNC_S} $6 '`' FileFunc_GetOptions${_FILEFUNC_S}_quote
+ StrCmp${_FILEFUNC_S} $5 $1 0 FileFunc_GetOptions${_FILEFUNC_S}_quote
+ StrCmp${_FILEFUNC_S} $7 0 FileFunc_GetOptions${_FILEFUNC_S}_trimleft FileFunc_GetOptions${_FILEFUNC_S}_trimright
+
+ FileFunc_GetOptions${_FILEFUNC_S}_trimleft:
+ IntOp $4 $4 + 1
+ StrCpy $5 $0 $3 $4
+ StrCmp${_FILEFUNC_S} $5 '' FileFunc_GetOptions${_FILEFUNC_S}_notfound
+ StrCmp${_FILEFUNC_S} $5 $2 0 FileFunc_GetOptions${_FILEFUNC_S}_quote
+ IntOp $4 $4 + $3
+ StrCpy $0 $0 '' $4
+ StrCpy $4 $0 1
+ StrCmp${_FILEFUNC_S} $4 ' ' 0 +3
+ StrCpy $0 $0 '' 1
+ goto -3
+ StrCpy $7 1
+ goto FileFunc_GetOptions${_FILEFUNC_S}_begin
+
+ FileFunc_GetOptions${_FILEFUNC_S}_trimright:
+ StrCpy $0 $0 $4
+ StrCpy $4 $0 1 -1
+ StrCmp${_FILEFUNC_S} $4 ' ' 0 +3
+ StrCpy $0 $0 -1
+ goto -3
+ StrCpy $3 $0 1
+ StrCpy $4 $0 1 -1
+ StrCmp${_FILEFUNC_S} $3 $4 0 FileFunc_GetOptions${_FILEFUNC_S}_end
+ StrCmp${_FILEFUNC_S} $3 '"' +3
+ StrCmp${_FILEFUNC_S} $3 `'` +2
+ StrCmp${_FILEFUNC_S} $3 '`' 0 FileFunc_GetOptions${_FILEFUNC_S}_end
+ StrCpy $0 $0 -1 1
+ goto FileFunc_GetOptions${_FILEFUNC_S}_end
+
+ FileFunc_GetOptions${_FILEFUNC_S}_notfound:
+ SetErrors
+ StrCpy $0 ''
+
+ FileFunc_GetOptions${_FILEFUNC_S}_end:
+ Pop $7
+ Pop $6
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Exch $0
+
+!macroend
+
+!define GetOptions `!insertmacro GetOptionsCall`
+!define un.GetOptions `!insertmacro GetOptionsCall`
+
+!macro GetOptions
!macroend
!macro un.GetOptions
- !ifndef un.GetOptions
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN `un.`
-
- !insertmacro GetOptions
-
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN
- !verbose pop
- !endif
!macroend
-!macro un.GetRoot
- !ifndef un.GetRoot
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN `un.`
-
- !insertmacro GetRoot
-
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN
- !verbose pop
- !endif
-!macroend
-
-!macro un.GetParent
- !ifndef un.GetParent
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN `un.`
-
- !insertmacro GetParent
-
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN
- !verbose pop
- !endif
-!macroend
-
-!macro un.GetFileName
- !ifndef un.GetFileName
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN `un.`
-
- !insertmacro GetFileName
-
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN
- !verbose pop
- !endif
-!macroend
-
-!macro un.GetBaseName
- !ifndef un.GetBaseName
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN `un.`
-
- !insertmacro GetBaseName
-
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN
- !verbose pop
- !endif
-!macroend
-
-!macro un.GetFileExt
- !ifndef un.GetFileExt
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN `un.`
-
- !insertmacro GetFileExt
-
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN
- !verbose pop
- !endif
-!macroend
-
-!macro un.BannerTrimPath
- !ifndef un.BannerTrimPath
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN `un.`
-
- !insertmacro BannerTrimPath
-
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN
- !verbose pop
- !endif
-!macroend
-
-!macro un.DirState
- !ifndef un.DirState
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN `un.`
-
- !insertmacro DirState
-
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN
- !verbose pop
- !endif
-!macroend
-
-!macro un.RefreshShellIcons
- !ifndef un.RefreshShellIcons
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN `un.`
-
- !insertmacro RefreshShellIcons
-
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN
- !verbose pop
- !endif
-!macroend
-
-
-# Install. Case sensitive. #
-
-!macro GetOptionsSCall _PARAMETERS _OPTION _RESULT
+!macro GetOptions_
!verbose push
!verbose ${_FILEFUNC_VERBOSE}
- Push `${_PARAMETERS}`
- Push `${_OPTION}`
- Call GetOptionsS
- Pop ${_RESULT}
+
+ !insertmacro GetOptionsBody ''
+
!verbose pop
!macroend
+!define GetOptionsS `!insertmacro GetOptionsSCall`
+!define un.GetOptionsS `!insertmacro GetOptionsSCall`
+
!macro GetOptionsS
- !ifndef GetOptionsS
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !undef _FILEFUNC_S
- !define _FILEFUNC_S `S`
-
- !insertmacro GetOptions
-
- !undef _FILEFUNC_S
- !define _FILEFUNC_S
- !verbose pop
- !endif
-!macroend
-
-
-# Uninstall. Case sensitive. #
-
-!macro un.GetOptionsSCall _PARAMETERS _OPTION _RESULT
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- Push `${_PARAMETERS}`
- Push `${_OPTION}`
- Call un.GetOptionsS
- Pop ${_RESULT}
- !verbose pop
!macroend
!macro un.GetOptionsS
- !ifndef un.GetOptionsS
- !verbose push
- !verbose ${_FILEFUNC_VERBOSE}
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN `un.`
- !undef _FILEFUNC_S
- !define _FILEFUNC_S `S`
+!macroend
- !insertmacro GetOptions
+!macro GetOptionsS_
+ !verbose push
+ !verbose ${_FILEFUNC_VERBOSE}
- !undef _FILEFUNC_UN
- !define _FILEFUNC_UN
- !undef _FILEFUNC_S
- !define _FILEFUNC_S
- !verbose pop
- !endif
+ !insertmacro GetOptionsBody 'S'
+
+ !verbose pop
+!macroend
+
+!define GetRoot `!insertmacro GetRootCall`
+!define un.GetRoot `!insertmacro GetRootCall`
+
+!macro GetRoot
+!macroend
+
+!macro un.GetRoot
+!macroend
+
+!macro GetRoot_
+ !verbose push
+ !verbose ${_FILEFUNC_VERBOSE}
+
+ Exch $0
+ Push $1
+ Push $2
+ Push $3
+
+ StrCpy $1 $0 2
+ StrCmp $1 '\\' FileFunc_GetRoot_UNC
+ StrCpy $2 $1 1 1
+ StrCmp $2 ':' 0 FileFunc_GetRoot_empty
+ StrCpy $0 $1
+ goto FileFunc_GetRoot_end
+
+ FileFunc_GetRoot_UNC:
+ StrCpy $2 1
+ StrCpy $3 ''
+
+ FileFunc_GetRoot_loop:
+ IntOp $2 $2 + 1
+ StrCpy $1 $0 1 $2
+ StrCmp $1$3 '' FileFunc_GetRoot_empty
+ StrCmp $1 '' +5
+ StrCmp $1 '\' 0 FileFunc_GetRoot_loop
+ StrCmp $3 '1' +3
+ StrCpy $3 '1'
+ goto FileFunc_GetRoot_loop
+ StrCpy $0 $0 $2
+ StrCpy $2 $0 1 -1
+ StrCmp $2 '\' 0 FileFunc_GetRoot_end
+
+ FileFunc_GetRoot_empty:
+ StrCpy $0 ''
+
+ FileFunc_GetRoot_end:
+ Pop $3
+ Pop $2
+ Pop $1
+ Exch $0
+
+ !verbose pop
+!macroend
+
+!define GetParent `!insertmacro GetParentCall`
+!define un.GetParent `!insertmacro GetParentCall`
+
+!macro GetParent
+!macroend
+
+!macro un.GetParent
+!macroend
+
+!macro GetParent_
+ !verbose push
+ !verbose ${_FILEFUNC_VERBOSE}
+
+ Exch $0
+ Push $1
+ Push $2
+
+ StrCpy $2 $0 1 -1
+ StrCmp $2 '\' 0 +3
+ StrCpy $0 $0 -1
+ goto -3
+
+ StrCpy $1 0
+ IntOp $1 $1 - 1
+ StrCpy $2 $0 1 $1
+ StrCmp $2 '\' +2
+ StrCmp $2 '' 0 -3
+ StrCpy $0 $0 $1
+
+ Pop $2
+ Pop $1
+ Exch $0
+
+ !verbose pop
+!macroend
+
+!define GetFileName `!insertmacro GetFileNameCall`
+!define un.GetFileName `!insertmacro GetFileNameCall`
+
+!macro GetFileName
+!macroend
+
+!macro un.GetFileName
+!macroend
+
+!macro GetFileName_
+ !verbose push
+ !verbose ${_FILEFUNC_VERBOSE}
+
+ Exch $0
+ Push $1
+ Push $2
+
+ StrCpy $2 $0 1 -1
+ StrCmp $2 '\' 0 +3
+ StrCpy $0 $0 -1
+ goto -3
+
+ StrCpy $1 0
+ IntOp $1 $1 - 1
+ StrCpy $2 $0 1 $1
+ StrCmp $2 '' FileFunc_GetFileName_end
+ StrCmp $2 '\' 0 -3
+ IntOp $1 $1 + 1
+ StrCpy $0 $0 '' $1
+
+ FileFunc_GetFileName_end:
+ Pop $2
+ Pop $1
+ Exch $0
+
+ !verbose pop
+!macroend
+
+!define GetBaseName `!insertmacro GetBaseNameCall`
+!define un.GetBaseName `!insertmacro GetBaseNameCall`
+
+!macro GetBaseName
+!macroend
+
+!macro un.GetBaseName
+!macroend
+
+!macro GetBaseName_
+ !verbose push
+ !verbose ${_FILEFUNC_VERBOSE}
+
+ Exch $0
+ Push $1
+ Push $2
+ Push $3
+
+ StrCpy $1 0
+ StrCpy $3 ''
+
+ FileFunc_GetBaseName_loop:
+ IntOp $1 $1 - 1
+ StrCpy $2 $0 1 $1
+ StrCmp $2 '' FileFunc_GetBaseName_trimpath
+ StrCmp $2 '\' FileFunc_GetBaseName_trimpath
+ StrCmp $3 'noext' FileFunc_GetBaseName_loop
+ StrCmp $2 '.' 0 FileFunc_GetBaseName_loop
+ StrCpy $0 $0 $1
+ StrCpy $3 'noext'
+ StrCpy $1 0
+ goto FileFunc_GetBaseName_loop
+
+ FileFunc_GetBaseName_trimpath:
+ StrCmp $1 -1 FileFunc_GetBaseName_empty
+ IntOp $1 $1 + 1
+ StrCpy $0 $0 '' $1
+ goto FileFunc_GetBaseName_end
+
+ FileFunc_GetBaseName_empty:
+ StrCpy $0 ''
+
+ FileFunc_GetBaseName_end:
+ Pop $3
+ Pop $2
+ Pop $1
+ Exch $0
+
+ !verbose pop
+!macroend
+
+!define GetFileExt `!insertmacro GetFileExtCall`
+!define un.GetFileExt `!insertmacro GetFileExtCall`
+
+!macro GetFileExt
+!macroend
+
+!macro un.GetFileExt
+!macroend
+
+!macro GetFileExt_
+ !verbose push
+ !verbose ${_FILEFUNC_VERBOSE}
+
+ Exch $0
+ Push $1
+ Push $2
+
+ StrCpy $1 0
+
+ FileFunc_GetFileExt_loop:
+ IntOp $1 $1 - 1
+ StrCpy $2 $0 1 $1
+ StrCmp $2 '' FileFunc_GetFileExt_empty
+ StrCmp $2 '\' FileFunc_GetFileExt_empty
+ StrCmp $2 '.' 0 FileFunc_GetFileExt_loop
+
+ StrCmp $1 -1 FileFunc_GetFileExt_empty
+ IntOp $1 $1 + 1
+ StrCpy $0 $0 '' $1
+ goto FileFunc_GetFileExt_end
+
+ FileFunc_GetFileExt_empty:
+ StrCpy $0 ''
+
+ FileFunc_GetFileExt_end:
+ Pop $2
+ Pop $1
+ Exch $0
+
+ !verbose pop
+!macroend
+
+!define BannerTrimPath `!insertmacro BannerTrimPathCall`
+!define un.BannerTrimPath `!insertmacro BannerTrimPathCall`
+
+!macro BannerTrimPath
+!macroend
+
+!macro un.BannerTrimPath
+!macroend
+
+!macro BannerTrimPath_
+ !verbose push
+ !verbose ${_FILEFUNC_VERBOSE}
+
+ Exch $1
+ Exch
+ Exch $0
+ Exch
+ Push $2
+ Push $3
+ Push $4
+
+ StrCpy $3 $1 1 -1
+ IntOp $1 $1 + 0
+ StrLen $2 $0
+ IntCmp $2 $1 FileFunc_BannerTrimPath_end FileFunc_BannerTrimPath_end
+ IntOp $1 $1 - 3
+ IntCmp $1 0 FileFunc_BannerTrimPath_empty FileFunc_BannerTrimPath_empty
+ StrCmp $3 'A' FileFunc_BannerTrimPath_A-trim
+ StrCmp $3 'B' FileFunc_BannerTrimPath_B-trim
+ StrCmp $3 'C' FileFunc_BannerTrimPath_C-trim
+ StrCmp $3 'D' FileFunc_BannerTrimPath_D-trim
+
+ FileFunc_BannerTrimPath_A-trim:
+ StrCpy $3 $0 1 1
+ StrCpy $2 0
+ StrCmp $3 ':' 0 +2
+ IntOp $2 $2 + 2
+
+ FileFunc_BannerTrimPath_loopleft:
+ IntOp $2 $2 + 1
+ StrCpy $3 $0 1 $2
+ StrCmp $2 $1 FileFunc_BannerTrimPath_C-trim
+ StrCmp $3 '\' 0 FileFunc_BannerTrimPath_loopleft
+ StrCpy $3 $0 $2
+ IntOp $2 $2 - $1
+ IntCmp $2 0 FileFunc_BannerTrimPath_B-trim 0 FileFunc_BannerTrimPath_B-trim
+
+ FileFunc_BannerTrimPath_loopright:
+ IntOp $2 $2 + 1
+ StrCpy $4 $0 1 $2
+ StrCmp $2 0 FileFunc_BannerTrimPath_B-trim
+ StrCmp $4 '\' 0 FileFunc_BannerTrimPath_loopright
+ StrCpy $4 $0 '' $2
+ StrCpy $0 '$3\...$4'
+ goto FileFunc_BannerTrimPath_end
+
+ FileFunc_BannerTrimPath_B-trim:
+ StrCpy $2 $1
+ IntOp $2 $2 - 1
+ StrCmp $2 -1 FileFunc_BannerTrimPath_C-trim
+ StrCpy $3 $0 1 $2
+ StrCmp $3 '\' 0 -3
+ StrCpy $0 $0 $2
+ StrCpy $0 '$0\...'
+ goto FileFunc_BannerTrimPath_end
+
+ FileFunc_BannerTrimPath_C-trim:
+ StrCpy $0 $0 $1
+ StrCpy $0 '$0...'
+ goto FileFunc_BannerTrimPath_end
+
+ FileFunc_BannerTrimPath_D-trim:
+ StrCpy $3 -1
+ IntOp $3 $3 - 1
+ StrCmp $3 -$2 FileFunc_BannerTrimPath_C-trim
+ StrCpy $4 $0 1 $3
+ StrCmp $4 '\' 0 -3
+ StrCpy $4 $0 '' $3
+ IntOp $3 $1 + $3
+ IntCmp $3 2 FileFunc_BannerTrimPath_C-trim FileFunc_BannerTrimPath_C-trim
+ StrCpy $0 $0 $3
+ StrCpy $0 '$0...$4'
+ goto FileFunc_BannerTrimPath_end
+
+ FileFunc_BannerTrimPath_empty:
+ StrCpy $0 ''
+
+ FileFunc_BannerTrimPath_end:
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Exch $0
+
+ !verbose pop
+!macroend
+
+!define DirState `!insertmacro DirStateCall`
+!define un.DirState `!insertmacro DirStateCall`
+
+!macro DirState
+!macroend
+
+!macro un.DirState
+!macroend
+
+!macro DirState_
+ !verbose push
+ !verbose ${_FILEFUNC_VERBOSE}
+
+ Exch $0
+ Push $1
+ ClearErrors
+
+ FindFirst $1 $0 '$0\*.*'
+ IfErrors 0 +3
+ StrCpy $0 -1
+ goto FileFunc_DirState_end
+ StrCmp $0 '.' 0 +4
+ FindNext $1 $0
+ StrCmp $0 '..' 0 +2
+ FindNext $1 $0
+ FindClose $1
+ IfErrors 0 +3
+ StrCpy $0 0
+ goto FileFunc_DirState_end
+ StrCpy $0 1
+
+ FileFunc_DirState_end:
+ Pop $1
+ Exch $0
+
+ !verbose pop
+!macroend
+
+!define RefreshShellIcons `!insertmacro RefreshShellIconsCall`
+!define un.RefreshShellIcons `!insertmacro RefreshShellIconsCall`
+
+!macro RefreshShellIcons
+!macroend
+
+!macro un.RefreshShellIcons
+!macroend
+
+!macro RefreshShellIcons_
+ !verbose push
+ !verbose ${_FILEFUNC_VERBOSE}
+
+ System::Call 'shell32::SHChangeNotify(i 0x08000000, i 0, i 0, i 0)'
+
+ !verbose pop
!macroend
!endif
diff --git a/Include/TextFunc.nsh b/Include/TextFunc.nsh
index 4069834f..b9893a3c 100644
--- a/Include/TextFunc.nsh
+++ b/Include/TextFunc.nsh
@@ -10,8 +10,7 @@ _____________________________________________________________________________
Usage in script:
1. !include "TextFunc.nsh"
- 2. !insertmacro TextFunction
- 3. [Section|Function]
+ 2. [Section|Function]
${TextFunction} "File" "..." $var
[SectionEnd|FunctionEnd]
@@ -20,11 +19,6 @@ _____________________________________________________________________________
TextCompare|TextCompareS|ConfigRead|ConfigReadS|
ConfigWrite|ConfigWriteS|FileRecode|TrimNewLines]
- un.TextFunction=[un.LineFind|un.LineRead|un.FileReadFromEnd|un.LineSum|
- un.FileJoin|un.TextCompare|un.TextCompareS|un.ConfigRead|
- un.ConfigReadS|un.ConfigWrite|un.ConfigWriteS|un.FileRecode|
- un.TrimNewLines]
-
_____________________________________________________________________________
Thanks to:
@@ -63,6 +57,7 @@ TrimNewLines
!define TEXTFUNC_INCLUDED
!include FileFunc.nsh
+!include Util.nsh
!verbose push
!verbose 3
@@ -71,8 +66,6 @@ TrimNewLines
!endif
!verbose ${_TEXTFUNC_VERBOSE}
!define TEXTFUNC_VERBOSE `!insertmacro TEXTFUNC_VERBOSE`
-!define _TEXTFUNC_UN
-!define _TEXTFUNC_S
!verbose pop
!macro TEXTFUNC_VERBOSE _VERBOSE
@@ -83,9 +76,6 @@ TrimNewLines
!verbose pop
!macroend
-
-# Install. Case insensitive. #
-
!macro LineFindCall _INPUT _OUTPUT _RANGE _FUNC
!verbose push
!verbose ${_TEXTFUNC_VERBOSE}
@@ -95,7 +85,7 @@ TrimNewLines
Push `${_RANGE}`
GetFunctionAddress $0 `${_FUNC}`
Push `$0`
- Call LineFind
+ ${CallArtificialFunction} LineFind_
Pop $0
!verbose pop
!macroend
@@ -105,7 +95,7 @@ TrimNewLines
!verbose ${_TEXTFUNC_VERBOSE}
Push `${_FILE}`
Push `${_NUMBER}`
- Call LineRead
+ ${CallArtificialFunction} LineRead_
Pop ${_RESULT}
!verbose pop
!macroend
@@ -117,7 +107,7 @@ TrimNewLines
Push `${_FILE}`
GetFunctionAddress $0 `${_FUNC}`
Push `$0`
- Call FileReadFromEnd
+ ${CallArtificialFunction} FileReadFromEnd_
Pop $0
!verbose pop
!macroend
@@ -126,7 +116,7 @@ TrimNewLines
!verbose push
!verbose ${_TEXTFUNC_VERBOSE}
Push `${_FILE}`
- Call LineSum
+ ${CallArtificialFunction} LineSum_
Pop ${_RESULT}
!verbose pop
!macroend
@@ -137,7 +127,7 @@ TrimNewLines
Push `${_FILE1}`
Push `${_FILE2}`
Push `${_FILE3}`
- Call FileJoin
+ ${CallArtificialFunction} FileJoin_
!verbose pop
!macroend
@@ -150,1182 +140,11 @@ TrimNewLines
Push `${_OPTION}`
GetFunctionAddress $0 `${_FUNC}`
Push `$0`
- Call TextCompare
+ ${CallArtificialFunction} TextCompare_
Pop $0
!verbose pop
!macroend
-!macro ConfigReadCall _FILE _ENTRY _RESULT
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- Push `${_FILE}`
- Push `${_ENTRY}`
- Call ConfigRead
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro ConfigWriteCall _FILE _ENTRY _VALUE _RESULT
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- Push `${_FILE}`
- Push `${_ENTRY}`
- Push `${_VALUE}`
- Call ConfigWrite
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro FileRecodeCall _FILE _FORMAT
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- Push `${_FILE}`
- Push `${_FORMAT}`
- Call FileRecode
- !verbose pop
-!macroend
-
-!macro TrimNewLinesCall _FILE _RESULT
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- Push `${_FILE}`
- Call TrimNewLines
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro _TextFunc_TempFileForFile _FILE _RESULT
- ${${_TEXTFUNC_UN}GetParent} ${_FILE} ${_RESULT}
- StrCmp ${_RESULT} "" 0 +2
- StrCpy ${_RESULT} $EXEDIR
- GetTempFileName ${_RESULT} ${_RESULT}
- StrCmp ${_RESULT} "" 0 +2
- GetTempFileName ${_RESULT}
- ClearErrors
-!macroend
-
-!macro LineFind
- !ifndef ${_TEXTFUNC_UN}LineFind
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- !define ${_TEXTFUNC_UN}LineFind `!insertmacro ${_TEXTFUNC_UN}LineFindCall`
-
- !insertmacro ${_TEXTFUNC_UN}GetParent
-
- Function ${_TEXTFUNC_UN}LineFind
- Exch $3
- Exch
- Exch $2
- Exch
- Exch 2
- Exch $1
- Exch 2
- Exch 3
- Exch $0
- Exch 3
- Push $4
- Push $5
- Push $6
- Push $7
- Push $8
- Push $9
- Push $R4
- Push $R5
- Push $R6
- Push $R7
- Push $R8
- Push $R9
- ClearErrors
-
- IfFileExists '$0' 0 error
- StrCmp $1 '/NUL' begin
- StrCpy $8 0
- IntOp $8 $8 - 1
- StrCpy $9 $1 1 $8
- StrCmp $9 \ +2
- StrCmp $9 '' +3 -3
- StrCpy $9 $1 $8
- IfFileExists '$9\*.*' 0 error
-
- begin:
- StrCpy $4 1
- StrCpy $5 -1
- StrCpy $6 0
- StrCpy $7 0
- StrCpy $R4 ''
- StrCpy $R6 ''
- StrCpy $R7 ''
- StrCpy $R8 0
-
- StrCpy $8 $2 1
- StrCmp $8 '{' 0 delspaces
- StrCpy $2 $2 '' 1
- StrCpy $8 $2 1 -1
- StrCmp $8 '}' 0 delspaces
- StrCpy $2 $2 -1
- StrCpy $R6 cut
-
- delspaces:
- StrCpy $8 $2 1
- StrCmp $8 ' ' 0 +3
- StrCpy $2 $2 '' 1
- goto -3
- StrCmp $2$7 '0' file
- StrCpy $4 ''
- StrCpy $5 ''
- StrCmp $2 '' writechk
-
- range:
- StrCpy $8 0
- StrCpy $9 $2 1 $8
- StrCmp $9 '' +5
- StrCmp $9 ' ' +4
- StrCmp $9 ':' +3
- IntOp $8 $8 + 1
- goto -5
- StrCpy $5 $2 $8
- IntOp $5 $5 + 0
- IntOp $8 $8 + 1
- StrCpy $2 $2 '' $8
- StrCmp $4 '' 0 +2
- StrCpy $4 $5
- StrCmp $9 ':' range
-
- IntCmp $4 0 0 +2
- IntCmp $5 -1 goto 0 growthcmp
- StrCmp $R7 '' 0 minus2plus
- StrCpy $R7 0
- FileOpen $8 $0 r
- FileRead $8 $9
- IfErrors +3
- IntOp $R7 $R7 + 1
- Goto -3
- FileClose $8
-
- minus2plus:
- IntCmp $4 0 +5 0 +5
- IntOp $4 $R7 + $4
- IntOp $4 $4 + 1
- IntCmp $4 0 +2 0 +2
- StrCpy $4 0
- IntCmp $5 -1 goto 0 growthcmp
- IntOp $5 $R7 + $5
- IntOp $5 $5 + 1
- growthcmp:
- IntCmp $4 $5 goto goto
- StrCpy $5 $4
- goto:
- goto $7
-
- file:
- StrCmp $1 '/NUL' notemp
- !insertmacro _TextFunc_TempFileForFile $1 $R4
- Push $R4
- FileOpen $R4 $R4 w
- notemp:
- FileOpen $R5 $0 r
- IfErrors preerror
-
- loop:
- IntOp $R8 $R8 + 1
- FileRead $R5 $R9
- IfErrors handleclose
-
- cmp:
- StrCmp $2$4$5 '' writechk
- IntCmp $4 $R8 call 0 writechk
- StrCmp $5 -1 call
- IntCmp $5 $R8 call 0 call
-
- GetLabelAddress $7 cmp
- goto delspaces
-
- call:
- StrCpy $7 $R9
- Push $0
- Push $1
- Push $2
- Push $3
- Push $4
- Push $5
- Push $6
- Push $7
- Push $R4
- Push $R5
- Push $R6
- Push $R7
- Push $R8
- StrCpy $R6 '$4:$5'
- StrCmp $R7 '' +3
- IntOp $R7 $R8 - $R7
- IntOp $R7 $R7 - 1
- Call $3
- Pop $9
- Pop $R8
- Pop $R7
- Pop $R6
- Pop $R5
- Pop $R4
- Pop $7
- Pop $6
- Pop $5
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Pop $0
- IfErrors preerror
- StrCmp $9 'StopLineFind' 0 +3
- IntOp $6 $6 + 1
- goto handleclose
- StrCmp $1 '/NUL' loop
- StrCmp $9 'SkipWrite' 0 +3
- IntOp $6 $6 + 1
- goto loop
- StrCmp $7 $R9 write
- IntOp $6 $6 + 1
- goto write
-
- writechk:
- StrCmp $1 '/NUL' loop
- StrCmp $R6 cut 0 write
- IntOp $6 $6 + 1
- goto loop
-
- write:
- FileWrite $R4 $R9
- goto loop
-
- preerror:
- SetErrors
-
- handleclose:
- StrCmp $1 '/NUL' +3
- FileClose $R4
- Pop $R4
- FileClose $R5
- IfErrors error
-
- StrCmp $1 '/NUL' end
- StrCmp $1 '' 0 +2
- StrCpy $1 $0
- StrCmp $6 0 0 rename
- FileOpen $7 $0 r
- FileSeek $7 0 END $8
- FileClose $7
- FileOpen $7 $R4 r
- FileSeek $7 0 END $9
- FileClose $7
- IntCmp $8 $9 0 rename
- Delete $R4
- StrCmp $1 $0 end
- CopyFiles /SILENT $0 $1
- goto end
-
- rename:
- Delete '$EXEDIR\$1'
- Rename $R4 '$EXEDIR\$1'
- IfErrors 0 end
- Delete $1
- Rename $R4 $1
- IfErrors 0 end
-
- error:
- SetErrors
-
- end:
- Pop $R9
- Pop $R8
- Pop $R7
- Pop $R6
- Pop $R5
- Pop $R4
- Pop $9
- Pop $8
- Pop $7
- Pop $6
- Pop $5
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Pop $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro LineRead
- !ifndef ${_TEXTFUNC_UN}LineRead
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- !define ${_TEXTFUNC_UN}LineRead `!insertmacro ${_TEXTFUNC_UN}LineReadCall`
-
- Function ${_TEXTFUNC_UN}LineRead
- Exch $1
- Exch
- Exch $0
- Exch
- Push $2
- Push $3
- Push $4
- ClearErrors
-
- IfFileExists $0 0 error
- IntOp $1 $1 + 0
- IntCmp $1 0 error 0 plus
- StrCpy $4 0
- FileOpen $2 $0 r
- IfErrors error
- FileRead $2 $3
- IfErrors +3
- IntOp $4 $4 + 1
- Goto -3
- FileClose $2
- IntOp $1 $4 + $1
- IntOp $1 $1 + 1
- IntCmp $1 0 error error
-
- plus:
- FileOpen $2 $0 r
- IfErrors error
- StrCpy $3 0
- IntOp $3 $3 + 1
- FileRead $2 $0
- IfErrors +4
- StrCmp $3 $1 0 -3
- FileClose $2
- goto end
- FileClose $2
-
- error:
- SetErrors
- StrCpy $0 ''
-
- end:
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Exch $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro FileReadFromEnd
- !ifndef ${_TEXTFUNC_UN}FileReadFromEnd
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- !define ${_TEXTFUNC_UN}FileReadFromEnd `!insertmacro ${_TEXTFUNC_UN}FileReadFromEndCall`
-
- Function ${_TEXTFUNC_UN}FileReadFromEnd
- Exch $1
- Exch
- Exch $0
- Exch
- Push $7
- Push $8
- Push $9
- ClearErrors
-
- StrCpy $7 -1
- StrCpy $8 0
- IfFileExists $0 0 error
- FileOpen $0 $0 r
- IfErrors error
- FileRead $0 $9
- IfErrors +4
- Push $9
- IntOp $8 $8 + 1
- goto -4
- FileClose $0
-
- nextline:
- StrCmp $8 0 end
- Pop $9
- Push $1
- Push $7
- Push $8
- Call $1
- Pop $0
- Pop $8
- Pop $7
- Pop $1
- IntOp $7 $7 - 1
- IntOp $8 $8 - 1
- IfErrors error
- StrCmp $0 'StopFileReadFromEnd' clearstack nextline
-
- error:
- SetErrors
-
- clearstack:
- StrCmp $8 0 end
- Pop $9
- IntOp $8 $8 - 1
- goto clearstack
-
- end:
- Pop $9
- Pop $8
- Pop $7
- Pop $1
- Pop $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro LineSum
- !ifndef ${_TEXTFUNC_UN}LineSum
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- !define ${_TEXTFUNC_UN}LineSum `!insertmacro ${_TEXTFUNC_UN}LineSumCall`
-
- Function ${_TEXTFUNC_UN}LineSum
- Exch $0
- Push $1
- Push $2
- ClearErrors
-
- IfFileExists $0 0 error
- StrCpy $2 0
- FileOpen $0 $0 r
- IfErrors error
- FileRead $0 $1
- IfErrors +3
- IntOp $2 $2 + 1
- Goto -3
- FileClose $0
- StrCpy $0 $2
- goto end
-
- error:
- SetErrors
- StrCpy $0 ''
-
- end:
- Pop $2
- Pop $1
- Exch $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro FileJoin
- !ifndef ${_TEXTFUNC_UN}FileJoin
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- !define ${_TEXTFUNC_UN}FileJoin `!insertmacro ${_TEXTFUNC_UN}FileJoinCall`
-
- !insertmacro ${_TEXTFUNC_UN}GetParent
-
- Function ${_TEXTFUNC_UN}FileJoin
- Exch $2
- Exch
- Exch $1
- Exch
- Exch 2
- Exch $0
- Exch 2
- Push $3
- Push $4
- Push $5
- ClearErrors
-
- IfFileExists $0 0 error
- IfFileExists $1 0 error
- StrCpy $3 0
- IntOp $3 $3 - 1
- StrCpy $4 $2 1 $3
- StrCmp $4 \ +2
- StrCmp $4 '' +3 -3
- StrCpy $4 $2 $3
- IfFileExists '$4\*.*' 0 error
-
- StrCmp $2 $0 0 +2
- StrCpy $2 ''
- StrCmp $2 '' 0 +3
- StrCpy $4 $0
- Goto notemp
- !insertmacro _TextFunc_TempFileForFile $2 $4
- CopyFiles /SILENT $0 $4
- notemp:
- FileOpen $3 $4 a
- IfErrors error
- FileSeek $3 -1 END
- FileRead $3 $5
- StrCmp $5 '$\r' +3
- StrCmp $5 '$\n' +2
- FileWrite $3 '$\r$\n'
-
- ;FileWrite $3 '$\r$\n--Divider--$\r$\n'
-
- FileOpen $0 $1 r
- IfErrors error
- FileRead $0 $5
- IfErrors +3
- FileWrite $3 $5
- goto -3
- FileClose $0
- FileClose $3
- StrCmp $2 '' end
- Delete '$EXEDIR\$2'
- Rename $4 '$EXEDIR\$2'
- IfErrors 0 end
- Delete $2
- Rename $4 $2
- IfErrors 0 end
-
- error:
- SetErrors
-
- end:
- Pop $5
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Pop $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro TextCompare
- !ifndef ${_TEXTFUNC_UN}TextCompare${_TEXTFUNC_S}
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- !define ${_TEXTFUNC_UN}TextCompare${_TEXTFUNC_S} `!insertmacro ${_TEXTFUNC_UN}TextCompare${_TEXTFUNC_S}Call`
-
- Function ${_TEXTFUNC_UN}TextCompare${_TEXTFUNC_S}
- Exch $3
- Exch
- Exch $2
- Exch
- Exch 2
- Exch $1
- Exch 2
- Exch 3
- Exch $0
- Exch 3
- Push $4
- Push $5
- Push $6
- Push $7
- Push $8
- Push $9
- ClearErrors
-
- IfFileExists $0 0 error
- IfFileExists $1 0 error
- StrCmp $2 'FastDiff' +5
- StrCmp $2 'FastEqual' +4
- StrCmp $2 'SlowDiff' +3
- StrCmp $2 'SlowEqual' +2
- goto error
-
- FileOpen $4 $0 r
- IfErrors error
- FileOpen $5 $1 r
- IfErrors error
- SetDetailsPrint textonly
-
- StrCpy $6 0
- StrCpy $8 0
-
- nextline:
- StrCmp${_TEXTFUNC_S} $4 '' fast
- IntOp $8 $8 + 1
- FileRead $4 $9
- IfErrors 0 +4
- FileClose $4
- StrCpy $4 ''
- StrCmp${_TEXTFUNC_S} $5 '' end
- StrCmp $2 'FastDiff' fast
- StrCmp $2 'FastEqual' fast slow
-
- fast:
- StrCmp${_TEXTFUNC_S} $5 '' call
- IntOp $6 $6 + 1
- FileRead $5 $7
- IfErrors 0 +5
- FileClose $5
- StrCpy $5 ''
- StrCmp${_TEXTFUNC_S} $4 '' end
- StrCmp $2 'FastDiff' call close
- StrCmp $2 'FastDiff' 0 +2
- StrCmp${_TEXTFUNC_S} $7 $9 nextline call
- StrCmp${_TEXTFUNC_S} $7 $9 call nextline
-
- slow:
- StrCmp${_TEXTFUNC_S} $4 '' close
- StrCpy $6 ''
- DetailPrint '$8. $9'
- FileSeek $5 0
-
- slownext:
- FileRead $5 $7
- IfErrors 0 +2
- StrCmp $2 'SlowDiff' call nextline
- StrCmp $2 'SlowDiff' 0 +2
- StrCmp${_TEXTFUNC_S} $7 $9 nextline slownext
- IntOp $6 $6 + 1
- StrCmp${_TEXTFUNC_S} $7 $9 0 slownext
-
- call:
- Push $2
- Push $3
- Push $4
- Push $5
- Push $6
- Push $7
- Push $8
- Push $9
- Call $3
- Pop $0
- Pop $9
- Pop $8
- Pop $7
- Pop $6
- Pop $5
- Pop $4
- Pop $3
- Pop $2
- StrCmp $0 'StopTextCompare' 0 nextline
-
- close:
- FileClose $4
- FileClose $5
- goto end
-
- error:
- SetErrors
-
- end:
- SetDetailsPrint both
- Pop $9
- Pop $8
- Pop $7
- Pop $6
- Pop $5
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Pop $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro ConfigRead
- !ifndef ${_TEXTFUNC_UN}ConfigRead${_TEXTFUNC_S}
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- !define ${_TEXTFUNC_UN}ConfigRead${_TEXTFUNC_S} `!insertmacro ${_TEXTFUNC_UN}ConfigRead${_TEXTFUNC_S}Call`
-
- Function ${_TEXTFUNC_UN}ConfigRead${_TEXTFUNC_S}
- Exch $1
- Exch
- Exch $0
- Exch
- Push $2
- Push $3
- Push $4
- ClearErrors
-
- FileOpen $2 $0 r
- IfErrors error
- StrLen $0 $1
- StrCmp${_TEXTFUNC_S} $0 0 error
-
- readnext:
- FileRead $2 $3
- IfErrors error
- StrCpy $4 $3 $0
- StrCmp${_TEXTFUNC_S} $4 $1 0 readnext
- StrCpy $0 $3 '' $0
- StrCpy $4 $0 1 -1
- StrCmp${_TEXTFUNC_S} $4 '$\r' +2
- StrCmp${_TEXTFUNC_S} $4 '$\n' 0 close
- StrCpy $0 $0 -1
- goto -4
-
- error:
- SetErrors
- StrCpy $0 ''
-
- close:
- FileClose $2
-
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Exch $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro ConfigWrite
- !ifndef ${_TEXTFUNC_UN}ConfigWrite${_TEXTFUNC_S}
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- !define ${_TEXTFUNC_UN}ConfigWrite${_TEXTFUNC_S} `!insertmacro ${_TEXTFUNC_UN}ConfigWrite${_TEXTFUNC_S}Call`
-
- Function ${_TEXTFUNC_UN}ConfigWrite${_TEXTFUNC_S}
- Exch $2
- Exch
- Exch $1
- Exch
- Exch 2
- Exch $0
- Exch 2
- Push $3
- Push $4
- Push $5
- Push $6
- ClearErrors
-
- IfFileExists $0 0 error
- FileOpen $3 $0 a
- IfErrors error
-
- StrLen $0 $1
- StrCmp${_TEXTFUNC_S} $0 0 0 readnext
- StrCpy $0 ''
- goto close
-
- readnext:
- FileRead $3 $4
- IfErrors add
- StrCpy $5 $4 $0
- StrCmp${_TEXTFUNC_S} $5 $1 0 readnext
-
- StrCpy $5 0
- IntOp $5 $5 - 1
- StrCpy $6 $4 1 $5
- StrCmp${_TEXTFUNC_S} $6 '$\r' -2
- StrCmp${_TEXTFUNC_S} $6 '$\n' -3
- StrCpy $6 $4
- StrCmp${_TEXTFUNC_S} $5 -1 +3
- IntOp $5 $5 + 1
- StrCpy $6 $4 $5
-
- StrCmp${_TEXTFUNC_S} $2 '' change
- StrCmp${_TEXTFUNC_S} $6 '$1$2' 0 change
- StrCpy $0 SAME
- goto close
-
- change:
- FileSeek $3 0 CUR $5
- StrLen $4 $4
- IntOp $4 $5 - $4
- FileSeek $3 0 END $6
- IntOp $6 $6 - $5
-
- System::Alloc /NOUNLOAD $6
- Pop $0
- FileSeek $3 $5 SET
- System::Call /NOUNLOAD 'kernel32::ReadFile(i r3, i r0, i $6, t.,)'
- FileSeek $3 $4 SET
- StrCmp${_TEXTFUNC_S} $2 '' +2
- FileWrite $3 '$1$2$\r$\n'
- System::Call /NOUNLOAD 'kernel32::WriteFile(i r3, i r0, i $6, t.,)'
- System::Call /NOUNLOAD 'kernel32::SetEndOfFile(i r3)'
- System::Free $0
- StrCmp${_TEXTFUNC_S} $2 '' +3
- StrCpy $0 CHANGED
- goto close
- StrCpy $0 DELETED
- goto close
-
- add:
- StrCmp${_TEXTFUNC_S} $2 '' 0 +3
- StrCpy $0 SAME
- goto close
- FileSeek $3 -1 END
- FileRead $3 $4
- IfErrors +4
- StrCmp${_TEXTFUNC_S} $4 '$\r' +3
- StrCmp${_TEXTFUNC_S} $4 '$\n' +2
- FileWrite $3 '$\r$\n'
- FileWrite $3 '$1$2$\r$\n'
- StrCpy $0 ADDED
-
- close:
- FileClose $3
- goto end
-
- error:
- SetErrors
- StrCpy $0 ''
-
- end:
- Pop $6
- Pop $5
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Exch $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro FileRecode
- !ifndef ${_TEXTFUNC_UN}FileRecode
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- !define ${_TEXTFUNC_UN}FileRecode `!insertmacro ${_TEXTFUNC_UN}FileRecodeCall`
-
- Function ${_TEXTFUNC_UN}FileRecode
- Exch $1
- Exch
- Exch $0
- Exch
- Push $2
- Push $3
- Push $4
-
- IfFileExists $0 0 error
- StrCmp $1 OemToChar +2
- StrCmp $1 CharToOem 0 error
-
- FileOpen $2 $0 a
- FileSeek $2 0 END $3
- System::Alloc /NOUNLOAD $3
- Pop $4
- FileSeek $2 0 SET
- System::Call /NOUNLOAD 'kernel32::ReadFile(i r2, i r4, i $3, t.,)'
- System::Call /NOUNLOAD 'user32::$1Buff(i r4, i r4, i $3)'
- FileSeek $2 0 SET
- System::Call /NOUNLOAD 'kernel32::WriteFile(i r2, i r4, i $3, t.,)'
- System::Free $4
- FileClose $2
- goto end
-
- error:
- SetErrors
-
- end:
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Pop $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro TrimNewLines
- !ifndef ${_TEXTFUNC_UN}TrimNewLines
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- !define ${_TEXTFUNC_UN}TrimNewLines `!insertmacro ${_TEXTFUNC_UN}TrimNewLinesCall`
-
- Function ${_TEXTFUNC_UN}TrimNewLines
- Exch $0
- Push $1
- Push $2
-
- StrCpy $1 0
- IntOp $1 $1 - 1
- StrCpy $2 $0 1 $1
- StrCmp $2 '$\r' -2
- StrCmp $2 '$\n' -3
- StrCmp $1 -1 +3
- IntOp $1 $1 + 1
- StrCpy $0 $0 $1
-
- Pop $2
- Pop $1
- Exch $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-
-# Uninstall. Case insensitive. #
-
-!macro un.LineFindCall _INPUT _OUTPUT _RANGE _FUNC
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- Push $0
- Push `${_INPUT}`
- Push `${_OUTPUT}`
- Push `${_RANGE}`
- GetFunctionAddress $0 `${_FUNC}`
- Push `$0`
- Call un.LineFind
- Pop $0
- !verbose pop
-!macroend
-
-!macro un.LineReadCall _FILE _NUMBER _RESULT
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- Push `${_FILE}`
- Push `${_NUMBER}`
- Call un.LineRead
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.FileReadFromEndCall _FILE _FUNC
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- Push $0
- Push `${_FILE}`
- GetFunctionAddress $0 `${_FUNC}`
- Push `$0`
- Call un.FileReadFromEnd
- Pop $0
- !verbose pop
-!macroend
-
-!macro un.LineSumCall _FILE _RESULT
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- Push `${_FILE}`
- Call un.LineSum
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.FileJoinCall _FILE1 _FILE2 _FILE3
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- Push `${_FILE1}`
- Push `${_FILE2}`
- Push `${_FILE3}`
- Call un.FileJoin
- !verbose pop
-!macroend
-
-!macro un.TextCompareCall _FILE1 _FILE2 _OPTION _FUNC
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- Push $0
- Push `${_FILE1}`
- Push `${_FILE2}`
- Push `${_OPTION}`
- GetFunctionAddress $0 `${_FUNC}`
- Push `$0`
- Call un.TextCompare
- Pop $0
- !verbose pop
-!macroend
-
-!macro un.ConfigReadCall _FILE _ENTRY _RESULT
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- Push `${_FILE}`
- Push `${_ENTRY}`
- Call un.ConfigRead
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.ConfigWriteCall _FILE _ENTRY _VALUE _RESULT
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- Push `${_FILE}`
- Push `${_ENTRY}`
- Push `${_VALUE}`
- Call un.ConfigWrite
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.FileRecodeCall _FILE _FORMAT
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- Push `${_FILE}`
- Push `${_FORMAT}`
- Call un.FileRecode
- !verbose pop
-!macroend
-
-!macro un.TrimNewLinesCall _FILE _RESULT
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- Push `${_FILE}`
- Call un.TrimNewLines
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.LineFind
- !ifndef un.LineFind
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- !undef _TEXTFUNC_UN
- !define _TEXTFUNC_UN `un.`
-
- !insertmacro LineFind
-
- !undef _TEXTFUNC_UN
- !define _TEXTFUNC_UN
- !verbose pop
- !endif
-!macroend
-
-!macro un.LineRead
- !ifndef un.LineRead
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- !undef _TEXTFUNC_UN
- !define _TEXTFUNC_UN `un.`
-
- !insertmacro LineRead
-
- !undef _TEXTFUNC_UN
- !define _TEXTFUNC_UN
- !verbose pop
- !endif
-!macroend
-
-!macro un.FileReadFromEnd
- !ifndef un.FileReadFromEnd
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- !undef _TEXTFUNC_UN
- !define _TEXTFUNC_UN `un.`
-
- !insertmacro FileReadFromEnd
-
- !undef _TEXTFUNC_UN
- !define _TEXTFUNC_UN
- !verbose pop
- !endif
-!macroend
-
-!macro un.LineSum
- !ifndef un.LineSum
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- !undef _TEXTFUNC_UN
- !define _TEXTFUNC_UN `un.`
-
- !insertmacro LineSum
-
- !undef _TEXTFUNC_UN
- !define _TEXTFUNC_UN
- !verbose pop
- !endif
-!macroend
-
-!macro un.FileJoin
- !ifndef un.FileJoin
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- !undef _TEXTFUNC_UN
- !define _TEXTFUNC_UN `un.`
-
- !insertmacro FileJoin
-
- !undef _TEXTFUNC_UN
- !define _TEXTFUNC_UN
- !verbose pop
- !endif
-!macroend
-
-!macro un.TextCompare
- !ifndef un.TextCompare
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- !undef _TEXTFUNC_UN
- !define _TEXTFUNC_UN `un.`
-
- !insertmacro TextCompare
-
- !undef _TEXTFUNC_UN
- !define _TEXTFUNC_UN
- !verbose pop
- !endif
-!macroend
-
-!macro un.ConfigRead
- !ifndef un.ConfigRead
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- !undef _TEXTFUNC_UN
- !define _TEXTFUNC_UN `un.`
-
- !insertmacro ConfigRead
-
- !undef _TEXTFUNC_UN
- !define _TEXTFUNC_UN
- !verbose pop
- !endif
-!macroend
-
-!macro un.ConfigWrite
- !ifndef un.ConfigWrite
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- !undef _TEXTFUNC_UN
- !define _TEXTFUNC_UN `un.`
-
- !insertmacro ConfigWrite
-
- !undef _TEXTFUNC_UN
- !define _TEXTFUNC_UN
- !verbose pop
- !endif
-!macroend
-
-!macro un.FileRecode
- !ifndef un.FileRecode
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- !undef _TEXTFUNC_UN
- !define _TEXTFUNC_UN `un.`
-
- !insertmacro FileRecode
-
- !undef _TEXTFUNC_UN
- !define _TEXTFUNC_UN
- !verbose pop
- !endif
-!macroend
-
-!macro un.TrimNewLines
- !ifndef un.TrimNewLines
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- !undef _TEXTFUNC_UN
- !define _TEXTFUNC_UN `un.`
-
- !insertmacro TrimNewLines
-
- !undef _TEXTFUNC_UN
- !define _TEXTFUNC_UN
- !verbose pop
- !endif
-!macroend
-
-
-# Install. Case sensitive. #
-
!macro TextCompareSCall _FILE1 _FILE2 _OPTION _FUNC
!verbose push
!verbose ${_TEXTFUNC_VERBOSE}
@@ -1335,17 +154,38 @@ TrimNewLines
Push `${_OPTION}`
GetFunctionAddress $0 `${_FUNC}`
Push `$0`
- Call TextCompareS
+ ${CallArtificialFunction} TextCompareS_
Pop $0
!verbose pop
!macroend
+!macro ConfigReadCall _FILE _ENTRY _RESULT
+ !verbose push
+ !verbose ${_TEXTFUNC_VERBOSE}
+ Push `${_FILE}`
+ Push `${_ENTRY}`
+ ${CallArtificialFunction} ConfigRead_
+ Pop ${_RESULT}
+ !verbose pop
+!macroend
+
!macro ConfigReadSCall _FILE _ENTRY _RESULT
!verbose push
!verbose ${_TEXTFUNC_VERBOSE}
Push `${_FILE}`
Push `${_ENTRY}`
- Call ConfigReadS
+ ${CallArtificialFunction} ConfigReadS_
+ Pop ${_RESULT}
+ !verbose pop
+!macroend
+
+!macro ConfigWriteCall _FILE _ENTRY _VALUE _RESULT
+ !verbose push
+ !verbose ${_TEXTFUNC_VERBOSE}
+ Push `${_FILE}`
+ Push `${_ENTRY}`
+ Push `${_VALUE}`
+ ${CallArtificialFunction} ConfigWrite_
Pop ${_RESULT}
!verbose pop
!macroend
@@ -1356,149 +196,1019 @@ TrimNewLines
Push `${_FILE}`
Push `${_ENTRY}`
Push `${_VALUE}`
- Call ConfigWriteS
+ ${CallArtificialFunction} ConfigWriteS_
Pop ${_RESULT}
!verbose pop
!macroend
+!macro FileRecodeCall _FILE _FORMAT
+ !verbose push
+ !verbose ${_TEXTFUNC_VERBOSE}
+ Push `${_FILE}`
+ Push `${_FORMAT}`
+ ${CallArtificialFunction} FileRecode_
+ !verbose pop
+!macroend
+
+!macro TrimNewLinesCall _FILE _RESULT
+ !verbose push
+ !verbose ${_TEXTFUNC_VERBOSE}
+ Push `${_FILE}`
+ ${CallArtificialFunction} TrimNewLines_
+ Pop ${_RESULT}
+ !verbose pop
+!macroend
+
+!macro _TextFunc_TempFileForFile _FILE _RESULT
+ # XXX replace with GetParent
+ Push `${_FILE}`
+ Exch $0
+ Push $1
+ Push $2
+
+ StrCpy $2 $0 1 -1
+ StrCmp $2 '\' 0 +3
+ StrCpy $0 $0 -1
+ goto -3
+
+ StrCpy $1 0
+ IntOp $1 $1 - 1
+ StrCpy $2 $0 1 $1
+ StrCmp $2 '\' +2
+ StrCmp $2 '' 0 -3
+ StrCpy $0 $0 $1
+
+ Pop $2
+ Pop $1
+ Exch $0
+ Pop ${_RESULT}
+ # XXX
+ StrCmp ${_RESULT} "" 0 +2
+ StrCpy ${_RESULT} $EXEDIR
+ GetTempFileName ${_RESULT} ${_RESULT}
+ StrCmp ${_RESULT} "" 0 +2
+ GetTempFileName ${_RESULT}
+ ClearErrors
+!macroend
+
+!define LineFind `!insertmacro LineFindCall`
+!define un.LineFind `!insertmacro LineFindCall`
+
+!macro LineFind
+!macroend
+
+!macro un.LineFind
+!macroend
+
+!macro LineFind_
+ !verbose push
+ !verbose ${_TEXTFUNC_VERBOSE}
+
+ Exch $3
+ Exch
+ Exch $2
+ Exch
+ Exch 2
+ Exch $1
+ Exch 2
+ Exch 3
+ Exch $0
+ Exch 3
+ Push $4
+ Push $5
+ Push $6
+ Push $7
+ Push $8
+ Push $9
+ Push $R4
+ Push $R5
+ Push $R6
+ Push $R7
+ Push $R8
+ Push $R9
+ ClearErrors
+
+ IfFileExists '$0' 0 TextFunc_LineFind_error
+ StrCmp $1 '/NUL' TextFunc_LineFind_begin
+ StrCpy $8 0
+ IntOp $8 $8 - 1
+ StrCpy $9 $1 1 $8
+ StrCmp $9 \ +2
+ StrCmp $9 '' +3 -3
+ StrCpy $9 $1 $8
+ IfFileExists '$9\*.*' 0 TextFunc_LineFind_error
+
+ TextFunc_LineFind_begin:
+ StrCpy $4 1
+ StrCpy $5 -1
+ StrCpy $6 0
+ StrCpy $7 0
+ StrCpy $R4 ''
+ StrCpy $R6 ''
+ StrCpy $R7 ''
+ StrCpy $R8 0
+
+ StrCpy $8 $2 1
+ StrCmp $8 '{' 0 TextFunc_LineFind_delspaces
+ StrCpy $2 $2 '' 1
+ StrCpy $8 $2 1 -1
+ StrCmp $8 '}' 0 TextFunc_LineFind_delspaces
+ StrCpy $2 $2 -1
+ StrCpy $R6 TextFunc_LineFind_cut
+
+ TextFunc_LineFind_delspaces:
+ StrCpy $8 $2 1
+ StrCmp $8 ' ' 0 +3
+ StrCpy $2 $2 '' 1
+ goto -3
+ StrCmp $2$7 '0' TextFunc_LineFind_file
+ StrCpy $4 ''
+ StrCpy $5 ''
+ StrCmp $2 '' TextFunc_LineFind_writechk
+
+ TextFunc_LineFind_range:
+ StrCpy $8 0
+ StrCpy $9 $2 1 $8
+ StrCmp $9 '' +5
+ StrCmp $9 ' ' +4
+ StrCmp $9 ':' +3
+ IntOp $8 $8 + 1
+ goto -5
+ StrCpy $5 $2 $8
+ IntOp $5 $5 + 0
+ IntOp $8 $8 + 1
+ StrCpy $2 $2 '' $8
+ StrCmp $4 '' 0 +2
+ StrCpy $4 $5
+ StrCmp $9 ':' TextFunc_LineFind_range
+
+ IntCmp $4 0 0 +2
+ IntCmp $5 -1 TextFunc_LineFind_goto 0 TextFunc_LineFind_growthcmp
+ StrCmp $R7 '' 0 TextFunc_LineFind_minus2plus
+ StrCpy $R7 0
+ FileOpen $8 $0 r
+ FileRead $8 $9
+ IfErrors +3
+ IntOp $R7 $R7 + 1
+ Goto -3
+ FileClose $8
+
+ TextFunc_LineFind_minus2plus:
+ IntCmp $4 0 +5 0 +5
+ IntOp $4 $R7 + $4
+ IntOp $4 $4 + 1
+ IntCmp $4 0 +2 0 +2
+ StrCpy $4 0
+ IntCmp $5 -1 TextFunc_LineFind_goto 0 TextFunc_LineFind_growthcmp
+ IntOp $5 $R7 + $5
+ IntOp $5 $5 + 1
+ TextFunc_LineFind_growthcmp:
+ IntCmp $4 $5 TextFunc_LineFind_goto TextFunc_LineFind_goto
+ StrCpy $5 $4
+ TextFunc_LineFind_goto:
+ goto $7
+
+ TextFunc_LineFind_file:
+ StrCmp $1 '/NUL' TextFunc_LineFind_notemp
+ !insertmacro _TextFunc_TempFileForFile $1 $R4
+ Push $R4
+ FileOpen $R4 $R4 w
+ TextFunc_LineFind_notemp:
+ FileOpen $R5 $0 r
+ IfErrors TextFunc_LineFind_preerror
+
+ TextFunc_LineFind_loop:
+ IntOp $R8 $R8 + 1
+ FileRead $R5 $R9
+ IfErrors TextFunc_LineFind_handleclose
+
+ TextFunc_LineFind_cmp:
+ StrCmp $2$4$5 '' TextFunc_LineFind_writechk
+ IntCmp $4 $R8 TextFunc_LineFind_call 0 TextFunc_LineFind_writechk
+ StrCmp $5 -1 TextFunc_LineFind_call
+ IntCmp $5 $R8 TextFunc_LineFind_call 0 TextFunc_LineFind_call
+
+ GetLabelAddress $7 TextFunc_LineFind_cmp
+ goto TextFunc_LineFind_delspaces
+
+ TextFunc_LineFind_call:
+ StrCpy $7 $R9
+ Push $0
+ Push $1
+ Push $2
+ Push $3
+ Push $4
+ Push $5
+ Push $6
+ Push $7
+ Push $R4
+ Push $R5
+ Push $R6
+ Push $R7
+ Push $R8
+ StrCpy $R6 '$4:$5'
+ StrCmp $R7 '' +3
+ IntOp $R7 $R8 - $R7
+ IntOp $R7 $R7 - 1
+ Call $3
+ Pop $9
+ Pop $R8
+ Pop $R7
+ Pop $R6
+ Pop $R5
+ Pop $R4
+ Pop $7
+ Pop $6
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Pop $0
+ IfErrors TextFunc_LineFind_preerror
+ StrCmp $9 'StopLineFind' 0 +3
+ IntOp $6 $6 + 1
+ goto TextFunc_LineFind_handleclose
+ StrCmp $1 '/NUL' TextFunc_LineFind_loop
+ StrCmp $9 'SkipWrite' 0 +3
+ IntOp $6 $6 + 1
+ goto TextFunc_LineFind_loop
+ StrCmp $7 $R9 TextFunc_LineFind_write
+ IntOp $6 $6 + 1
+ goto TextFunc_LineFind_write
+
+ TextFunc_LineFind_writechk:
+ StrCmp $1 '/NUL' TextFunc_LineFind_loop
+ StrCmp $R6 TextFunc_LineFind_cut 0 TextFunc_LineFind_write
+ IntOp $6 $6 + 1
+ goto TextFunc_LineFind_loop
+
+ TextFunc_LineFind_write:
+ FileWrite $R4 $R9
+ goto TextFunc_LineFind_loop
+
+ TextFunc_LineFind_preerror:
+ SetErrors
+
+ TextFunc_LineFind_handleclose:
+ StrCmp $1 '/NUL' +3
+ FileClose $R4
+ Pop $R4
+ FileClose $R5
+ IfErrors TextFunc_LineFind_error
+
+ StrCmp $1 '/NUL' TextFunc_LineFind_end
+ StrCmp $1 '' 0 +2
+ StrCpy $1 $0
+ StrCmp $6 0 0 TextFunc_LineFind_rename
+ FileOpen $7 $0 r
+ FileSeek $7 0 END $8
+ FileClose $7
+ FileOpen $7 $R4 r
+ FileSeek $7 0 END $9
+ FileClose $7
+ IntCmp $8 $9 0 TextFunc_LineFind_rename
+ Delete $R4
+ StrCmp $1 $0 TextFunc_LineFind_end
+ CopyFiles /SILENT $0 $1
+ goto TextFunc_LineFind_end
+
+ TextFunc_LineFind_rename:
+ Delete '$EXEDIR\$1'
+ Rename $R4 '$EXEDIR\$1'
+ IfErrors 0 TextFunc_LineFind_end
+ Delete $1
+ Rename $R4 $1
+ IfErrors 0 TextFunc_LineFind_end
+
+ TextFunc_LineFind_error:
+ SetErrors
+
+ TextFunc_LineFind_end:
+ Pop $R9
+ Pop $R8
+ Pop $R7
+ Pop $R6
+ Pop $R5
+ Pop $R4
+ Pop $9
+ Pop $8
+ Pop $7
+ Pop $6
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Pop $0
+
+ !verbose pop
+!macroend
+
+!define LineRead `!insertmacro LineReadCall`
+!define un.LineRead `!insertmacro LineReadCall`
+
+!macro LineRead
+!macroend
+
+!macro un.LineRead
+!macroend
+
+!macro LineRead_
+ !verbose push
+ !verbose ${_TEXTFUNC_VERBOSE}
+
+ Exch $1
+ Exch
+ Exch $0
+ Exch
+ Push $2
+ Push $3
+ Push $4
+ ClearErrors
+
+ IfFileExists $0 0 TextFunc_LineRead_error
+ IntOp $1 $1 + 0
+ IntCmp $1 0 TextFunc_LineRead_error 0 TextFunc_LineRead_plus
+ StrCpy $4 0
+ FileOpen $2 $0 r
+ IfErrors TextFunc_LineRead_error
+ FileRead $2 $3
+ IfErrors +3
+ IntOp $4 $4 + 1
+ Goto -3
+ FileClose $2
+ IntOp $1 $4 + $1
+ IntOp $1 $1 + 1
+ IntCmp $1 0 TextFunc_LineRead_error TextFunc_LineRead_error
+
+ TextFunc_LineRead_plus:
+ FileOpen $2 $0 r
+ IfErrors TextFunc_LineRead_error
+ StrCpy $3 0
+ IntOp $3 $3 + 1
+ FileRead $2 $0
+ IfErrors +4
+ StrCmp $3 $1 0 -3
+ FileClose $2
+ goto TextFunc_LineRead_end
+ FileClose $2
+
+ TextFunc_LineRead_error:
+ SetErrors
+ StrCpy $0 ''
+
+ TextFunc_LineRead_end:
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Exch $0
+
+ !verbose pop
+!macroend
+
+!define FileReadFromEnd `!insertmacro FileReadFromEndCall`
+!define un.FileReadFromEnd `!insertmacro FileReadFromEndCall`
+
+!macro FileReadFromEnd
+!macroend
+
+!macro un.FileReadFromEnd
+!macroend
+
+!macro FileReadFromEnd_
+ !verbose push
+ !verbose ${_TEXTFUNC_VERBOSE}
+
+ Exch $1
+ Exch
+ Exch $0
+ Exch
+ Push $7
+ Push $8
+ Push $9
+ ClearErrors
+
+ StrCpy $7 -1
+ StrCpy $8 0
+ IfFileExists $0 0 TextFunc_FileReadFromEnd_error
+ FileOpen $0 $0 r
+ IfErrors TextFunc_FileReadFromEnd_error
+ FileRead $0 $9
+ IfErrors +4
+ Push $9
+ IntOp $8 $8 + 1
+ goto -4
+ FileClose $0
+
+ TextFunc_FileReadFromEnd_nextline:
+ StrCmp $8 0 TextFunc_FileReadFromEnd_end
+ Pop $9
+ Push $1
+ Push $7
+ Push $8
+ Call $1
+ Pop $0
+ Pop $8
+ Pop $7
+ Pop $1
+ IntOp $7 $7 - 1
+ IntOp $8 $8 - 1
+ IfErrors TextFunc_FileReadFromEnd_error
+ StrCmp $0 'StopFileReadFromEnd' TextFunc_FileReadFromEnd_clearstack TextFunc_FileReadFromEnd_nextline
+
+ TextFunc_FileReadFromEnd_error:
+ SetErrors
+
+ TextFunc_FileReadFromEnd_clearstack:
+ StrCmp $8 0 TextFunc_FileReadFromEnd_end
+ Pop $9
+ IntOp $8 $8 - 1
+ goto TextFunc_FileReadFromEnd_clearstack
+
+ TextFunc_FileReadFromEnd_end:
+ Pop $9
+ Pop $8
+ Pop $7
+ Pop $1
+ Pop $0
+
+ !verbose pop
+!macroend
+
+!define LineSum `!insertmacro LineSumCall`
+!define un.LineSum `!insertmacro LineSumCall`
+
+!macro LineSum
+!macroend
+
+!macro un.LineSum
+!macroend
+
+!macro LineSum_
+ !verbose push
+ !verbose ${_TEXTFUNC_VERBOSE}
+
+ Exch $0
+ Push $1
+ Push $2
+ ClearErrors
+
+ IfFileExists $0 0 TextFunc_LineSum_error
+ StrCpy $2 0
+ FileOpen $0 $0 r
+ IfErrors TextFunc_LineSum_error
+ FileRead $0 $1
+ IfErrors +3
+ IntOp $2 $2 + 1
+ Goto -3
+ FileClose $0
+ StrCpy $0 $2
+ goto TextFunc_LineSum_end
+
+ TextFunc_LineSum_error:
+ SetErrors
+ StrCpy $0 ''
+
+ TextFunc_LineSum_end:
+ Pop $2
+ Pop $1
+ Exch $0
+
+ !verbose pop
+!macroend
+
+!define FileJoin `!insertmacro FileJoinCall`
+!define un.FileJoin `!insertmacro FileJoinCall`
+
+!macro FileJoin
+!macroend
+
+!macro un.FileJoin
+!macroend
+
+!macro FileJoin_
+ !verbose push
+ !verbose ${_TEXTFUNC_VERBOSE}
+
+ Exch $2
+ Exch
+ Exch $1
+ Exch
+ Exch 2
+ Exch $0
+ Exch 2
+ Push $3
+ Push $4
+ Push $5
+ ClearErrors
+
+ IfFileExists $0 0 TextFunc_FileJoin_error
+ IfFileExists $1 0 TextFunc_FileJoin_error
+ StrCpy $3 0
+ IntOp $3 $3 - 1
+ StrCpy $4 $2 1 $3
+ StrCmp $4 \ +2
+ StrCmp $4 '' +3 -3
+ StrCpy $4 $2 $3
+ IfFileExists '$4\*.*' 0 TextFunc_FileJoin_error
+
+ StrCmp $2 $0 0 +2
+ StrCpy $2 ''
+ StrCmp $2 '' 0 +3
+ StrCpy $4 $0
+ Goto TextFunc_FileJoin_notemp
+ !insertmacro _TextFunc_TempFileForFile $2 $4
+ CopyFiles /SILENT $0 $4
+ TextFunc_FileJoin_notemp:
+ FileOpen $3 $4 a
+ IfErrors TextFunc_FileJoin_error
+ FileSeek $3 -1 END
+ FileRead $3 $5
+ StrCmp $5 '$\r' +3
+ StrCmp $5 '$\n' +2
+ FileWrite $3 '$\r$\n'
+
+ ;FileWrite $3 '$\r$\n--Divider--$\r$\n'
+
+ FileOpen $0 $1 r
+ IfErrors TextFunc_FileJoin_error
+ FileRead $0 $5
+ IfErrors +3
+ FileWrite $3 $5
+ goto -3
+ FileClose $0
+ FileClose $3
+ StrCmp $2 '' TextFunc_FileJoin_end
+ Delete '$EXEDIR\$2'
+ Rename $4 '$EXEDIR\$2'
+ IfErrors 0 TextFunc_FileJoin_end
+ Delete $2
+ Rename $4 $2
+ IfErrors 0 TextFunc_FileJoin_end
+
+ TextFunc_FileJoin_error:
+ SetErrors
+
+ TextFunc_FileJoin_end:
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Pop $0
+
+ !verbose pop
+!macroend
+
+!macro TextCompareBody _TEXTFUNC_S
+ Exch $3
+ Exch
+ Exch $2
+ Exch
+ Exch 2
+ Exch $1
+ Exch 2
+ Exch 3
+ Exch $0
+ Exch 3
+ Push $4
+ Push $5
+ Push $6
+ Push $7
+ Push $8
+ Push $9
+ ClearErrors
+
+ IfFileExists $0 0 TextFunc_TextCompare${_TEXTFUNC_S}_error
+ IfFileExists $1 0 TextFunc_TextCompare${_TEXTFUNC_S}_error
+ StrCmp $2 'FastDiff' +5
+ StrCmp $2 'FastEqual' +4
+ StrCmp $2 'SlowDiff' +3
+ StrCmp $2 'SlowEqual' +2
+ goto TextFunc_TextCompare${_TEXTFUNC_S}_error
+
+ FileOpen $4 $0 r
+ IfErrors TextFunc_TextCompare${_TEXTFUNC_S}_error
+ FileOpen $5 $1 r
+ IfErrors TextFunc_TextCompare${_TEXTFUNC_S}_error
+ SetDetailsPrint textonly
+
+ StrCpy $6 0
+ StrCpy $8 0
+
+ TextFunc_TextCompare${_TEXTFUNC_S}_nextline:
+ StrCmp${_TEXTFUNC_S} $4 '' TextFunc_TextCompare${_TEXTFUNC_S}_fast
+ IntOp $8 $8 + 1
+ FileRead $4 $9
+ IfErrors 0 +4
+ FileClose $4
+ StrCpy $4 ''
+ StrCmp${_TEXTFUNC_S} $5 '' TextFunc_TextCompare${_TEXTFUNC_S}_end
+ StrCmp $2 'FastDiff' TextFunc_TextCompare${_TEXTFUNC_S}_fast
+ StrCmp $2 'FastEqual' TextFunc_TextCompare${_TEXTFUNC_S}_fast TextFunc_TextCompare${_TEXTFUNC_S}_slow
+
+ TextFunc_TextCompare${_TEXTFUNC_S}_fast:
+ StrCmp${_TEXTFUNC_S} $5 '' TextFunc_TextCompare${_TEXTFUNC_S}_call
+ IntOp $6 $6 + 1
+ FileRead $5 $7
+ IfErrors 0 +5
+ FileClose $5
+ StrCpy $5 ''
+ StrCmp${_TEXTFUNC_S} $4 '' TextFunc_TextCompare${_TEXTFUNC_S}_end
+ StrCmp $2 'FastDiff' TextFunc_TextCompare${_TEXTFUNC_S}_call TextFunc_TextCompare${_TEXTFUNC_S}_close
+ StrCmp $2 'FastDiff' 0 +2
+ StrCmp${_TEXTFUNC_S} $7 $9 TextFunc_TextCompare${_TEXTFUNC_S}_nextline TextFunc_TextCompare${_TEXTFUNC_S}_call
+ StrCmp${_TEXTFUNC_S} $7 $9 TextFunc_TextCompare${_TEXTFUNC_S}_call TextFunc_TextCompare${_TEXTFUNC_S}_nextline
+
+ TextFunc_TextCompare${_TEXTFUNC_S}_slow:
+ StrCmp${_TEXTFUNC_S} $4 '' TextFunc_TextCompare${_TEXTFUNC_S}_close
+ StrCpy $6 ''
+ DetailPrint '$8. $9'
+ FileSeek $5 0
+
+ TextFunc_TextCompare${_TEXTFUNC_S}_slownext:
+ FileRead $5 $7
+ IfErrors 0 +2
+ StrCmp $2 'SlowDiff' TextFunc_TextCompare${_TEXTFUNC_S}_call TextFunc_TextCompare${_TEXTFUNC_S}_nextline
+ StrCmp $2 'SlowDiff' 0 +2
+ StrCmp${_TEXTFUNC_S} $7 $9 TextFunc_TextCompare${_TEXTFUNC_S}_nextline TextFunc_TextCompare${_TEXTFUNC_S}_slownext
+ IntOp $6 $6 + 1
+ StrCmp${_TEXTFUNC_S} $7 $9 0 TextFunc_TextCompare${_TEXTFUNC_S}_slownext
+
+ TextFunc_TextCompare${_TEXTFUNC_S}_call:
+ Push $2
+ Push $3
+ Push $4
+ Push $5
+ Push $6
+ Push $7
+ Push $8
+ Push $9
+ Call $3
+ Pop $0
+ Pop $9
+ Pop $8
+ Pop $7
+ Pop $6
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ StrCmp $0 'StopTextCompare' 0 TextFunc_TextCompare${_TEXTFUNC_S}_nextline
+
+ TextFunc_TextCompare${_TEXTFUNC_S}_close:
+ FileClose $4
+ FileClose $5
+ goto TextFunc_TextCompare${_TEXTFUNC_S}_end
+
+ TextFunc_TextCompare${_TEXTFUNC_S}_error:
+ SetErrors
+
+ TextFunc_TextCompare${_TEXTFUNC_S}_end:
+ SetDetailsPrint both
+ Pop $9
+ Pop $8
+ Pop $7
+ Pop $6
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Pop $0
+!macroend
+
+!define TextCompare `!insertmacro TextCompareCall`
+!define un.TextCompare `!insertmacro TextCompareCall`
+
+!macro TextCompare
+!macroend
+
+!macro un.TextCompare
+!macroend
+
+!macro TextCompare_
+ !verbose push
+ !verbose ${_TEXTFUNC_VERBOSE}
+
+ !insertmacro TextCompareBody ''
+
+ !verbose pop
+!macroend
+
+!define TextCompareS `!insertmacro TextCompareSCall`
+!define un.TextCompareS `!insertmacro TextCompareSCall`
+
!macro TextCompareS
- !ifndef TextCompareS
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- !undef _TEXTFUNC_S
- !define _TEXTFUNC_S `S`
-
- !insertmacro TextCompare
-
- !undef _TEXTFUNC_S
- !define _TEXTFUNC_S
- !verbose pop
- !endif
-!macroend
-
-!macro ConfigReadS
- !ifndef ConfigReadS
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- !undef _TEXTFUNC_S
- !define _TEXTFUNC_S `S`
-
- !insertmacro ConfigRead
-
- !undef _TEXTFUNC_S
- !define _TEXTFUNC_S
- !verbose pop
- !endif
-!macroend
-
-!macro ConfigWriteS
- !ifndef ConfigWriteS
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- !undef _TEXTFUNC_S
- !define _TEXTFUNC_S `S`
-
- !insertmacro ConfigWrite
-
- !undef _TEXTFUNC_S
- !define _TEXTFUNC_S
- !verbose pop
- !endif
-!macroend
-
-
-# Uninstall. Case sensitive. #
-
-!macro un.TextCompareSCall _FILE1 _FILE2 _OPTION _FUNC
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- Push $0
- Push `${_FILE1}`
- Push `${_FILE2}`
- Push `${_OPTION}`
- GetFunctionAddress $0 `${_FUNC}`
- Push `$0`
- Call un.TextCompareS
- Pop $0
- !verbose pop
-!macroend
-
-!macro un.ConfigReadSCall _FILE _ENTRY _RESULT
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- Push `${_FILE}`
- Push `${_ENTRY}`
- Call un.ConfigReadS
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.ConfigWriteSCall _FILE _ENTRY _VALUE _RESULT
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- Push `${_FILE}`
- Push `${_ENTRY}`
- Push `${_VALUE}`
- Call un.ConfigWriteS
- Pop ${_RESULT}
- !verbose pop
!macroend
!macro un.TextCompareS
- !ifndef un.TextCompareS
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- !undef _TEXTFUNC_UN
- !define _TEXTFUNC_UN `un.`
- !undef _TEXTFUNC_S
- !define _TEXTFUNC_S `S`
+!macroend
- !insertmacro TextCompare
+!macro TextCompareS_
+ !verbose push
+ !verbose ${_TEXTFUNC_VERBOSE}
- !undef _TEXTFUNC_UN
- !define _TEXTFUNC_UN
- !undef _TEXTFUNC_S
- !define _TEXTFUNC_S
- !verbose pop
- !endif
+ !insertmacro TextCompareBody 'S'
+
+ !verbose pop
+!macroend
+
+!macro ConfigReadBody _TEXTFUNC_S
+ Exch $1
+ Exch
+ Exch $0
+ Exch
+ Push $2
+ Push $3
+ Push $4
+ ClearErrors
+
+ FileOpen $2 $0 r
+ IfErrors TextFunc_ConfigRead${_TEXTFUNC_S}_error
+ StrLen $0 $1
+ StrCmp${_TEXTFUNC_S} $0 0 TextFunc_ConfigRead${_TEXTFUNC_S}_error
+
+ TextFunc_ConfigRead${_TEXTFUNC_S}_readnext:
+ FileRead $2 $3
+ IfErrors TextFunc_ConfigRead${_TEXTFUNC_S}_error
+ StrCpy $4 $3 $0
+ StrCmp${_TEXTFUNC_S} $4 $1 0 TextFunc_ConfigRead${_TEXTFUNC_S}_readnext
+ StrCpy $0 $3 '' $0
+ StrCpy $4 $0 1 -1
+ StrCmp${_TEXTFUNC_S} $4 '$\r' +2
+ StrCmp${_TEXTFUNC_S} $4 '$\n' 0 TextFunc_ConfigRead${_TEXTFUNC_S}_close
+ StrCpy $0 $0 -1
+ goto -4
+
+ TextFunc_ConfigRead${_TEXTFUNC_S}_error:
+ SetErrors
+ StrCpy $0 ''
+
+ TextFunc_ConfigRead${_TEXTFUNC_S}_close:
+ FileClose $2
+
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Exch $0
+!macroend
+
+!define ConfigRead `!insertmacro ConfigReadCall`
+!define un.ConfigRead `!insertmacro ConfigReadCall`
+
+!macro ConfigRead
+!macroend
+
+!macro un.ConfigRead
+!macroend
+
+!macro ConfigRead_
+ !verbose push
+ !verbose ${_TEXTFUNC_VERBOSE}
+
+ !insertmacro ConfigReadBody ''
+
+ !verbose pop
+!macroend
+
+!define ConfigReadS `!insertmacro ConfigReadSCall`
+!define un.ConfigReadS `!insertmacro ConfigReadSCall`
+
+!macro ConfigReadS
!macroend
!macro un.ConfigReadS
- !ifndef un.ConfigReadS
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- !undef _TEXTFUNC_UN
- !define _TEXTFUNC_UN `un.`
- !undef _TEXTFUNC_S
- !define _TEXTFUNC_S `S`
+!macroend
- !insertmacro ConfigRead
+!macro ConfigReadS_
+ !verbose push
+ !verbose ${_TEXTFUNC_VERBOSE}
- !undef _TEXTFUNC_UN
- !define _TEXTFUNC_UN
- !undef _TEXTFUNC_S
- !define _TEXTFUNC_S
- !verbose pop
- !endif
+ !insertmacro ConfigReadBody 'S'
+
+ !verbose pop
+!macroend
+
+!macro ConfigWriteBody _TEXTFUNC_S
+ Exch $2
+ Exch
+ Exch $1
+ Exch
+ Exch 2
+ Exch $0
+ Exch 2
+ Push $3
+ Push $4
+ Push $5
+ Push $6
+ ClearErrors
+
+ IfFileExists $0 0 TextFunc_ConfigWrite${_TEXTFUNC_S}_error
+ FileOpen $3 $0 a
+ IfErrors TextFunc_ConfigWrite${_TEXTFUNC_S}_error
+
+ StrLen $0 $1
+ StrCmp${_TEXTFUNC_S} $0 0 0 TextFunc_ConfigWrite${_TEXTFUNC_S}_readnext
+ StrCpy $0 ''
+ goto TextFunc_ConfigWrite${_TEXTFUNC_S}_close
+
+ TextFunc_ConfigWrite${_TEXTFUNC_S}_readnext:
+ FileRead $3 $4
+ IfErrors TextFunc_ConfigWrite${_TEXTFUNC_S}_add
+ StrCpy $5 $4 $0
+ StrCmp${_TEXTFUNC_S} $5 $1 0 TextFunc_ConfigWrite${_TEXTFUNC_S}_readnext
+
+ StrCpy $5 0
+ IntOp $5 $5 - 1
+ StrCpy $6 $4 1 $5
+ StrCmp${_TEXTFUNC_S} $6 '$\r' -2
+ StrCmp${_TEXTFUNC_S} $6 '$\n' -3
+ StrCpy $6 $4
+ StrCmp${_TEXTFUNC_S} $5 -1 +3
+ IntOp $5 $5 + 1
+ StrCpy $6 $4 $5
+
+ StrCmp${_TEXTFUNC_S} $2 '' TextFunc_ConfigWrite${_TEXTFUNC_S}_change
+ StrCmp${_TEXTFUNC_S} $6 '$1$2' 0 TextFunc_ConfigWrite${_TEXTFUNC_S}_change
+ StrCpy $0 SAME
+ goto TextFunc_ConfigWrite${_TEXTFUNC_S}_close
+
+ TextFunc_ConfigWrite${_TEXTFUNC_S}_change:
+ FileSeek $3 0 CUR $5
+ StrLen $4 $4
+ IntOp $4 $5 - $4
+ FileSeek $3 0 END $6
+ IntOp $6 $6 - $5
+
+ System::Alloc /NOUNLOAD $6
+ Pop $0
+ FileSeek $3 $5 SET
+ System::Call /NOUNLOAD 'kernel32::ReadFile(i r3, i r0, i $6, t.,)'
+ FileSeek $3 $4 SET
+ StrCmp${_TEXTFUNC_S} $2 '' +2
+ FileWrite $3 '$1$2$\r$\n'
+ System::Call /NOUNLOAD 'kernel32::WriteFile(i r3, i r0, i $6, t.,)'
+ System::Call /NOUNLOAD 'kernel32::SetEndOfFile(i r3)'
+ System::Free $0
+ StrCmp${_TEXTFUNC_S} $2 '' +3
+ StrCpy $0 CHANGED
+ goto TextFunc_ConfigWrite${_TEXTFUNC_S}_close
+ StrCpy $0 DELETED
+ goto TextFunc_ConfigWrite${_TEXTFUNC_S}_close
+
+ TextFunc_ConfigWrite${_TEXTFUNC_S}_add:
+ StrCmp${_TEXTFUNC_S} $2 '' 0 +3
+ StrCpy $0 SAME
+ goto TextFunc_ConfigWrite${_TEXTFUNC_S}_close
+ FileSeek $3 -1 END
+ FileRead $3 $4
+ IfErrors +4
+ StrCmp${_TEXTFUNC_S} $4 '$\r' +3
+ StrCmp${_TEXTFUNC_S} $4 '$\n' +2
+ FileWrite $3 '$\r$\n'
+ FileWrite $3 '$1$2$\r$\n'
+ StrCpy $0 ADDED
+
+ TextFunc_ConfigWrite${_TEXTFUNC_S}_close:
+ FileClose $3
+ goto TextFunc_ConfigWrite${_TEXTFUNC_S}_end
+
+ TextFunc_ConfigWrite${_TEXTFUNC_S}_error:
+ SetErrors
+ StrCpy $0 ''
+
+ TextFunc_ConfigWrite${_TEXTFUNC_S}_end:
+ Pop $6
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Exch $0
+!macroend
+
+!define ConfigWrite `!insertmacro ConfigWriteCall`
+!define un.ConfigWrite `!insertmacro ConfigWriteCall`
+
+!macro ConfigWrite
+!macroend
+
+!macro un.ConfigWrite
+!macroend
+
+!macro ConfigWrite_
+ !verbose push
+ !verbose ${_TEXTFUNC_VERBOSE}
+
+ !insertmacro ConfigWriteBody ''
+
+ !verbose pop
+!macroend
+
+!define ConfigWriteS `!insertmacro ConfigWriteSCall`
+!define un.ConfigWriteS `!insertmacro ConfigWriteSCall`
+
+!macro ConfigWriteS
!macroend
!macro un.ConfigWriteS
- !ifndef un.ConfigWriteS
- !verbose push
- !verbose ${_TEXTFUNC_VERBOSE}
- !undef _TEXTFUNC_UN
- !define _TEXTFUNC_UN `un.`
- !undef _TEXTFUNC_S
- !define _TEXTFUNC_S `S`
+!macroend
- !insertmacro ConfigWrite
+!macro ConfigWriteS_
+ !verbose push
+ !verbose ${_TEXTFUNC_VERBOSE}
- !undef _TEXTFUNC_UN
- !define _TEXTFUNC_UN
- !undef _TEXTFUNC_S
- !define _TEXTFUNC_S
- !verbose pop
- !endif
+ !insertmacro ConfigWriteBody 'S'
+
+ !verbose pop
+!macroend
+
+!define FileRecode `!insertmacro FileRecodeCall`
+!define un.FileRecode `!insertmacro FileRecodeCall`
+
+!macro FileRecode
+!macroend
+
+!macro un.FileRecode
+!macroend
+
+!macro FileRecode_
+ !verbose push
+ !verbose ${_TEXTFUNC_VERBOSE}
+
+ Exch $1
+ Exch
+ Exch $0
+ Exch
+ Push $2
+ Push $3
+ Push $4
+
+ IfFileExists $0 0 TextFunc_FileRecode_error
+ StrCmp $1 OemToChar +2
+ StrCmp $1 CharToOem 0 TextFunc_FileRecode_error
+
+ FileOpen $2 $0 a
+ FileSeek $2 0 END $3
+ System::Alloc /NOUNLOAD $3
+ Pop $4
+ FileSeek $2 0 SET
+ System::Call /NOUNLOAD 'kernel32::ReadFile(i r2, i r4, i $3, t.,)'
+ System::Call /NOUNLOAD 'user32::$1Buff(i r4, i r4, i $3)'
+ FileSeek $2 0 SET
+ System::Call /NOUNLOAD 'kernel32::WriteFile(i r2, i r4, i $3, t.,)'
+ System::Free $4
+ FileClose $2
+ goto TextFunc_FileRecode_end
+
+ TextFunc_FileRecode_error:
+ SetErrors
+
+ TextFunc_FileRecode_end:
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Pop $0
+
+ !verbose pop
+!macroend
+
+!define TrimNewLines `!insertmacro TrimNewLinesCall`
+!define un.TrimNewLines `!insertmacro TrimNewLinesCall`
+
+!macro TrimNewLines
+!macroend
+
+!macro un.TrimNewLines
+!macroend
+
+!macro TrimNewLines_
+ !verbose push
+ !verbose ${_TEXTFUNC_VERBOSE}
+
+ Exch $0
+ Push $1
+ Push $2
+
+ StrCpy $1 0
+ IntOp $1 $1 - 1
+ StrCpy $2 $0 1 $1
+ StrCmp $2 '$\r' -2
+ StrCmp $2 '$\n' -3
+ StrCmp $1 -1 +3
+ IntOp $1 $1 + 1
+ StrCpy $0 $0 $1
+
+ Pop $2
+ Pop $1
+ Exch $0
+
+ !verbose pop
!macroend
!endif
diff --git a/Include/Util.nsh b/Include/Util.nsh
index 1a55c918..cb046364 100644
--- a/Include/Util.nsh
+++ b/Include/Util.nsh
@@ -30,6 +30,27 @@
!macroend
!define CallArtificialFunction `!insertmacro CallArtificialFunction`
+# for usage of artificial functions inside artificial functions
+# macro recursion is prohibited
+!macro CallArtificialFunction2 NAME
+ !ifndef __UNINSTALL__
+ !define CallArtificialFunction2_TYPE inst
+ !else
+ !define CallArtificialFunction2_TYPE uninst
+ !endif
+ Call :.${NAME}${CallArtificialFunction2_TYPE}
+ !ifndef ${NAME}${CallArtificialFunction2_TYPE}_DEFINED
+ Goto ${NAME}${CallArtificialFunction2_TYPE}_DONE
+ !define ${NAME}${CallArtificialFunction2_TYPE}_DEFINED
+ .${NAME}${CallArtificialFunction2_TYPE}:
+ !insertmacro ${NAME}
+ Return
+ ${NAME}${CallArtificialFunction2_TYPE}_DONE:
+ !endif
+ !undef CallArtificialFunction2_TYPE
+!macroend
+!define CallArtificialFunction2 `!insertmacro CallArtificialFunction2`
+
!endif # !___UTIL__NSH___
!verbose pop
diff --git a/Include/WordFunc.nsh b/Include/WordFunc.nsh
index d5c9d679..2e62d403 100644
--- a/Include/WordFunc.nsh
+++ b/Include/WordFunc.nsh
@@ -10,8 +10,7 @@ _____________________________________________________________________________
Usage in script:
1. !include "WordFunc.nsh"
- 2. !insertmacro WordFunction
- 3. [Section|Function]
+ 2. [Section|Function]
${WordFunction} "Param1" "Param2" "..." $var
[SectionEnd|FunctionEnd]
@@ -20,11 +19,6 @@ _____________________________________________________________________________
WordReplace|WordReplaceS|WordAdd|WordAddS|WordInsert|WordInsertS|
StrFilter|StrFilterS|VersionCompare|VersionConvert]
- un.WordFunction=[un.WordFind|un.WordFindS|un.WordFind2X|un.WordFind2XS|
- un.WordFind3X|un.WordFind3XS|un.WordReplace|un.WordReplaceS|
- un.WordAdd|un.WordAddS|un.WordInsert|un.WordInsertS|
- un.StrFilter|un.StrFilterS|un.VersionCompare|un.VersionConvert]
-
_____________________________________________________________________________
Thanks to:
@@ -58,6 +52,8 @@ VersionConvert
!ifndef WORDFUNC_INCLUDED
!define WORDFUNC_INCLUDED
+!include Util.nsh
+
!verbose push
!verbose 3
!ifndef _WORDFUNC_VERBOSE
@@ -65,8 +61,6 @@ VersionConvert
!endif
!verbose ${_WORDFUNC_VERBOSE}
!define WORDFUNC_VERBOSE `!insertmacro WORDFUNC_VERBOSE`
-!define _WORDFUNC_UN
-!define _WORDFUNC_S
!verbose pop
!macro WORDFUNC_VERBOSE _VERBOSE
@@ -78,15 +72,24 @@ VersionConvert
!macroend
-# Install. Case insensitive. #
-
-!macro WordFindCall _STRING _DELIMITER _OPTION _RESULT
+!macro WordFindCall _ART _STRING _DELIMITER _OPTION _RESULT
!verbose push
!verbose ${_WORDFUNC_VERBOSE}
Push `${_STRING}`
Push `${_DELIMITER}`
Push `${_OPTION}`
- Call WordFind
+ ${CallArtificialFunction}${_ART} WordFind_
+ Pop ${_RESULT}
+ !verbose pop
+!macroend
+
+!macro WordFindSCall _ART _STRING _DELIMITER _OPTION _RESULT
+ !verbose push
+ !verbose ${_WORDFUNC_VERBOSE}
+ Push `${_STRING}`
+ Push `${_DELIMITER}`
+ Push `${_OPTION}`
+ ${CallArtificialFunction}${_ART} WordFindS_
Pop ${_RESULT}
!verbose pop
!macroend
@@ -98,7 +101,19 @@ VersionConvert
Push `${_DELIMITER1}`
Push `${_DELIMITER2}`
Push `${_NUMBER}`
- Call WordFind2X
+ ${CallArtificialFunction} WordFind2X_
+ Pop ${_RESULT}
+ !verbose pop
+!macroend
+
+!macro WordFind2XSCall _STRING _DELIMITER1 _DELIMITER2 _NUMBER _RESULT
+ !verbose push
+ !verbose ${_WORDFUNC_VERBOSE}
+ Push `${_STRING}`
+ Push `${_DELIMITER1}`
+ Push `${_DELIMITER2}`
+ Push `${_NUMBER}`
+ ${CallArtificialFunction} WordFind2XS_
Pop ${_RESULT}
!verbose pop
!macroend
@@ -111,1712 +126,7 @@ VersionConvert
Push `${_CENTER}`
Push `${_DELIMITER2}`
Push `${_NUMBER}`
- Call WordFind3X
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro WordReplaceCall _STRING _WORD1 _WORD2 _NUMBER _RESULT
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- Push `${_STRING}`
- Push `${_WORD1}`
- Push `${_WORD2}`
- Push `${_NUMBER}`
- Call WordReplace
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro WordAddCall _STRING1 _DELIMITER _STRING2 _RESULT
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- Push `${_STRING1}`
- Push `${_DELIMITER}`
- Push `${_STRING2}`
- Call WordAdd
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro WordInsertCall _STRING _DELIMITER _WORD _NUMBER _RESULT
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- Push `${_STRING}`
- Push `${_DELIMITER}`
- Push `${_WORD}`
- Push `${_NUMBER}`
- Call WordInsert
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro StrFilterCall _STRING _FILTER _INCLUDE _EXCLUDE _RESULT
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- Push `${_STRING}`
- Push `${_FILTER}`
- Push `${_INCLUDE}`
- Push `${_EXCLUDE}`
- Call StrFilter
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro VersionCompareCall _VER1 _VER2 _RESULT
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- Push `${_VER1}`
- Push `${_VER2}`
- Call VersionCompare
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro VersionConvertCall _VERSION _CHARLIST _RESULT
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- Push `${_VERSION}`
- Push `${_CHARLIST}`
- Call VersionConvert
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro WordFind
- !ifndef ${_WORDFUNC_UN}WordFind${_WORDFUNC_S}
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !define ${_WORDFUNC_UN}WordFind${_WORDFUNC_S} `!insertmacro ${_WORDFUNC_UN}WordFind${_WORDFUNC_S}Call`
-
- Function ${_WORDFUNC_UN}WordFind${_WORDFUNC_S}
- Exch $1
- Exch
- Exch $0
- Exch
- Exch 2
- Exch $R0
- Exch 2
- Push $2
- Push $3
- Push $4
- Push $5
- Push $6
- Push $7
- Push $8
- Push $9
- Push $R1
- Push $R2
- ClearErrors
-
- StrCpy $9 ''
- StrCpy $2 $1 1
- StrCpy $1 $1 '' 1
- StrCmp $2 'E' 0 +3
- StrCpy $9 E
- goto -4
-
- StrCpy $3 ''
- StrCmp${_WORDFUNC_S} $2 '+' +6
- StrCmp${_WORDFUNC_S} $2 '-' +5
- StrCmp${_WORDFUNC_S} $2 '/' restart
- StrCmp${_WORDFUNC_S} $2 '#' restart
- StrCmp${_WORDFUNC_S} $2 '*' restart
- goto error3
-
- StrCpy $4 $1 1 -1
- StrCmp${_WORDFUNC_S} $4 '*' +4
- StrCmp${_WORDFUNC_S} $4 '}' +3
- StrCmp${_WORDFUNC_S} $4 '{' +2
- goto +4
- StrCpy $1 $1 -1
- StrCpy $3 '$4$3'
- goto -7
- StrCmp${_WORDFUNC_S} $3 '*' error3
- StrCmp${_WORDFUNC_S} $3 '**' error3
- StrCmp${_WORDFUNC_S} $3 '}{' error3
- IntOp $1 $1 + 0
- StrCmp${_WORDFUNC_S} $1 0 error2
-
- restart:
- StrCmp${_WORDFUNC_S} $R0 '' error1
- StrCpy $4 0
- StrCpy $5 0
- StrCpy $6 0
- StrLen $7 $0
- goto loop
-
- preloop:
- IntOp $6 $6 + 1
-
- loop:
- StrCpy $8 $R0 $7 $6
- StrCmp${_WORDFUNC_S} $8$5 0 error1
- StrLen $R2 $8
- IntCmp $R2 0 +2
- StrCmp${_WORDFUNC_S} $8 $0 +5 preloop
- StrCmp${_WORDFUNC_S} $3 '{' minus
- StrCmp${_WORDFUNC_S} $3 '}' minus
- StrCmp${_WORDFUNC_S} $2 '*' minus
- StrCmp${_WORDFUNC_S} $5 $6 minus +5
- StrCmp${_WORDFUNC_S} $3 '{' +4
- StrCmp${_WORDFUNC_S} $3 '}' +3
- StrCmp${_WORDFUNC_S} $2 '*' +2
- StrCmp${_WORDFUNC_S} $5 $6 nextword
- IntOp $4 $4 + 1
- StrCmp${_WORDFUNC_S} $2$4 +$1 plus
- StrCmp${_WORDFUNC_S} $2 '/' 0 nextword
- IntOp $8 $6 - $5
- StrCpy $8 $R0 $8 $5
- StrCmp${_WORDFUNC_S} $1 $8 0 nextword
- StrCpy $R1 $4
- goto end
- nextword:
- IntOp $6 $6 + $7
- StrCpy $5 $6
- goto loop
-
- minus:
- StrCmp${_WORDFUNC_S} $2 '-' 0 sum
- StrCpy $2 '+'
- IntOp $1 $4 - $1
- IntOp $1 $1 + 1
- IntCmp $1 0 error2 error2 restart
- sum:
- StrCmp${_WORDFUNC_S} $2 '#' 0 sumdelim
- StrCpy $R1 $4
- goto end
- sumdelim:
- StrCmp${_WORDFUNC_S} $2 '*' 0 error2
- StrCpy $R1 $4
- goto end
-
- plus:
- StrCmp${_WORDFUNC_S} $3 '' 0 +4
- IntOp $6 $6 - $5
- StrCpy $R1 $R0 $6 $5
- goto end
- StrCmp${_WORDFUNC_S} $3 '{' 0 +3
- StrCpy $R1 $R0 $6
- goto end
- StrCmp${_WORDFUNC_S} $3 '}' 0 +4
- IntOp $6 $6 + $7
- StrCpy $R1 $R0 '' $6
- goto end
- StrCmp${_WORDFUNC_S} $3 '{*' +2
- StrCmp${_WORDFUNC_S} $3 '*{' 0 +3
- StrCpy $R1 $R0 $6
- goto end
- StrCmp${_WORDFUNC_S} $3 '*}' +2
- StrCmp${_WORDFUNC_S} $3 '}*' 0 +3
- StrCpy $R1 $R0 '' $5
- goto end
- StrCmp${_WORDFUNC_S} $3 '}}' 0 +3
- StrCpy $R1 $R0 '' $6
- goto end
- StrCmp${_WORDFUNC_S} $3 '{{' 0 +3
- StrCpy $R1 $R0 $5
- goto end
- StrCmp${_WORDFUNC_S} $3 '{}' 0 error3
- StrLen $3 $R0
- StrCmp${_WORDFUNC_S} $3 $6 0 +3
- StrCpy $0 ''
- goto +2
- IntOp $6 $6 + $7
- StrCpy $8 $R0 '' $6
- StrCmp${_WORDFUNC_S} $4$8 1 +6
- StrCmp${_WORDFUNC_S} $4 1 +2 +7
- IntOp $6 $6 + $7
- StrCpy $3 $R0 $7 $6
- StrCmp${_WORDFUNC_S} $3 '' +2
- StrCmp${_WORDFUNC_S} $3 $0 -3 +3
- StrCpy $R1 ''
- goto end
- StrCmp${_WORDFUNC_S} $5 0 0 +3
- StrCpy $0 ''
- goto +2
- IntOp $5 $5 - $7
- StrCpy $3 $R0 $5
- StrCpy $R1 '$3$0$8'
- goto end
-
- error3:
- StrCpy $R1 3
- goto error
- error2:
- StrCpy $R1 2
- goto error
- error1:
- StrCpy $R1 1
- error:
- StrCmp $9 'E' 0 +3
- SetErrors
-
- end:
- StrCpy $R0 $R1
-
- Pop $R2
- Pop $R1
- Pop $9
- Pop $8
- Pop $7
- Pop $6
- Pop $5
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Pop $0
- Exch $R0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro WordFind2X
- !ifndef ${_WORDFUNC_UN}WordFind2X${_WORDFUNC_S}
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !define ${_WORDFUNC_UN}WordFind2X${_WORDFUNC_S} `!insertmacro ${_WORDFUNC_UN}WordFind2X${_WORDFUNC_S}Call`
-
- Function ${_WORDFUNC_UN}WordFind2X${_WORDFUNC_S}
- Exch $2
- Exch
- Exch $1
- Exch
- Exch 2
- Exch $0
- Exch 2
- Exch 3
- Exch $R0
- Exch 3
- Push $3
- Push $4
- Push $5
- Push $6
- Push $7
- Push $8
- Push $9
- Push $R1
- Push $R2
- ClearErrors
-
- StrCpy $R2 ''
- StrCpy $3 $2 1
- StrCpy $2 $2 '' 1
- StrCmp $3 'E' 0 +3
- StrCpy $R2 E
- goto -4
-
- StrCmp${_WORDFUNC_S} $3 '+' +5
- StrCmp${_WORDFUNC_S} $3 '-' +4
- StrCmp${_WORDFUNC_S} $3 '#' restart
- StrCmp${_WORDFUNC_S} $3 '/' restart
- goto error3
-
- StrCpy $4 $2 2 -2
- StrCmp${_WORDFUNC_S} $4 '{{' +9
- StrCmp${_WORDFUNC_S} $4 '}}' +8
- StrCmp${_WORDFUNC_S} $4 '{*' +7
- StrCmp${_WORDFUNC_S} $4 '*{' +6
- StrCmp${_WORDFUNC_S} $4 '*}' +5
- StrCmp${_WORDFUNC_S} $4 '}*' +4
- StrCmp${_WORDFUNC_S} $4 '{}' +3
- StrCpy $4 ''
- goto +2
- StrCpy $2 $2 -2
- IntOp $2 $2 + 0
- StrCmp${_WORDFUNC_S} $2 0 error2
-
- restart:
- StrCmp${_WORDFUNC_S} $R0 '' error1
- StrCpy $5 -1
- StrCpy $6 0
- StrCpy $7 ''
- StrLen $8 $0
- StrLen $9 $1
-
- loop:
- IntOp $5 $5 + 1
-
- delim1:
- StrCpy $R1 $R0 $8 $5
- StrCmp${_WORDFUNC_S} $R1$6 0 error1
- StrCmp${_WORDFUNC_S} $R1 '' minus
- StrCmp${_WORDFUNC_S} $R1 $0 +2
- StrCmp${_WORDFUNC_S} $7 '' loop delim2
- StrCmp${_WORDFUNC_S} $0 $1 0 +2
- StrCmp${_WORDFUNC_S} $7 '' 0 delim2
- IntOp $7 $5 + $8
- StrCpy $5 $7
- goto delim1
-
- delim2:
- StrCpy $R1 $R0 $9 $5
- StrCmp${_WORDFUNC_S} $R1 $1 0 loop
- IntOp $6 $6 + 1
- StrCmp${_WORDFUNC_S} $3$6 '+$2' plus
- StrCmp${_WORDFUNC_S} $3 '/' 0 nextword
- IntOp $R1 $5 - $7
- StrCpy $R1 $R0 $R1 $7
- StrCmp${_WORDFUNC_S} $R1 $2 0 +3
- StrCpy $R1 $6
- goto end
- nextword:
- IntOp $5 $5 + $9
- StrCpy $7 ''
- goto delim1
-
- minus:
- StrCmp${_WORDFUNC_S} $3 '-' 0 sum
- StrCpy $3 +
- IntOp $2 $6 - $2
- IntOp $2 $2 + 1
- IntCmp $2 0 error2 error2 restart
- sum:
- StrCmp${_WORDFUNC_S} $3 '#' 0 error2
- StrCpy $R1 $6
- goto end
-
- plus:
- StrCmp${_WORDFUNC_S} $4 '' 0 +4
- IntOp $R1 $5 - $7
- StrCpy $R1 $R0 $R1 $7
- goto end
- IntOp $5 $5 + $9
- IntOp $7 $7 - $8
- StrCmp${_WORDFUNC_S} $4 '{*' +2
- StrCmp${_WORDFUNC_S} $4 '*{' 0 +3
- StrCpy $R1 $R0 $5
- goto end
- StrCmp${_WORDFUNC_S} $4 '*}' +2
- StrCmp${_WORDFUNC_S} $4 '}*' 0 +3
- StrCpy $R1 $R0 '' $7
- goto end
- StrCmp${_WORDFUNC_S} $4 '}}' 0 +3
- StrCpy $R1 $R0 '' $5
- goto end
- StrCmp${_WORDFUNC_S} $4 '{{' 0 +3
- StrCpy $R1 $R0 $7
- goto end
- StrCmp${_WORDFUNC_S} $4 '{}' 0 error3
- StrCpy $5 $R0 '' $5
- StrCpy $7 $R0 $7
- StrCpy $R1 '$7$5'
- goto end
-
- error3:
- StrCpy $R1 3
- goto error
- error2:
- StrCpy $R1 2
- goto error
- error1:
- StrCpy $R1 1
- error:
- StrCmp $R2 'E' 0 +3
- SetErrors
-
- end:
- StrCpy $R0 $R1
-
- Pop $R2
- Pop $R1
- Pop $9
- Pop $8
- Pop $7
- Pop $6
- Pop $5
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Pop $0
- Exch $R0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro WordFind3X
- !ifndef ${_WORDFUNC_UN}WordFind3X${_WORDFUNC_S}
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !define ${_WORDFUNC_UN}WordFind3X${_WORDFUNC_S} `!insertmacro ${_WORDFUNC_UN}WordFind3X${_WORDFUNC_S}Call`
-
- Function ${_WORDFUNC_UN}WordFind3X${_WORDFUNC_S}
- Exch $3
- Exch
- Exch $2
- Exch
- Exch 2
- Exch $1
- Exch 2
- Exch 3
- Exch $0
- Exch 3
- Exch 4
- Exch $R0
- Exch 4
- Push $4
- Push $5
- Push $6
- Push $7
- Push $8
- Push $9
- Push $R1
- Push $R2
- Push $R3
- Push $R4
- Push $R5
- ClearErrors
-
- StrCpy $R5 ''
- StrCpy $4 $3 1
- StrCpy $3 $3 '' 1
- StrCmp $4 'E' 0 +3
- StrCpy $R5 E
- goto -4
-
- StrCmp${_WORDFUNC_S} $4 '+' +5
- StrCmp${_WORDFUNC_S} $4 '-' +4
- StrCmp${_WORDFUNC_S} $4 '#' restart
- StrCmp${_WORDFUNC_S} $4 '/' restart
- goto error3
-
- StrCpy $5 $3 2 -2
- StrCmp${_WORDFUNC_S} $5 '{{' +9
- StrCmp${_WORDFUNC_S} $5 '}}' +8
- StrCmp${_WORDFUNC_S} $5 '{*' +7
- StrCmp${_WORDFUNC_S} $5 '*{' +6
- StrCmp${_WORDFUNC_S} $5 '*}' +5
- StrCmp${_WORDFUNC_S} $5 '}*' +4
- StrCmp${_WORDFUNC_S} $5 '{}' +3
- StrCpy $5 ''
- goto +2
- StrCpy $3 $3 -2
- IntOp $3 $3 + 0
- StrCmp${_WORDFUNC_S} $3 0 error2
-
- restart:
- StrCmp${_WORDFUNC_S} $R0 '' error1
- StrCpy $6 -1
- StrCpy $7 0
- StrCpy $8 ''
- StrCpy $9 ''
- StrLen $R1 $0
- StrLen $R2 $1
- StrLen $R3 $2
-
- loop:
- IntOp $6 $6 + 1
-
- delim1:
- StrCpy $R4 $R0 $R1 $6
- StrCmp${_WORDFUNC_S} $R4$7 0 error1
- StrCmp${_WORDFUNC_S} $R4 '' minus
- StrCmp${_WORDFUNC_S} $R4 $0 +2
- StrCmp${_WORDFUNC_S} $8 '' loop center
- StrCmp${_WORDFUNC_S} $0 $1 +2
- StrCmp${_WORDFUNC_S} $0 $2 0 +2
- StrCmp${_WORDFUNC_S} $8 '' 0 center
- IntOp $8 $6 + $R1
- StrCpy $6 $8
- goto delim1
-
- center:
- StrCmp${_WORDFUNC_S} $9 '' 0 delim2
- StrCpy $R4 $R0 $R2 $6
- StrCmp${_WORDFUNC_S} $R4 $1 0 loop
- IntOp $9 $6 + $R2
- StrCpy $6 $9
- goto delim1
-
- delim2:
- StrCpy $R4 $R0 $R3 $6
- StrCmp${_WORDFUNC_S} $R4 $2 0 loop
- IntOp $7 $7 + 1
- StrCmp${_WORDFUNC_S} $4$7 '+$3' plus
- StrCmp${_WORDFUNC_S} $4 '/' 0 nextword
- IntOp $R4 $6 - $8
- StrCpy $R4 $R0 $R4 $8
- StrCmp${_WORDFUNC_S} $R4 $3 0 +3
- StrCpy $R4 $7
- goto end
- nextword:
- IntOp $6 $6 + $R3
- StrCpy $8 ''
- StrCpy $9 ''
- goto delim1
-
- minus:
- StrCmp${_WORDFUNC_S} $4 '-' 0 sum
- StrCpy $4 +
- IntOp $3 $7 - $3
- IntOp $3 $3 + 1
- IntCmp $3 0 error2 error2 restart
- sum:
- StrCmp${_WORDFUNC_S} $4 '#' 0 error2
- StrCpy $R4 $7
- goto end
-
- plus:
- StrCmp${_WORDFUNC_S} $5 '' 0 +4
- IntOp $R4 $6 - $8
- StrCpy $R4 $R0 $R4 $8
- goto end
- IntOp $6 $6 + $R3
- IntOp $8 $8 - $R1
- StrCmp${_WORDFUNC_S} $5 '{*' +2
- StrCmp${_WORDFUNC_S} $5 '*{' 0 +3
- StrCpy $R4 $R0 $6
- goto end
- StrCmp${_WORDFUNC_S} $5 '*}' +2
- StrCmp${_WORDFUNC_S} $5 '}*' 0 +3
- StrCpy $R4 $R0 '' $8
- goto end
- StrCmp${_WORDFUNC_S} $5 '}}' 0 +3
- StrCpy $R4 $R0 '' $6
- goto end
- StrCmp${_WORDFUNC_S} $5 '{{' 0 +3
- StrCpy $R4 $R0 $8
- goto end
- StrCmp${_WORDFUNC_S} $5 '{}' 0 error3
- StrCpy $6 $R0 '' $6
- StrCpy $8 $R0 $8
- StrCpy $R4 '$8$6'
- goto end
-
- error3:
- StrCpy $R4 3
- goto error
- error2:
- StrCpy $R4 2
- goto error
- error1:
- StrCpy $R4 1
- error:
- StrCmp $R5 'E' 0 +3
- SetErrors
-
- end:
- StrCpy $R0 $R4
- Pop $R5
- Pop $R4
- Pop $R3
- Pop $R2
- Pop $R1
- Pop $9
- Pop $8
- Pop $7
- Pop $6
- Pop $5
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Pop $0
- Exch $R0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro WordReplace
- !ifndef ${_WORDFUNC_UN}WordReplace${_WORDFUNC_S}
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !define ${_WORDFUNC_UN}WordReplace${_WORDFUNC_S} `!insertmacro ${_WORDFUNC_UN}WordReplace${_WORDFUNC_S}Call`
-
- Function ${_WORDFUNC_UN}WordReplace${_WORDFUNC_S}
- Exch $2
- Exch
- Exch $1
- Exch
- Exch 2
- Exch $0
- Exch 2
- Exch 3
- Exch $R0
- Exch 3
- Push $3
- Push $4
- Push $5
- Push $6
- Push $7
- Push $8
- Push $9
- Push $R1
- ClearErrors
-
- StrCpy $R1 $R0
- StrCpy $9 ''
- StrCpy $3 $2 1
- StrCpy $2 $2 '' 1
- StrCmp $3 'E' 0 +3
- StrCpy $9 E
- goto -4
-
- StrCpy $4 $2 1 -1
- StrCpy $5 ''
- StrCpy $6 ''
- StrLen $7 $0
-
- StrCmp${_WORDFUNC_S} $7 0 error1
- StrCmp${_WORDFUNC_S} $R0 '' error1
- StrCmp${_WORDFUNC_S} $3 '{' beginning
- StrCmp${_WORDFUNC_S} $3 '}' ending errorchk
-
- beginning:
- StrCpy $8 $R0 $7
- StrCmp${_WORDFUNC_S} $8 $0 0 +4
- StrCpy $R0 $R0 '' $7
- StrCpy $5 '$5$1'
- goto -4
- StrCpy $3 $2 1
- StrCmp${_WORDFUNC_S} $3 '}' 0 merge
-
- ending:
- StrCpy $8 $R0 '' -$7
- StrCmp${_WORDFUNC_S} $8 $0 0 +4
- StrCpy $R0 $R0 -$7
- StrCpy $6 '$6$1'
- goto -4
-
- merge:
- StrCmp${_WORDFUNC_S} $4 '*' 0 +5
- StrCmp${_WORDFUNC_S} $5 '' +2
- StrCpy $5 $1
- StrCmp${_WORDFUNC_S} $6 '' +2
- StrCpy $6 $1
- StrCpy $R0 '$5$R0$6'
- goto end
-
- errorchk:
- StrCmp${_WORDFUNC_S} $3 '+' +2
- StrCmp${_WORDFUNC_S} $3 '-' 0 error3
-
- StrCpy $5 $2 1
- IntOp $2 $2 + 0
- StrCmp${_WORDFUNC_S} $2 0 0 one
- StrCmp${_WORDFUNC_S} $5 0 error2
- StrCpy $3 ''
-
- all:
- StrCpy $5 0
- StrCpy $2 $R0 $7 $5
- StrCmp${_WORDFUNC_S} $2 '' +4
- StrCmp${_WORDFUNC_S} $2 $0 +6
- IntOp $5 $5 + 1
- goto -4
- StrCmp${_WORDFUNC_S} $R0 $R1 error1
- StrCpy $R0 '$3$R0'
- goto end
- StrCpy $2 $R0 $5
- IntOp $5 $5 + $7
- StrCmp${_WORDFUNC_S} $4 '*' 0 +3
- StrCpy $6 $R0 $7 $5
- StrCmp${_WORDFUNC_S} $6 $0 -3
- StrCpy $R0 $R0 '' $5
- StrCpy $3 '$3$2$1'
- goto all
-
- one:
- StrCpy $5 0
- StrCpy $8 0
- goto loop
-
- preloop:
- IntOp $5 $5 + 1
-
- loop:
- StrCpy $6 $R0 $7 $5
- StrCmp${_WORDFUNC_S} $6$8 0 error1
- StrCmp${_WORDFUNC_S} $6 '' minus
- StrCmp${_WORDFUNC_S} $6 $0 0 preloop
- IntOp $8 $8 + 1
- StrCmp${_WORDFUNC_S} $3$8 +$2 found
- IntOp $5 $5 + $7
- goto loop
-
- minus:
- StrCmp${_WORDFUNC_S} $3 '-' 0 error2
- StrCpy $3 +
- IntOp $2 $8 - $2
- IntOp $2 $2 + 1
- IntCmp $2 0 error2 error2 one
-
- found:
- StrCpy $3 $R0 $5
- StrCmp${_WORDFUNC_S} $4 '*' 0 +5
- StrCpy $6 $3 '' -$7
- StrCmp${_WORDFUNC_S} $6 $0 0 +3
- StrCpy $3 $3 -$7
- goto -3
- IntOp $5 $5 + $7
- StrCmp${_WORDFUNC_S} $4 '*' 0 +3
- StrCpy $6 $R0 $7 $5
- StrCmp${_WORDFUNC_S} $6 $0 -3
- StrCpy $R0 $R0 '' $5
- StrCpy $R0 '$3$1$R0'
- goto end
-
- error3:
- StrCpy $R0 3
- goto error
- error2:
- StrCpy $R0 2
- goto error
- error1:
- StrCpy $R0 1
- error:
- StrCmp $9 'E' +3
- StrCpy $R0 $R1
- goto +2
- SetErrors
-
- end:
- Pop $R1
- Pop $9
- Pop $8
- Pop $7
- Pop $6
- Pop $5
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Pop $0
- Exch $R0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro WordAdd
- !ifndef ${_WORDFUNC_UN}WordAdd${_WORDFUNC_S}
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !insertmacro WordFind
-
- !define ${_WORDFUNC_UN}WordAdd${_WORDFUNC_S} `!insertmacro ${_WORDFUNC_UN}WordAdd${_WORDFUNC_S}Call`
-
- Function ${_WORDFUNC_UN}WordAdd${_WORDFUNC_S}
- Exch $1
- Exch
- Exch $0
- Exch
- Exch 2
- Exch $R0
- Exch 2
- Push $2
- Push $3
- Push $4
- Push $5
- Push $6
- Push $7
- Push $R1
- ClearErrors
-
- StrCpy $7 ''
- StrCpy $2 $1 1
- StrCmp $2 'E' 0 +4
- StrCpy $7 E
- StrCpy $1 $1 '' 1
- goto -4
-
- StrCpy $5 0
- StrCpy $R1 $R0
- StrCpy $2 $1 '' 1
- StrCpy $1 $1 1
- StrCmp${_WORDFUNC_S} $1 '+' +2
- StrCmp${_WORDFUNC_S} $1 '-' 0 error3
-
- StrCmp${_WORDFUNC_S} $0 '' error1
- StrCmp${_WORDFUNC_S} $2 '' end
- StrCmp${_WORDFUNC_S} $R0 '' 0 +5
- StrCmp${_WORDFUNC_S} $1 '-' end
- StrCmp${_WORDFUNC_S} $1 '+' 0 +3
- StrCpy $R0 $2
- goto end
-
- loop:
- IntOp $5 $5 + 1
- Push `$2`
- Push `$0`
- Push `E+$5`
- Call ${_WORDFUNC_UN}WordFind${_WORDFUNC_S}
- Pop $3
- IfErrors 0 /word
- StrCmp${_WORDFUNC_S} $3 2 +4
- StrCmp${_WORDFUNC_S} $3$5 11 0 +3
- StrCpy $3 $2
- goto /word
- StrCmp${_WORDFUNC_S} $1 '-' end preend
-
- /word:
- Push `$R0`
- Push `$0`
- Push `E/$3`
- Call ${_WORDFUNC_UN}WordFind${_WORDFUNC_S}
- Pop $4
- IfErrors +2
- StrCmp${_WORDFUNC_S} $1 '-' delete loop
- StrCmp${_WORDFUNC_S} $1$4 '-1' +2
- StrCmp${_WORDFUNC_S} $1 '-' loop +4
- StrCmp${_WORDFUNC_S} $R0 $3 0 loop
- StrCpy $R0 ''
- goto end
- StrCmp${_WORDFUNC_S} $1$4 '+1' 0 +2
- StrCmp${_WORDFUNC_S} $R0 $3 loop
- StrCmp${_WORDFUNC_S} $R0 $R1 +3
- StrCpy $R1 '$R1$0$3'
- goto loop
- StrLen $6 $0
- StrCpy $6 $R0 '' -$6
- StrCmp${_WORDFUNC_S} $6 $0 0 -4
- StrCpy $R1 '$R1$3'
- goto loop
-
- delete:
- Push `$R0`
- Push `$0`
- Push `E+$4{}`
- Call ${_WORDFUNC_UN}WordFind${_WORDFUNC_S}
- Pop $R0
- goto /word
-
- error3:
- StrCpy $R1 3
- goto error
- error1:
- StrCpy $R1 1
- error:
- StrCmp $7 'E' 0 end
- SetErrors
-
- preend:
- StrCpy $R0 $R1
-
- end:
- Pop $R1
- Pop $7
- Pop $6
- Pop $5
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Pop $0
- Exch $R0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro WordInsert
- !ifndef ${_WORDFUNC_UN}WordInsert${_WORDFUNC_S}
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !insertmacro WordFind
-
- !define ${_WORDFUNC_UN}WordInsert${_WORDFUNC_S} `!insertmacro ${_WORDFUNC_UN}WordInsert${_WORDFUNC_S}Call`
-
- Function ${_WORDFUNC_UN}WordInsert${_WORDFUNC_S}
- Exch $2
- Exch
- Exch $1
- Exch
- Exch 2
- Exch $0
- Exch 2
- Exch 3
- Exch $R0
- Exch 3
- Push $3
- Push $4
- Push $5
- Push $6
- Push $7
- Push $8
- Push $9
- Push $R1
- ClearErrors
-
- StrCpy $5 ''
- StrCpy $6 $0
- StrCpy $7 }
-
- StrCpy $9 ''
- StrCpy $R1 $R0
- StrCpy $3 $2 1
- StrCpy $2 $2 '' 1
- StrCmp $3 'E' 0 +3
- StrCpy $9 'E'
- goto -4
-
- StrCmp${_WORDFUNC_S} $3 '+' +2
- StrCmp${_WORDFUNC_S} $3 '-' 0 error3
- IntOp $2 $2 + 0
- StrCmp${_WORDFUNC_S} $2 0 error2
- StrCmp${_WORDFUNC_S} $0 '' error1
-
- StrCmp${_WORDFUNC_S} $2 1 0 two
- GetLabelAddress $8 oneback
- StrCmp${_WORDFUNC_S} $3 '+' call
- StrCpy $7 {
- goto call
- oneback:
- IfErrors 0 +2
- StrCpy $4 $R0
- StrCmp${_WORDFUNC_S} $3 '+' 0 +3
- StrCpy $R0 '$1$0$4'
- goto end
- StrCpy $R0 '$4$0$1'
- goto end
-
- two:
- IntOp $2 $2 - 1
- GetLabelAddress $8 twoback
- StrCmp${_WORDFUNC_S} $3 '+' 0 call
- StrCpy $7 {
- goto call
- twoback:
- IfErrors 0 tree
- StrCmp${_WORDFUNC_S} $2$4 11 0 error2
- StrCmp${_WORDFUNC_S} $3 '+' 0 +3
- StrCpy $R0 '$R0$0$1'
- goto end
- StrCpy $R0 '$1$0$R0'
- goto end
-
- tree:
- StrCpy $7 }
- StrCpy $5 $4
- IntOp $2 $2 + 1
- GetLabelAddress $8 treeback
- StrCmp${_WORDFUNC_S} $3 '+' call
- StrCpy $7 {
- goto call
- treeback:
- IfErrors 0 +3
- StrCpy $4 ''
- StrCpy $6 ''
- StrCmp${_WORDFUNC_S} $3 '+' 0 +3
- StrCpy $R0 '$5$0$1$6$4'
- goto end
- StrCpy $R0 '$4$6$1$0$5'
- goto end
-
- call:
- Push '$R0'
- Push '$0'
- Push 'E$3$2*$7'
- Call ${_WORDFUNC_UN}WordFind${_WORDFUNC_S}
- Pop $4
- goto $8
-
- error3:
- StrCpy $R0 3
- goto error
- error2:
- StrCpy $R0 2
- goto error
- error1:
- StrCpy $R0 1
- error:
- StrCmp $9 'E' +3
- StrCpy $R0 $R1
- goto +2
- SetErrors
-
- end:
- Pop $R1
- Pop $9
- Pop $8
- Pop $7
- Pop $6
- Pop $5
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Pop $0
- Exch $R0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro StrFilter
- !ifndef ${_WORDFUNC_UN}StrFilter${_WORDFUNC_S}
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !define ${_WORDFUNC_UN}StrFilter${_WORDFUNC_S} `!insertmacro ${_WORDFUNC_UN}StrFilter${_WORDFUNC_S}Call`
-
- Function ${_WORDFUNC_UN}StrFilter${_WORDFUNC_S}
- Exch $2
- Exch
- Exch $1
- Exch
- Exch 2
- Exch $0
- Exch 2
- Exch 3
- Exch $R0
- Exch 3
- Push $3
- Push $4
- Push $5
- Push $6
- Push $7
- Push $R1
- Push $R2
- Push $R3
- Push $R4
- Push $R5
- Push $R6
- Push $R7
- Push $R8
- ClearErrors
-
- StrCpy $R2 $0 '' -3
- StrCmp $R2 eng eng
- StrCmp $R2 rus rus
- eng:
- StrCpy $4 65
- StrCpy $5 90
- StrCpy $6 97
- StrCpy $7 122
- goto langend
- rus:
- StrCpy $4 192
- StrCpy $5 223
- StrCpy $6 224
- StrCpy $7 255
- goto langend
- ;...
-
- langend:
- StrCpy $R7 ''
- StrCpy $R8 ''
-
- StrCmp${_WORDFUNC_S} $2 '' 0 begin
-
- restart1:
- StrCpy $2 ''
- StrCpy $3 $0 1
- StrCmp${_WORDFUNC_S} $3 '+' +2
- StrCmp${_WORDFUNC_S} $3 '-' 0 +3
- StrCpy $0 $0 '' 1
- goto +2
- StrCpy $3 ''
-
- IntOp $0 $0 + 0
- StrCmp${_WORDFUNC_S} $0 0 +5
- StrCpy $R7 $0 1 0
- StrCpy $R8 $0 1 1
- StrCpy $R2 $0 1 2
- StrCmp${_WORDFUNC_S} $R2 '' filter error
-
- restart2:
- StrCmp${_WORDFUNC_S} $3 '' end
- StrCpy $R7 ''
- StrCpy $R8 '+-'
- goto begin
-
- filter:
- StrCmp${_WORDFUNC_S} $R7 '1' +3
- StrCmp${_WORDFUNC_S} $R7 '2' +2
- StrCmp${_WORDFUNC_S} $R7 '3' 0 error
-
- StrCmp${_WORDFUNC_S} $R8 '' begin
- StrCmp${_WORDFUNC_S} $R7$R8 '23' +2
- StrCmp${_WORDFUNC_S} $R7$R8 '32' 0 +3
- StrCpy $R7 -1
- goto begin
- StrCmp${_WORDFUNC_S} $R7$R8 '13' +2
- StrCmp${_WORDFUNC_S} $R7$R8 '31' 0 +3
- StrCpy $R7 -2
- goto begin
- StrCmp${_WORDFUNC_S} $R7$R8 '12' +2
- StrCmp${_WORDFUNC_S} $R7$R8 '21' 0 error
- StrCpy $R7 -3
-
- begin:
- StrCpy $R6 0
- StrCpy $R1 ''
-
- loop:
- StrCpy $R2 $R0 1 $R6
- StrCmp${_WORDFUNC_S} $R2 '' restartchk
-
- StrCmp${_WORDFUNC_S} $2 '' +7
- StrCpy $R4 0
- StrCpy $R5 $2 1 $R4
- StrCmp${_WORDFUNC_S} $R5 '' addsymbol
- StrCmp${_WORDFUNC_S} $R5 $R2 skipsymbol
- IntOp $R4 $R4 + 1
- goto -4
-
- StrCmp${_WORDFUNC_S} $1 '' +7
- StrCpy $R4 0
- StrCpy $R5 $1 1 $R4
- StrCmp${_WORDFUNC_S} $R5 '' +4
- StrCmp${_WORDFUNC_S} $R5 $R2 addsymbol
- IntOp $R4 $R4 + 1
- goto -4
-
- StrCmp${_WORDFUNC_S} $R7 '1' +2
- StrCmp${_WORDFUNC_S} $R7 '-1' 0 +4
- StrCpy $R4 48
- StrCpy $R5 57
- goto loop2
- StrCmp${_WORDFUNC_S} $R8 '+-' 0 +2
- StrCmp${_WORDFUNC_S} $3 '+' 0 +4
- StrCpy $R4 $4
- StrCpy $R5 $5
- goto loop2
- StrCpy $R4 $6
- StrCpy $R5 $7
-
- loop2:
- IntFmt $R3 '%c' $R4
- StrCmp $R2 $R3 found
- StrCmp $R4 $R5 notfound
- IntOp $R4 $R4 + 1
- goto loop2
-
- found:
- StrCmp${_WORDFUNC_S} $R8 '+-' setcase
- StrCmp${_WORDFUNC_S} $R7 '3' skipsymbol
- StrCmp${_WORDFUNC_S} $R7 '-3' addsymbol
- StrCmp${_WORDFUNC_S} $R8 '' addsymbol skipsymbol
-
- notfound:
- StrCmp${_WORDFUNC_S} $R8 '+-' addsymbol
- StrCmp${_WORDFUNC_S} $R7 '3' 0 +2
- StrCmp${_WORDFUNC_S} $R5 57 addsymbol +3
- StrCmp${_WORDFUNC_S} $R7 '-3' 0 +5
- StrCmp${_WORDFUNC_S} $R5 57 skipsymbol
- StrCpy $R4 48
- StrCpy $R5 57
- goto loop2
- StrCmp${_WORDFUNC_S} $R8 '' skipsymbol addsymbol
-
- setcase:
- StrCpy $R2 $R3
- addsymbol:
- StrCpy $R1 $R1$R2
- skipsymbol:
- IntOp $R6 $R6 + 1
- goto loop
-
- error:
- SetErrors
- StrCpy $R0 ''
- goto end
-
- restartchk:
- StrCpy $R0 $R1
- StrCmp${_WORDFUNC_S} $2 '' 0 restart1
- StrCmp${_WORDFUNC_S} $R8 '+-' 0 restart2
-
- end:
- Pop $R8
- Pop $R7
- Pop $R6
- Pop $R5
- Pop $R4
- Pop $R3
- Pop $R2
- Pop $R1
- Pop $7
- Pop $6
- Pop $5
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Pop $0
- Exch $R0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro VersionCompare
- !ifndef ${_WORDFUNC_UN}VersionCompare
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !define ${_WORDFUNC_UN}VersionCompare `!insertmacro ${_WORDFUNC_UN}VersionCompareCall`
-
- Function ${_WORDFUNC_UN}VersionCompare
- Exch $1
- Exch
- Exch $0
- Exch
- Push $2
- Push $3
- Push $4
- Push $5
- Push $6
- Push $7
-
- begin:
- StrCpy $2 -1
- IntOp $2 $2 + 1
- StrCpy $3 $0 1 $2
- StrCmp $3 '' +2
- StrCmp $3 '.' 0 -3
- StrCpy $4 $0 $2
- IntOp $2 $2 + 1
- StrCpy $0 $0 '' $2
-
- StrCpy $2 -1
- IntOp $2 $2 + 1
- StrCpy $3 $1 1 $2
- StrCmp $3 '' +2
- StrCmp $3 '.' 0 -3
- StrCpy $5 $1 $2
- IntOp $2 $2 + 1
- StrCpy $1 $1 '' $2
-
- StrCmp $4$5 '' equal
-
- StrCpy $6 -1
- IntOp $6 $6 + 1
- StrCpy $3 $4 1 $6
- StrCmp $3 '0' -2
- StrCmp $3 '' 0 +2
- StrCpy $4 0
-
- StrCpy $7 -1
- IntOp $7 $7 + 1
- StrCpy $3 $5 1 $7
- StrCmp $3 '0' -2
- StrCmp $3 '' 0 +2
- StrCpy $5 0
-
- StrCmp $4 0 0 +2
- StrCmp $5 0 begin newer2
- StrCmp $5 0 newer1
- IntCmp $6 $7 0 newer1 newer2
-
- StrCpy $4 '1$4'
- StrCpy $5 '1$5'
- IntCmp $4 $5 begin newer2 newer1
-
- equal:
- StrCpy $0 0
- goto end
- newer1:
- StrCpy $0 1
- goto end
- newer2:
- StrCpy $0 2
-
- end:
- Pop $7
- Pop $6
- Pop $5
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Exch $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-!macro VersionConvert
- !ifndef ${_WORDFUNC_UN}VersionConvert
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !define ${_WORDFUNC_UN}VersionConvert `!insertmacro ${_WORDFUNC_UN}VersionConvertCall`
-
- Function ${_WORDFUNC_UN}VersionConvert
- Exch $1
- Exch
- Exch $0
- Exch
- Push $2
- Push $3
- Push $4
- Push $5
- Push $6
- Push $7
-
- StrCmp $1 '' 0 +2
- StrCpy $1 'abcdefghijklmnopqrstuvwxyz'
- StrCpy $1 $1 99
-
- StrCpy $2 0
- StrCpy $7 'dot'
- goto loop
-
- preloop:
- IntOp $2 $2 + 1
-
- loop:
- StrCpy $3 $0 1 $2
- StrCmp $3 '' endcheck
- StrCmp $3 '.' dot
- StrCmp $3 '0' digit
- IntCmp $3 '0' letter letter digit
-
- dot:
- StrCmp $7 'dot' replacespecial
- StrCpy $7 'dot'
- goto preloop
-
- digit:
- StrCmp $7 'letter' insertdot
- StrCpy $7 'digit'
- goto preloop
-
- letter:
- StrCpy $5 0
- StrCpy $4 $1 1 $5
- IntOp $5 $5 + 1
- StrCmp $4 '' replacespecial
- StrCmp $4 $3 0 -3
- IntCmp $5 9 0 0 +2
- StrCpy $5 '0$5'
-
- StrCmp $7 'letter' +2
- StrCmp $7 'dot' 0 +3
- StrCpy $6 ''
- goto +2
- StrCpy $6 '.'
-
- StrCpy $4 $0 $2
- IntOp $2 $2 + 1
- StrCpy $0 $0 '' $2
- StrCpy $0 '$4$6$5$0'
- StrLen $4 '$6$5'
- IntOp $2 $2 + $4
- IntOp $2 $2 - 1
- StrCpy $7 'letter'
- goto loop
-
- replacespecial:
- StrCmp $7 'dot' 0 +3
- StrCpy $6 ''
- goto +2
- StrCpy $6 '.'
-
- StrCpy $4 $0 $2
- IntOp $2 $2 + 1
- StrCpy $0 $0 '' $2
- StrCpy $0 '$4$6$0'
- StrLen $4 $6
- IntOp $2 $2 + $4
- IntOp $2 $2 - 1
- StrCpy $7 'dot'
- goto loop
-
- insertdot:
- StrCpy $4 $0 $2
- StrCpy $0 $0 '' $2
- StrCpy $0 '$4.$0'
- StrCpy $7 'dot'
- goto preloop
-
- endcheck:
- StrCpy $4 $0 1 -1
- StrCmp $4 '.' 0 end
- StrCpy $0 $0 -1
- goto -3
-
- end:
- Pop $7
- Pop $6
- Pop $5
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Exch $0
- FunctionEnd
-
- !verbose pop
- !endif
-!macroend
-
-
-# Uninstall. Case insensitive. #
-
-!macro un.WordFindCall _STRING _DELIMITER _OPTION _RESULT
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- Push `${_STRING}`
- Push `${_DELIMITER}`
- Push `${_OPTION}`
- Call un.WordFind
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.WordFind2XCall _STRING _DELIMITER1 _DELIMITER2 _NUMBER _RESULT
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- Push `${_STRING}`
- Push `${_DELIMITER1}`
- Push `${_DELIMITER2}`
- Push `${_NUMBER}`
- Call un.WordFind2X
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.WordFind3XCall _STRING _DELIMITER1 _CENTER _DELIMITER2 _NUMBER _RESULT
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- Push `${_STRING}`
- Push `${_DELIMITER1}`
- Push `${_CENTER}`
- Push `${_DELIMITER2}`
- Push `${_NUMBER}`
- Call un.WordFind3X
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.WordReplaceCall _STRING _WORD1 _WORD2 _NUMBER _RESULT
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- Push `${_STRING}`
- Push `${_WORD1}`
- Push `${_WORD2}`
- Push `${_NUMBER}`
- Call un.WordReplace
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.WordAddCall _STRING1 _DELIMITER _STRING2 _RESULT
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- Push `${_STRING1}`
- Push `${_DELIMITER}`
- Push `${_STRING2}`
- Call un.WordAdd
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.WordInsertCall _STRING _DELIMITER _WORD _NUMBER _RESULT
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- Push `${_STRING}`
- Push `${_DELIMITER}`
- Push `${_WORD}`
- Push `${_NUMBER}`
- Call un.WordInsert
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.StrFilterCall _STRING _FILTER _INCLUDE _EXCLUDE _RESULT
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- Push `${_STRING}`
- Push `${_FILTER}`
- Push `${_INCLUDE}`
- Push `${_EXCLUDE}`
- Call un.StrFilter
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.VersionCompareCall _VER1 _VER2 _RESULT
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- Push `${_VER1}`
- Push `${_VER2}`
- Call un.VersionCompare
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.VersionConvertCall _VERSION _CHARLIST _RESULT
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- Push `${_VERSION}`
- Push `${_CHARLIST}`
- Call un.VersionConvert
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-
-!macro un.WordFind
- !ifndef un.WordFind
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN `un.`
-
- !insertmacro WordFind
-
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN
- !verbose pop
- !endif
-!macroend
-
-!macro un.WordFind2X
- !ifndef un.WordFind2X
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN `un.`
-
- !insertmacro WordFind2X
-
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN
- !verbose pop
- !endif
-!macroend
-
-!macro un.WordFind3X
- !ifndef un.WordFind3X
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN `un.`
-
- !insertmacro WordFind3X
-
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN
- !verbose pop
- !endif
-!macroend
-
-!macro un.WordReplace
- !ifndef un.WordReplace
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN `un.`
-
- !insertmacro WordReplace
-
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN
- !verbose pop
- !endif
-!macroend
-
-!macro un.WordAdd
- !ifndef un.WordAdd
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN `un.`
-
- !insertmacro WordAdd
-
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN
- !verbose pop
- !endif
-!macroend
-
-!macro un.WordInsert
- !ifndef un.WordInsert
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN `un.`
-
- !insertmacro WordInsert
-
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN
- !verbose pop
- !endif
-!macroend
-
-!macro un.StrFilter
- !ifndef un.StrFilter
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN `un.`
-
- !insertmacro StrFilter
-
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN
- !verbose pop
- !endif
-!macroend
-
-!macro un.VersionCompare
- !ifndef un.VersionCompare
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN `un.`
-
- !insertmacro VersionCompare
-
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN
- !verbose pop
- !endif
-!macroend
-
-!macro un.VersionConvert
- !ifndef un.VersionConvert
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN `un.`
-
- !insertmacro VersionConvert
-
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN
- !verbose pop
- !endif
-!macroend
-
-
-# Install. Case sensitive. #
-
-!macro WordFindSCall _STRING _DELIMITER _OPTION _RESULT
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- Push `${_STRING}`
- Push `${_DELIMITER}`
- Push `${_OPTION}`
- Call WordFindS
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro WordFind2XSCall _STRING _DELIMITER1 _DELIMITER2 _NUMBER _RESULT
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- Push `${_STRING}`
- Push `${_DELIMITER1}`
- Push `${_DELIMITER2}`
- Push `${_NUMBER}`
- Call WordFind2XS
+ ${CallArtificialFunction} WordFind3X_
Pop ${_RESULT}
!verbose pop
!macroend
@@ -1829,7 +139,19 @@ VersionConvert
Push `${_CENTER}`
Push `${_DELIMITER2}`
Push `${_NUMBER}`
- Call WordFind3XS
+ ${CallArtificialFunction} WordFind3XS_
+ Pop ${_RESULT}
+ !verbose pop
+!macroend
+
+!macro WordReplaceCall _STRING _WORD1 _WORD2 _NUMBER _RESULT
+ !verbose push
+ !verbose ${_WORDFUNC_VERBOSE}
+ Push `${_STRING}`
+ Push `${_WORD1}`
+ Push `${_WORD2}`
+ Push `${_NUMBER}`
+ ${CallArtificialFunction} WordReplace_
Pop ${_RESULT}
!verbose pop
!macroend
@@ -1841,7 +163,18 @@ VersionConvert
Push `${_WORD1}`
Push `${_WORD2}`
Push `${_NUMBER}`
- Call WordReplaceS
+ ${CallArtificialFunction} WordReplaceS_
+ Pop ${_RESULT}
+ !verbose pop
+!macroend
+
+!macro WordAddCall _STRING1 _DELIMITER _STRING2 _RESULT
+ !verbose push
+ !verbose ${_WORDFUNC_VERBOSE}
+ Push `${_STRING1}`
+ Push `${_DELIMITER}`
+ Push `${_STRING2}`
+ ${CallArtificialFunction} WordAdd_
Pop ${_RESULT}
!verbose pop
!macroend
@@ -1852,7 +185,19 @@ VersionConvert
Push `${_STRING1}`
Push `${_DELIMITER}`
Push `${_STRING2}`
- Call WordAddS
+ ${CallArtificialFunction} WordAddS_
+ Pop ${_RESULT}
+ !verbose pop
+!macroend
+
+!macro WordInsertCall _STRING _DELIMITER _WORD _NUMBER _RESULT
+ !verbose push
+ !verbose ${_WORDFUNC_VERBOSE}
+ Push `${_STRING}`
+ Push `${_DELIMITER}`
+ Push `${_WORD}`
+ Push `${_NUMBER}`
+ ${CallArtificialFunction} WordInsert_
Pop ${_RESULT}
!verbose pop
!macroend
@@ -1864,7 +209,19 @@ VersionConvert
Push `${_DELIMITER}`
Push `${_WORD}`
Push `${_NUMBER}`
- Call WordInsertS
+ ${CallArtificialFunction} WordInsertS_
+ Pop ${_RESULT}
+ !verbose pop
+!macroend
+
+!macro StrFilterCall _STRING _FILTER _INCLUDE _EXCLUDE _RESULT
+ !verbose push
+ !verbose ${_WORDFUNC_VERBOSE}
+ Push `${_STRING}`
+ Push `${_FILTER}`
+ Push `${_INCLUDE}`
+ Push `${_EXCLUDE}`
+ ${CallArtificialFunction} StrFilter_
Pop ${_RESULT}
!verbose pop
!macroend
@@ -1876,333 +233,1571 @@ VersionConvert
Push `${_FILTER}`
Push `${_INCLUDE}`
Push `${_EXCLUDE}`
- Call StrFilterS
+ ${CallArtificialFunction} StrFilterS_
Pop ${_RESULT}
!verbose pop
!macroend
+!macro VersionCompareCall _VER1 _VER2 _RESULT
+ !verbose push
+ !verbose ${_WORDFUNC_VERBOSE}
+ Push `${_VER1}`
+ Push `${_VER2}`
+ ${CallArtificialFunction} VersionCompare_
+ Pop ${_RESULT}
+ !verbose pop
+!macroend
+
+!macro VersionConvertCall _VERSION _CHARLIST _RESULT
+ !verbose push
+ !verbose ${_WORDFUNC_VERBOSE}
+ Push `${_VERSION}`
+ Push `${_CHARLIST}`
+ ${CallArtificialFunction} VersionConvert_
+ Pop ${_RESULT}
+ !verbose pop
+!macroend
+
+!macro WordFindBody _WORDFUNC_S
+ Exch $1
+ Exch
+ Exch $0
+ Exch
+ Exch 2
+ Exch $R0
+ Exch 2
+ Push $2
+ Push $3
+ Push $4
+ Push $5
+ Push $6
+ Push $7
+ Push $8
+ Push $9
+ Push $R1
+ Push $R2
+ ClearErrors
+
+ StrCpy $9 ''
+ StrCpy $2 $1 1
+ StrCpy $1 $1 '' 1
+ StrCmp $2 'E' 0 +3
+ StrCpy $9 E
+ goto -4
+
+ StrCpy $3 ''
+ StrCmp${_WORDFUNC_S} $2 '+' +6
+ StrCmp${_WORDFUNC_S} $2 '-' +5
+ StrCmp${_WORDFUNC_S} $2 '/' WordFunc_WordFind${_WORDFUNC_S}_restart
+ StrCmp${_WORDFUNC_S} $2 '#' WordFunc_WordFind${_WORDFUNC_S}_restart
+ StrCmp${_WORDFUNC_S} $2 '*' WordFunc_WordFind${_WORDFUNC_S}_restart
+ goto WordFunc_WordFind${_WORDFUNC_S}_error3
+
+ StrCpy $4 $1 1 -1
+ StrCmp${_WORDFUNC_S} $4 '*' +4
+ StrCmp${_WORDFUNC_S} $4 '}' +3
+ StrCmp${_WORDFUNC_S} $4 '{' +2
+ goto +4
+ StrCpy $1 $1 -1
+ StrCpy $3 '$4$3'
+ goto -7
+ StrCmp${_WORDFUNC_S} $3 '*' WordFunc_WordFind${_WORDFUNC_S}_error3
+ StrCmp${_WORDFUNC_S} $3 '**' WordFunc_WordFind${_WORDFUNC_S}_error3
+ StrCmp${_WORDFUNC_S} $3 '}{' WordFunc_WordFind${_WORDFUNC_S}_error3
+ IntOp $1 $1 + 0
+ StrCmp${_WORDFUNC_S} $1 0 WordFunc_WordFind${_WORDFUNC_S}_error2
+
+ WordFunc_WordFind${_WORDFUNC_S}_restart:
+ StrCmp${_WORDFUNC_S} $R0 '' WordFunc_WordFind${_WORDFUNC_S}_error1
+ StrCpy $4 0
+ StrCpy $5 0
+ StrCpy $6 0
+ StrLen $7 $0
+ goto WordFunc_WordFind${_WORDFUNC_S}_loop
+
+ WordFunc_WordFind${_WORDFUNC_S}_preloop:
+ IntOp $6 $6 + 1
+
+ WordFunc_WordFind${_WORDFUNC_S}_loop:
+ StrCpy $8 $R0 $7 $6
+ StrCmp${_WORDFUNC_S} $8$5 0 WordFunc_WordFind${_WORDFUNC_S}_error1
+ StrLen $R2 $8
+ IntCmp $R2 0 +2
+ StrCmp${_WORDFUNC_S} $8 $0 +5 WordFunc_WordFind${_WORDFUNC_S}_preloop
+ StrCmp${_WORDFUNC_S} $3 '{' WordFunc_WordFind${_WORDFUNC_S}_minus
+ StrCmp${_WORDFUNC_S} $3 '}' WordFunc_WordFind${_WORDFUNC_S}_minus
+ StrCmp${_WORDFUNC_S} $2 '*' WordFunc_WordFind${_WORDFUNC_S}_minus
+ StrCmp${_WORDFUNC_S} $5 $6 WordFunc_WordFind${_WORDFUNC_S}_minus +5
+ StrCmp${_WORDFUNC_S} $3 '{' +4
+ StrCmp${_WORDFUNC_S} $3 '}' +3
+ StrCmp${_WORDFUNC_S} $2 '*' +2
+ StrCmp${_WORDFUNC_S} $5 $6 WordFunc_WordFind${_WORDFUNC_S}_nextword
+ IntOp $4 $4 + 1
+ StrCmp${_WORDFUNC_S} $2$4 +$1 WordFunc_WordFind${_WORDFUNC_S}_plus
+ StrCmp${_WORDFUNC_S} $2 '/' 0 WordFunc_WordFind${_WORDFUNC_S}_nextword
+ IntOp $8 $6 - $5
+ StrCpy $8 $R0 $8 $5
+ StrCmp${_WORDFUNC_S} $1 $8 0 WordFunc_WordFind${_WORDFUNC_S}_nextword
+ StrCpy $R1 $4
+ goto WordFunc_WordFind${_WORDFUNC_S}_end
+ WordFunc_WordFind${_WORDFUNC_S}_nextword:
+ IntOp $6 $6 + $7
+ StrCpy $5 $6
+ goto WordFunc_WordFind${_WORDFUNC_S}_loop
+
+ WordFunc_WordFind${_WORDFUNC_S}_minus:
+ StrCmp${_WORDFUNC_S} $2 '-' 0 WordFunc_WordFind${_WORDFUNC_S}_sum
+ StrCpy $2 '+'
+ IntOp $1 $4 - $1
+ IntOp $1 $1 + 1
+ IntCmp $1 0 WordFunc_WordFind${_WORDFUNC_S}_error2 WordFunc_WordFind${_WORDFUNC_S}_error2 WordFunc_WordFind${_WORDFUNC_S}_restart
+ WordFunc_WordFind${_WORDFUNC_S}_sum:
+ StrCmp${_WORDFUNC_S} $2 '#' 0 WordFunc_WordFind${_WORDFUNC_S}_sumdelim
+ StrCpy $R1 $4
+ goto WordFunc_WordFind${_WORDFUNC_S}_end
+ WordFunc_WordFind${_WORDFUNC_S}_sumdelim:
+ StrCmp${_WORDFUNC_S} $2 '*' 0 WordFunc_WordFind${_WORDFUNC_S}_error2
+ StrCpy $R1 $4
+ goto WordFunc_WordFind${_WORDFUNC_S}_end
+
+ WordFunc_WordFind${_WORDFUNC_S}_plus:
+ StrCmp${_WORDFUNC_S} $3 '' 0 +4
+ IntOp $6 $6 - $5
+ StrCpy $R1 $R0 $6 $5
+ goto WordFunc_WordFind${_WORDFUNC_S}_end
+ StrCmp${_WORDFUNC_S} $3 '{' 0 +3
+ StrCpy $R1 $R0 $6
+ goto WordFunc_WordFind${_WORDFUNC_S}_end
+ StrCmp${_WORDFUNC_S} $3 '}' 0 +4
+ IntOp $6 $6 + $7
+ StrCpy $R1 $R0 '' $6
+ goto WordFunc_WordFind${_WORDFUNC_S}_end
+ StrCmp${_WORDFUNC_S} $3 '{*' +2
+ StrCmp${_WORDFUNC_S} $3 '*{' 0 +3
+ StrCpy $R1 $R0 $6
+ goto WordFunc_WordFind${_WORDFUNC_S}_end
+ StrCmp${_WORDFUNC_S} $3 '*}' +2
+ StrCmp${_WORDFUNC_S} $3 '}*' 0 +3
+ StrCpy $R1 $R0 '' $5
+ goto WordFunc_WordFind${_WORDFUNC_S}_end
+ StrCmp${_WORDFUNC_S} $3 '}}' 0 +3
+ StrCpy $R1 $R0 '' $6
+ goto WordFunc_WordFind${_WORDFUNC_S}_end
+ StrCmp${_WORDFUNC_S} $3 '{{' 0 +3
+ StrCpy $R1 $R0 $5
+ goto WordFunc_WordFind${_WORDFUNC_S}_end
+ StrCmp${_WORDFUNC_S} $3 '{}' 0 WordFunc_WordFind${_WORDFUNC_S}_error3
+ StrLen $3 $R0
+ StrCmp${_WORDFUNC_S} $3 $6 0 +3
+ StrCpy $0 ''
+ goto +2
+ IntOp $6 $6 + $7
+ StrCpy $8 $R0 '' $6
+ StrCmp${_WORDFUNC_S} $4$8 1 +6
+ StrCmp${_WORDFUNC_S} $4 1 +2 +7
+ IntOp $6 $6 + $7
+ StrCpy $3 $R0 $7 $6
+ StrCmp${_WORDFUNC_S} $3 '' +2
+ StrCmp${_WORDFUNC_S} $3 $0 -3 +3
+ StrCpy $R1 ''
+ goto WordFunc_WordFind${_WORDFUNC_S}_end
+ StrCmp${_WORDFUNC_S} $5 0 0 +3
+ StrCpy $0 ''
+ goto +2
+ IntOp $5 $5 - $7
+ StrCpy $3 $R0 $5
+ StrCpy $R1 '$3$0$8'
+ goto WordFunc_WordFind${_WORDFUNC_S}_end
+
+ WordFunc_WordFind${_WORDFUNC_S}_error3:
+ StrCpy $R1 3
+ goto WordFunc_WordFind${_WORDFUNC_S}_error
+ WordFunc_WordFind${_WORDFUNC_S}_error2:
+ StrCpy $R1 2
+ goto WordFunc_WordFind${_WORDFUNC_S}_error
+ WordFunc_WordFind${_WORDFUNC_S}_error1:
+ StrCpy $R1 1
+ WordFunc_WordFind${_WORDFUNC_S}_error:
+ StrCmp $9 'E' 0 +3
+ SetErrors
+
+ WordFunc_WordFind${_WORDFUNC_S}_end:
+ StrCpy $R0 $R1
+
+ Pop $R2
+ Pop $R1
+ Pop $9
+ Pop $8
+ Pop $7
+ Pop $6
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Pop $0
+ Exch $R0
+!macroend
+
+!define WordFind `!insertmacro WordFindCall ''`
+!define un.WordFind `!insertmacro WordFindCall ''`
+
+!macro WordFind
+!macroend
+
+!macro un.WordFind
+!macroend
+
+!macro WordFind_
+ !verbose push
+ !verbose ${_WORDFUNC_VERBOSE}
+
+ !insertmacro WordFindBody ''
+
+ !verbose pop
+!macroend
+
+!define WordFindS `!insertmacro WordFindSCall ''`
+!define un.WordFindS `!insertmacro WordFindSCall ''`
+
!macro WordFindS
- !ifndef WordFindS
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_S
- !define _WORDFUNC_S `S`
-
- !insertmacro WordFind
-
- !undef _WORDFUNC_S
- !define _WORDFUNC_S
- !verbose pop
- !endif
-!macroend
-
-!macro WordFind2XS
- !ifndef WordFind2XS
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_S
- !define _WORDFUNC_S `S`
-
- !insertmacro WordFind2X
-
- !undef _WORDFUNC_S
- !define _WORDFUNC_S
- !verbose pop
- !endif
-!macroend
-
-!macro WordFind3XS
- !ifndef WordFind3XS
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_S
- !define _WORDFUNC_S `S`
-
- !insertmacro WordFind3X
-
- !undef _WORDFUNC_S
- !define _WORDFUNC_S
- !verbose pop
- !endif
-!macroend
-
-!macro WordReplaceS
- !ifndef WordReplaceS
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_S
- !define _WORDFUNC_S `S`
-
- !insertmacro WordReplace
-
- !undef _WORDFUNC_S
- !define _WORDFUNC_S
- !verbose pop
- !endif
-!macroend
-
-!macro WordAddS
- !ifndef WordAddS
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_S
- !define _WORDFUNC_S `S`
-
- !insertmacro WordAdd
-
- !undef _WORDFUNC_S
- !define _WORDFUNC_S
- !verbose pop
- !endif
-!macroend
-
-!macro WordInsertS
- !ifndef WordInsertS
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_S
- !define _WORDFUNC_S `S`
-
- !insertmacro WordInsert
-
- !undef _WORDFUNC_S
- !define _WORDFUNC_S
- !verbose pop
- !endif
-!macroend
-
-!macro StrFilterS
- !ifndef StrFilterS
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_S
- !define _WORDFUNC_S `S`
-
- !insertmacro StrFilter
-
- !undef _WORDFUNC_S
- !define _WORDFUNC_S
- !verbose pop
- !endif
-!macroend
-
-
-# Uninstall. Case sensitive. #
-
-!macro un.WordFindSCall _STRING _DELIMITER _OPTION _RESULT
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- Push `${_STRING}`
- Push `${_DELIMITER}`
- Push `${_OPTION}`
- Call un.WordFindS
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.WordFind2XSCall _STRING _DELIMITER1 _DELIMITER2 _NUMBER _RESULT
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- Push `${_STRING}`
- Push `${_DELIMITER1}`
- Push `${_DELIMITER2}`
- Push `${_NUMBER}`
- Call un.WordFind2XS
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.WordFind3XSCall _STRING _DELIMITER1 _CENTER _DELIMITER2 _NUMBER _RESULT
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- Push `${_STRING}`
- Push `${_DELIMITER1}`
- Push `${_CENTER}`
- Push `${_DELIMITER2}`
- Push `${_NUMBER}`
- Call un.WordFind3XS
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.WordReplaceSCall _STRING _WORD1 _WORD2 _NUMBER _RESULT
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- Push `${_STRING}`
- Push `${_WORD1}`
- Push `${_WORD2}`
- Push `${_NUMBER}`
- Call un.WordReplaceS
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.WordAddSCall _STRING1 _DELIMITER _STRING2 _RESULT
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- Push `${_STRING1}`
- Push `${_DELIMITER}`
- Push `${_STRING2}`
- Call un.WordAddS
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.WordInsertSCall _STRING _DELIMITER _WORD _NUMBER _RESULT
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- Push `${_STRING}`
- Push `${_DELIMITER}`
- Push `${_WORD}`
- Push `${_NUMBER}`
- Call un.WordInsertS
- Pop ${_RESULT}
- !verbose pop
-!macroend
-
-!macro un.StrFilterSCall _STRING _FILTER _INCLUDE _EXCLUDE _RESULT
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- Push `${_STRING}`
- Push `${_FILTER}`
- Push `${_INCLUDE}`
- Push `${_EXCLUDE}`
- Call un.StrFilterS
- Pop ${_RESULT}
- !verbose pop
!macroend
!macro un.WordFindS
- !ifndef un.WordFindS
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_S
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN `un.`
- !define _WORDFUNC_S `S`
+!macroend
- !insertmacro WordFind
+!macro WordFindS_
+ !verbose push
+ !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN
- !undef _WORDFUNC_S
- !define _WORDFUNC_S
- !verbose pop
- !endif
+ !insertmacro WordFindBody 'S'
+
+ !verbose pop
+!macroend
+
+!macro WordFind2XBody _WORDFUNC_S
+ Exch $2
+ Exch
+ Exch $1
+ Exch
+ Exch 2
+ Exch $0
+ Exch 2
+ Exch 3
+ Exch $R0
+ Exch 3
+ Push $3
+ Push $4
+ Push $5
+ Push $6
+ Push $7
+ Push $8
+ Push $9
+ Push $R1
+ Push $R2
+ ClearErrors
+
+ StrCpy $R2 ''
+ StrCpy $3 $2 1
+ StrCpy $2 $2 '' 1
+ StrCmp $3 'E' 0 +3
+ StrCpy $R2 E
+ goto -4
+
+ StrCmp${_WORDFUNC_S} $3 '+' +5
+ StrCmp${_WORDFUNC_S} $3 '-' +4
+ StrCmp${_WORDFUNC_S} $3 '#' WordFunc_WordFind2X${_WORDFUNC_S}_restart
+ StrCmp${_WORDFUNC_S} $3 '/' WordFunc_WordFind2X${_WORDFUNC_S}_restart
+ goto WordFunc_WordFind2X${_WORDFUNC_S}_error3
+
+ StrCpy $4 $2 2 -2
+ StrCmp${_WORDFUNC_S} $4 '{{' +9
+ StrCmp${_WORDFUNC_S} $4 '}}' +8
+ StrCmp${_WORDFUNC_S} $4 '{*' +7
+ StrCmp${_WORDFUNC_S} $4 '*{' +6
+ StrCmp${_WORDFUNC_S} $4 '*}' +5
+ StrCmp${_WORDFUNC_S} $4 '}*' +4
+ StrCmp${_WORDFUNC_S} $4 '{}' +3
+ StrCpy $4 ''
+ goto +2
+ StrCpy $2 $2 -2
+ IntOp $2 $2 + 0
+ StrCmp${_WORDFUNC_S} $2 0 WordFunc_WordFind2X${_WORDFUNC_S}_error2
+
+ WordFunc_WordFind2X${_WORDFUNC_S}_restart:
+ StrCmp${_WORDFUNC_S} $R0 '' WordFunc_WordFind2X${_WORDFUNC_S}_error1
+ StrCpy $5 -1
+ StrCpy $6 0
+ StrCpy $7 ''
+ StrLen $8 $0
+ StrLen $9 $1
+
+ WordFunc_WordFind2X${_WORDFUNC_S}_loop:
+ IntOp $5 $5 + 1
+
+ WordFunc_WordFind2X${_WORDFUNC_S}_delim1:
+ StrCpy $R1 $R0 $8 $5
+ StrCmp${_WORDFUNC_S} $R1$6 0 WordFunc_WordFind2X${_WORDFUNC_S}_error1
+ StrCmp${_WORDFUNC_S} $R1 '' WordFunc_WordFind2X${_WORDFUNC_S}_minus
+ StrCmp${_WORDFUNC_S} $R1 $0 +2
+ StrCmp${_WORDFUNC_S} $7 '' WordFunc_WordFind2X${_WORDFUNC_S}_loop WordFunc_WordFind2X${_WORDFUNC_S}_delim2
+ StrCmp${_WORDFUNC_S} $0 $1 0 +2
+ StrCmp${_WORDFUNC_S} $7 '' 0 WordFunc_WordFind2X${_WORDFUNC_S}_delim2
+ IntOp $7 $5 + $8
+ StrCpy $5 $7
+ goto WordFunc_WordFind2X${_WORDFUNC_S}_delim1
+
+ WordFunc_WordFind2X${_WORDFUNC_S}_delim2:
+ StrCpy $R1 $R0 $9 $5
+ StrCmp${_WORDFUNC_S} $R1 $1 0 WordFunc_WordFind2X${_WORDFUNC_S}_loop
+ IntOp $6 $6 + 1
+ StrCmp${_WORDFUNC_S} $3$6 '+$2' WordFunc_WordFind2X${_WORDFUNC_S}_plus
+ StrCmp${_WORDFUNC_S} $3 '/' 0 WordFunc_WordFind2X${_WORDFUNC_S}_nextword
+ IntOp $R1 $5 - $7
+ StrCpy $R1 $R0 $R1 $7
+ StrCmp${_WORDFUNC_S} $R1 $2 0 +3
+ StrCpy $R1 $6
+ goto WordFunc_WordFind2X${_WORDFUNC_S}_end
+ WordFunc_WordFind2X${_WORDFUNC_S}_nextword:
+ IntOp $5 $5 + $9
+ StrCpy $7 ''
+ goto WordFunc_WordFind2X${_WORDFUNC_S}_delim1
+
+ WordFunc_WordFind2X${_WORDFUNC_S}_minus:
+ StrCmp${_WORDFUNC_S} $3 '-' 0 WordFunc_WordFind2X${_WORDFUNC_S}_sum
+ StrCpy $3 +
+ IntOp $2 $6 - $2
+ IntOp $2 $2 + 1
+ IntCmp $2 0 WordFunc_WordFind2X${_WORDFUNC_S}_error2 WordFunc_WordFind2X${_WORDFUNC_S}_error2 WordFunc_WordFind2X${_WORDFUNC_S}_restart
+ WordFunc_WordFind2X${_WORDFUNC_S}_sum:
+ StrCmp${_WORDFUNC_S} $3 '#' 0 WordFunc_WordFind2X${_WORDFUNC_S}_error2
+ StrCpy $R1 $6
+ goto WordFunc_WordFind2X${_WORDFUNC_S}_end
+
+ WordFunc_WordFind2X${_WORDFUNC_S}_plus:
+ StrCmp${_WORDFUNC_S} $4 '' 0 +4
+ IntOp $R1 $5 - $7
+ StrCpy $R1 $R0 $R1 $7
+ goto WordFunc_WordFind2X${_WORDFUNC_S}_end
+ IntOp $5 $5 + $9
+ IntOp $7 $7 - $8
+ StrCmp${_WORDFUNC_S} $4 '{*' +2
+ StrCmp${_WORDFUNC_S} $4 '*{' 0 +3
+ StrCpy $R1 $R0 $5
+ goto WordFunc_WordFind2X${_WORDFUNC_S}_end
+ StrCmp${_WORDFUNC_S} $4 '*}' +2
+ StrCmp${_WORDFUNC_S} $4 '}*' 0 +3
+ StrCpy $R1 $R0 '' $7
+ goto WordFunc_WordFind2X${_WORDFUNC_S}_end
+ StrCmp${_WORDFUNC_S} $4 '}}' 0 +3
+ StrCpy $R1 $R0 '' $5
+ goto WordFunc_WordFind2X${_WORDFUNC_S}_end
+ StrCmp${_WORDFUNC_S} $4 '{{' 0 +3
+ StrCpy $R1 $R0 $7
+ goto WordFunc_WordFind2X${_WORDFUNC_S}_end
+ StrCmp${_WORDFUNC_S} $4 '{}' 0 WordFunc_WordFind2X${_WORDFUNC_S}_error3
+ StrCpy $5 $R0 '' $5
+ StrCpy $7 $R0 $7
+ StrCpy $R1 '$7$5'
+ goto WordFunc_WordFind2X${_WORDFUNC_S}_end
+
+ WordFunc_WordFind2X${_WORDFUNC_S}_error3:
+ StrCpy $R1 3
+ goto WordFunc_WordFind2X${_WORDFUNC_S}_error
+ WordFunc_WordFind2X${_WORDFUNC_S}_error2:
+ StrCpy $R1 2
+ goto WordFunc_WordFind2X${_WORDFUNC_S}_error
+ WordFunc_WordFind2X${_WORDFUNC_S}_error1:
+ StrCpy $R1 1
+ WordFunc_WordFind2X${_WORDFUNC_S}_error:
+ StrCmp $R2 'E' 0 +3
+ SetErrors
+
+ WordFunc_WordFind2X${_WORDFUNC_S}_end:
+ StrCpy $R0 $R1
+
+ Pop $R2
+ Pop $R1
+ Pop $9
+ Pop $8
+ Pop $7
+ Pop $6
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Pop $0
+ Exch $R0
+!macroend
+
+!define WordFind2X `!insertmacro WordFind2XCall`
+!define un.WordFind2X `!insertmacro WordFind2XCall`
+
+!macro WordFind2X
+!macroend
+
+!macro un.WordFind2X
+!macroend
+
+!macro WordFind2X_
+ !verbose push
+ !verbose ${_WORDFUNC_VERBOSE}
+
+ !insertmacro WordFind2XBody ''
+
+ !verbose pop
+!macroend
+
+!define WordFind2XS `!insertmacro WordFind2XSCall`
+!define un.WordFind2XS `!insertmacro WordFind2XSCall`
+
+!macro WordFind2XS
!macroend
!macro un.WordFind2XS
- !ifndef un.WordFind2XS
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN `un.`
- !undef _WORDFUNC_S
- !define _WORDFUNC_S `S`
+!macroend
- !insertmacro WordFind2X
+!macro WordFind2XS_
+ !verbose push
+ !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN
- !undef _WORDFUNC_S
- !define _WORDFUNC_S
- !verbose pop
- !endif
+ !insertmacro WordFind2XBody 'S'
+
+ !verbose pop
+!macroend
+
+!macro WordFind3XBody _WORDFUNC_S
+ Exch $3
+ Exch
+ Exch $2
+ Exch
+ Exch 2
+ Exch $1
+ Exch 2
+ Exch 3
+ Exch $0
+ Exch 3
+ Exch 4
+ Exch $R0
+ Exch 4
+ Push $4
+ Push $5
+ Push $6
+ Push $7
+ Push $8
+ Push $9
+ Push $R1
+ Push $R2
+ Push $R3
+ Push $R4
+ Push $R5
+ ClearErrors
+
+ StrCpy $R5 ''
+ StrCpy $4 $3 1
+ StrCpy $3 $3 '' 1
+ StrCmp $4 'E' 0 +3
+ StrCpy $R5 E
+ goto -4
+
+ StrCmp${_WORDFUNC_S} $4 '+' +5
+ StrCmp${_WORDFUNC_S} $4 '-' +4
+ StrCmp${_WORDFUNC_S} $4 '#' WordFunc_WordFind3X${_WORDFUNC_S}_restart
+ StrCmp${_WORDFUNC_S} $4 '/' WordFunc_WordFind3X${_WORDFUNC_S}_restart
+ goto WordFunc_WordFind3X${_WORDFUNC_S}_error3
+
+ StrCpy $5 $3 2 -2
+ StrCmp${_WORDFUNC_S} $5 '{{' +9
+ StrCmp${_WORDFUNC_S} $5 '}}' +8
+ StrCmp${_WORDFUNC_S} $5 '{*' +7
+ StrCmp${_WORDFUNC_S} $5 '*{' +6
+ StrCmp${_WORDFUNC_S} $5 '*}' +5
+ StrCmp${_WORDFUNC_S} $5 '}*' +4
+ StrCmp${_WORDFUNC_S} $5 '{}' +3
+ StrCpy $5 ''
+ goto +2
+ StrCpy $3 $3 -2
+ IntOp $3 $3 + 0
+ StrCmp${_WORDFUNC_S} $3 0 WordFunc_WordFind3X${_WORDFUNC_S}_error2
+
+ WordFunc_WordFind3X${_WORDFUNC_S}_restart:
+ StrCmp${_WORDFUNC_S} $R0 '' WordFunc_WordFind3X${_WORDFUNC_S}_error1
+ StrCpy $6 -1
+ StrCpy $7 0
+ StrCpy $8 ''
+ StrCpy $9 ''
+ StrLen $R1 $0
+ StrLen $R2 $1
+ StrLen $R3 $2
+
+ WordFunc_WordFind3X${_WORDFUNC_S}_loop:
+ IntOp $6 $6 + 1
+
+ WordFunc_WordFind3X${_WORDFUNC_S}_delim1:
+ StrCpy $R4 $R0 $R1 $6
+ StrCmp${_WORDFUNC_S} $R4$7 0 WordFunc_WordFind3X${_WORDFUNC_S}_error1
+ StrCmp${_WORDFUNC_S} $R4 '' WordFunc_WordFind3X${_WORDFUNC_S}_minus
+ StrCmp${_WORDFUNC_S} $R4 $0 +2
+ StrCmp${_WORDFUNC_S} $8 '' WordFunc_WordFind3X${_WORDFUNC_S}_loop WordFunc_WordFind3X${_WORDFUNC_S}_center
+ StrCmp${_WORDFUNC_S} $0 $1 +2
+ StrCmp${_WORDFUNC_S} $0 $2 0 +2
+ StrCmp${_WORDFUNC_S} $8 '' 0 WordFunc_WordFind3X${_WORDFUNC_S}_center
+ IntOp $8 $6 + $R1
+ StrCpy $6 $8
+ goto WordFunc_WordFind3X${_WORDFUNC_S}_delim1
+
+ WordFunc_WordFind3X${_WORDFUNC_S}_center:
+ StrCmp${_WORDFUNC_S} $9 '' 0 WordFunc_WordFind3X${_WORDFUNC_S}_delim2
+ StrCpy $R4 $R0 $R2 $6
+ StrCmp${_WORDFUNC_S} $R4 $1 0 WordFunc_WordFind3X${_WORDFUNC_S}_loop
+ IntOp $9 $6 + $R2
+ StrCpy $6 $9
+ goto WordFunc_WordFind3X${_WORDFUNC_S}_delim1
+
+ WordFunc_WordFind3X${_WORDFUNC_S}_delim2:
+ StrCpy $R4 $R0 $R3 $6
+ StrCmp${_WORDFUNC_S} $R4 $2 0 WordFunc_WordFind3X${_WORDFUNC_S}_loop
+ IntOp $7 $7 + 1
+ StrCmp${_WORDFUNC_S} $4$7 '+$3' WordFunc_WordFind3X${_WORDFUNC_S}_plus
+ StrCmp${_WORDFUNC_S} $4 '/' 0 WordFunc_WordFind3X${_WORDFUNC_S}_nextword
+ IntOp $R4 $6 - $8
+ StrCpy $R4 $R0 $R4 $8
+ StrCmp${_WORDFUNC_S} $R4 $3 0 +3
+ StrCpy $R4 $7
+ goto WordFunc_WordFind3X${_WORDFUNC_S}_end
+ WordFunc_WordFind3X${_WORDFUNC_S}_nextword:
+ IntOp $6 $6 + $R3
+ StrCpy $8 ''
+ StrCpy $9 ''
+ goto WordFunc_WordFind3X${_WORDFUNC_S}_delim1
+
+ WordFunc_WordFind3X${_WORDFUNC_S}_minus:
+ StrCmp${_WORDFUNC_S} $4 '-' 0 WordFunc_WordFind3X${_WORDFUNC_S}_sum
+ StrCpy $4 +
+ IntOp $3 $7 - $3
+ IntOp $3 $3 + 1
+ IntCmp $3 0 WordFunc_WordFind3X${_WORDFUNC_S}_error2 WordFunc_WordFind3X${_WORDFUNC_S}_error2 WordFunc_WordFind3X${_WORDFUNC_S}_restart
+ WordFunc_WordFind3X${_WORDFUNC_S}_sum:
+ StrCmp${_WORDFUNC_S} $4 '#' 0 WordFunc_WordFind3X${_WORDFUNC_S}_error2
+ StrCpy $R4 $7
+ goto WordFunc_WordFind3X${_WORDFUNC_S}_end
+
+ WordFunc_WordFind3X${_WORDFUNC_S}_plus:
+ StrCmp${_WORDFUNC_S} $5 '' 0 +4
+ IntOp $R4 $6 - $8
+ StrCpy $R4 $R0 $R4 $8
+ goto WordFunc_WordFind3X${_WORDFUNC_S}_end
+ IntOp $6 $6 + $R3
+ IntOp $8 $8 - $R1
+ StrCmp${_WORDFUNC_S} $5 '{*' +2
+ StrCmp${_WORDFUNC_S} $5 '*{' 0 +3
+ StrCpy $R4 $R0 $6
+ goto WordFunc_WordFind3X${_WORDFUNC_S}_end
+ StrCmp${_WORDFUNC_S} $5 '*}' +2
+ StrCmp${_WORDFUNC_S} $5 '}*' 0 +3
+ StrCpy $R4 $R0 '' $8
+ goto WordFunc_WordFind3X${_WORDFUNC_S}_end
+ StrCmp${_WORDFUNC_S} $5 '}}' 0 +3
+ StrCpy $R4 $R0 '' $6
+ goto WordFunc_WordFind3X${_WORDFUNC_S}_end
+ StrCmp${_WORDFUNC_S} $5 '{{' 0 +3
+ StrCpy $R4 $R0 $8
+ goto WordFunc_WordFind3X${_WORDFUNC_S}_end
+ StrCmp${_WORDFUNC_S} $5 '{}' 0 WordFunc_WordFind3X${_WORDFUNC_S}_error3
+ StrCpy $6 $R0 '' $6
+ StrCpy $8 $R0 $8
+ StrCpy $R4 '$8$6'
+ goto WordFunc_WordFind3X${_WORDFUNC_S}_end
+
+ WordFunc_WordFind3X${_WORDFUNC_S}_error3:
+ StrCpy $R4 3
+ goto WordFunc_WordFind3X${_WORDFUNC_S}_error
+ WordFunc_WordFind3X${_WORDFUNC_S}_error2:
+ StrCpy $R4 2
+ goto WordFunc_WordFind3X${_WORDFUNC_S}_error
+ WordFunc_WordFind3X${_WORDFUNC_S}_error1:
+ StrCpy $R4 1
+ WordFunc_WordFind3X${_WORDFUNC_S}_error:
+ StrCmp $R5 'E' 0 +3
+ SetErrors
+
+ WordFunc_WordFind3X${_WORDFUNC_S}_end:
+ StrCpy $R0 $R4
+ Pop $R5
+ Pop $R4
+ Pop $R3
+ Pop $R2
+ Pop $R1
+ Pop $9
+ Pop $8
+ Pop $7
+ Pop $6
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Pop $0
+ Exch $R0
+!macroend
+
+!define WordFind3X `!insertmacro WordFind3XCall`
+!define un.WordFind3X `!insertmacro WordFind3XCall`
+
+!macro WordFind3X
+!macroend
+
+!macro un.WordFind3X
+!macroend
+
+!macro WordFind3X_
+ !verbose push
+ !verbose ${_WORDFUNC_VERBOSE}
+
+ !insertmacro WordFind3XBody ''
+
+ !verbose pop
+!macroend
+
+!define WordFind3XS `!insertmacro WordFind3XSCall`
+!define un.WordFind3XS `!insertmacro WordFind3XSCall`
+
+!macro WordFind3XS
!macroend
!macro un.WordFind3XS
- !ifndef un.WordFind3XS
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN `un.`
- !undef _WORDFUNC_S
- !define _WORDFUNC_S `S`
+!macroend
- !insertmacro WordFind3X
+!macro WordFind3XS_
+ !verbose push
+ !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN
- !undef _WORDFUNC_S
- !define _WORDFUNC_S
- !verbose pop
- !endif
+ !insertmacro WordFind3XBody 'S'
+
+ !verbose pop
+!macroend
+
+!macro WordReplaceBody _WORDFUNC_S
+ Exch $2
+ Exch
+ Exch $1
+ Exch
+ Exch 2
+ Exch $0
+ Exch 2
+ Exch 3
+ Exch $R0
+ Exch 3
+ Push $3
+ Push $4
+ Push $5
+ Push $6
+ Push $7
+ Push $8
+ Push $9
+ Push $R1
+ ClearErrors
+
+ StrCpy $R1 $R0
+ StrCpy $9 ''
+ StrCpy $3 $2 1
+ StrCpy $2 $2 '' 1
+ StrCmp $3 'E' 0 +3
+ StrCpy $9 E
+ goto -4
+
+ StrCpy $4 $2 1 -1
+ StrCpy $5 ''
+ StrCpy $6 ''
+ StrLen $7 $0
+
+ StrCmp${_WORDFUNC_S} $7 0 WordFunc_WordReplace${_WORDFUNC_S}_error1
+ StrCmp${_WORDFUNC_S} $R0 '' WordFunc_WordReplace${_WORDFUNC_S}_error1
+ StrCmp${_WORDFUNC_S} $3 '{' WordFunc_WordReplace${_WORDFUNC_S}_beginning
+ StrCmp${_WORDFUNC_S} $3 '}' WordFunc_WordReplace${_WORDFUNC_S}_ending WordFunc_WordReplace${_WORDFUNC_S}_errorchk
+
+ WordFunc_WordReplace${_WORDFUNC_S}_beginning:
+ StrCpy $8 $R0 $7
+ StrCmp${_WORDFUNC_S} $8 $0 0 +4
+ StrCpy $R0 $R0 '' $7
+ StrCpy $5 '$5$1'
+ goto -4
+ StrCpy $3 $2 1
+ StrCmp${_WORDFUNC_S} $3 '}' 0 WordFunc_WordReplace${_WORDFUNC_S}_merge
+
+ WordFunc_WordReplace${_WORDFUNC_S}_ending:
+ StrCpy $8 $R0 '' -$7
+ StrCmp${_WORDFUNC_S} $8 $0 0 +4
+ StrCpy $R0 $R0 -$7
+ StrCpy $6 '$6$1'
+ goto -4
+
+ WordFunc_WordReplace${_WORDFUNC_S}_merge:
+ StrCmp${_WORDFUNC_S} $4 '*' 0 +5
+ StrCmp${_WORDFUNC_S} $5 '' +2
+ StrCpy $5 $1
+ StrCmp${_WORDFUNC_S} $6 '' +2
+ StrCpy $6 $1
+ StrCpy $R0 '$5$R0$6'
+ goto WordFunc_WordReplace${_WORDFUNC_S}_end
+
+ WordFunc_WordReplace${_WORDFUNC_S}_errorchk:
+ StrCmp${_WORDFUNC_S} $3 '+' +2
+ StrCmp${_WORDFUNC_S} $3 '-' 0 WordFunc_WordReplace${_WORDFUNC_S}_error3
+
+ StrCpy $5 $2 1
+ IntOp $2 $2 + 0
+ StrCmp${_WORDFUNC_S} $2 0 0 WordFunc_WordReplace${_WORDFUNC_S}_one
+ StrCmp${_WORDFUNC_S} $5 0 WordFunc_WordReplace${_WORDFUNC_S}_error2
+ StrCpy $3 ''
+
+ WordFunc_WordReplace${_WORDFUNC_S}_all:
+ StrCpy $5 0
+ StrCpy $2 $R0 $7 $5
+ StrCmp${_WORDFUNC_S} $2 '' +4
+ StrCmp${_WORDFUNC_S} $2 $0 +6
+ IntOp $5 $5 + 1
+ goto -4
+ StrCmp${_WORDFUNC_S} $R0 $R1 WordFunc_WordReplace${_WORDFUNC_S}_error1
+ StrCpy $R0 '$3$R0'
+ goto WordFunc_WordReplace${_WORDFUNC_S}_end
+ StrCpy $2 $R0 $5
+ IntOp $5 $5 + $7
+ StrCmp${_WORDFUNC_S} $4 '*' 0 +3
+ StrCpy $6 $R0 $7 $5
+ StrCmp${_WORDFUNC_S} $6 $0 -3
+ StrCpy $R0 $R0 '' $5
+ StrCpy $3 '$3$2$1'
+ goto WordFunc_WordReplace${_WORDFUNC_S}_all
+
+ WordFunc_WordReplace${_WORDFUNC_S}_one:
+ StrCpy $5 0
+ StrCpy $8 0
+ goto WordFunc_WordReplace${_WORDFUNC_S}_loop
+
+ WordFunc_WordReplace${_WORDFUNC_S}_preloop:
+ IntOp $5 $5 + 1
+
+ WordFunc_WordReplace${_WORDFUNC_S}_loop:
+ StrCpy $6 $R0 $7 $5
+ StrCmp${_WORDFUNC_S} $6$8 0 WordFunc_WordReplace${_WORDFUNC_S}_error1
+ StrCmp${_WORDFUNC_S} $6 '' WordFunc_WordReplace${_WORDFUNC_S}_minus
+ StrCmp${_WORDFUNC_S} $6 $0 0 WordFunc_WordReplace${_WORDFUNC_S}_preloop
+ IntOp $8 $8 + 1
+ StrCmp${_WORDFUNC_S} $3$8 +$2 WordFunc_WordReplace${_WORDFUNC_S}_found
+ IntOp $5 $5 + $7
+ goto WordFunc_WordReplace${_WORDFUNC_S}_loop
+
+ WordFunc_WordReplace${_WORDFUNC_S}_minus:
+ StrCmp${_WORDFUNC_S} $3 '-' 0 WordFunc_WordReplace${_WORDFUNC_S}_error2
+ StrCpy $3 +
+ IntOp $2 $8 - $2
+ IntOp $2 $2 + 1
+ IntCmp $2 0 WordFunc_WordReplace${_WORDFUNC_S}_error2 WordFunc_WordReplace${_WORDFUNC_S}_error2 WordFunc_WordReplace${_WORDFUNC_S}_one
+
+ WordFunc_WordReplace${_WORDFUNC_S}_found:
+ StrCpy $3 $R0 $5
+ StrCmp${_WORDFUNC_S} $4 '*' 0 +5
+ StrCpy $6 $3 '' -$7
+ StrCmp${_WORDFUNC_S} $6 $0 0 +3
+ StrCpy $3 $3 -$7
+ goto -3
+ IntOp $5 $5 + $7
+ StrCmp${_WORDFUNC_S} $4 '*' 0 +3
+ StrCpy $6 $R0 $7 $5
+ StrCmp${_WORDFUNC_S} $6 $0 -3
+ StrCpy $R0 $R0 '' $5
+ StrCpy $R0 '$3$1$R0'
+ goto WordFunc_WordReplace${_WORDFUNC_S}_end
+
+ WordFunc_WordReplace${_WORDFUNC_S}_error3:
+ StrCpy $R0 3
+ goto WordFunc_WordReplace${_WORDFUNC_S}_error
+ WordFunc_WordReplace${_WORDFUNC_S}_error2:
+ StrCpy $R0 2
+ goto WordFunc_WordReplace${_WORDFUNC_S}_error
+ WordFunc_WordReplace${_WORDFUNC_S}_error1:
+ StrCpy $R0 1
+ WordFunc_WordReplace${_WORDFUNC_S}_error:
+ StrCmp $9 'E' +3
+ StrCpy $R0 $R1
+ goto +2
+ SetErrors
+
+ WordFunc_WordReplace${_WORDFUNC_S}_end:
+ Pop $R1
+ Pop $9
+ Pop $8
+ Pop $7
+ Pop $6
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Pop $0
+ Exch $R0
+!macroend
+
+!define WordReplace `!insertmacro WordReplaceCall`
+!define un.WordReplace `!insertmacro WordReplaceCall`
+
+!macro WordReplace
+!macroend
+
+!macro un.WordReplace
+!macroend
+
+!macro WordReplace_
+ !verbose push
+ !verbose ${_WORDFUNC_VERBOSE}
+
+ !insertmacro WordReplaceBody ''
+
+ !verbose pop
+!macroend
+
+!define WordReplaceS `!insertmacro WordReplaceSCall`
+!define un.WordReplaceS `!insertmacro WordReplaceSCall`
+
+!macro WordReplaceS
!macroend
!macro un.WordReplaceS
- !ifndef un.WordReplaceS
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN `un.`
- !undef _WORDFUNC_S
- !define _WORDFUNC_S `S`
+!macroend
- !insertmacro WordReplace
+!macro WordReplaceS_
+ !verbose push
+ !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN
- !undef _WORDFUNC_S
- !define _WORDFUNC_S
- !verbose pop
- !endif
+ !insertmacro WordReplaceBody 'S'
+
+ !verbose pop
+!macroend
+
+!macro WordAddBody _WORDFUNC_S
+ Exch $1
+ Exch
+ Exch $0
+ Exch
+ Exch 2
+ Exch $R0
+ Exch 2
+ Push $2
+ Push $3
+ Push $4
+ Push $5
+ Push $6
+ Push $7
+ Push $R1
+ ClearErrors
+
+ StrCpy $7 ''
+ StrCpy $2 $1 1
+ StrCmp $2 'E' 0 +4
+ StrCpy $7 E
+ StrCpy $1 $1 '' 1
+ goto -4
+
+ StrCpy $5 0
+ StrCpy $R1 $R0
+ StrCpy $2 $1 '' 1
+ StrCpy $1 $1 1
+ StrCmp${_WORDFUNC_S} $1 '+' +2
+ StrCmp${_WORDFUNC_S} $1 '-' 0 WordFunc_WordAdd${_WORDFUNC_S}_error3
+
+ StrCmp${_WORDFUNC_S} $0 '' WordFunc_WordAdd${_WORDFUNC_S}_error1
+ StrCmp${_WORDFUNC_S} $2 '' WordFunc_WordAdd${_WORDFUNC_S}_end
+ StrCmp${_WORDFUNC_S} $R0 '' 0 +5
+ StrCmp${_WORDFUNC_S} $1 '-' WordFunc_WordAdd${_WORDFUNC_S}_end
+ StrCmp${_WORDFUNC_S} $1 '+' 0 +3
+ StrCpy $R0 $2
+ goto WordFunc_WordAdd${_WORDFUNC_S}_end
+
+ WordFunc_WordAdd${_WORDFUNC_S}_loop:
+ IntOp $5 $5 + 1
+ !insertmacro WordFind${_WORDFUNC_S}Call 2 $2 $0 E+$5 $3
+ IfErrors 0 WordFunc_WordAdd${_WORDFUNC_S}_/word
+ StrCmp${_WORDFUNC_S} $3 2 +4
+ StrCmp${_WORDFUNC_S} $3$5 11 0 +3
+ StrCpy $3 $2
+ goto WordFunc_WordAdd${_WORDFUNC_S}_/word
+ StrCmp${_WORDFUNC_S} $1 '-' WordFunc_WordAdd${_WORDFUNC_S}_end WordFunc_WordAdd${_WORDFUNC_S}_preend
+
+ WordFunc_WordAdd${_WORDFUNC_S}_/word:
+ !insertmacro WordFind${_WORDFUNC_S}Call 2 $R0 $0 E/$3 $4
+ IfErrors +2
+ StrCmp${_WORDFUNC_S} $1 '-' WordFunc_WordAdd${_WORDFUNC_S}_delete WordFunc_WordAdd${_WORDFUNC_S}_loop
+ StrCmp${_WORDFUNC_S} $1$4 '-1' +2
+ StrCmp${_WORDFUNC_S} $1 '-' WordFunc_WordAdd${_WORDFUNC_S}_loop +4
+ StrCmp${_WORDFUNC_S} $R0 $3 0 WordFunc_WordAdd${_WORDFUNC_S}_loop
+ StrCpy $R0 ''
+ goto WordFunc_WordAdd${_WORDFUNC_S}_end
+ StrCmp${_WORDFUNC_S} $1$4 '+1' 0 +2
+ StrCmp${_WORDFUNC_S} $R0 $3 WordFunc_WordAdd${_WORDFUNC_S}_loop
+ StrCmp${_WORDFUNC_S} $R0 $R1 +3
+ StrCpy $R1 '$R1$0$3'
+ goto WordFunc_WordAdd${_WORDFUNC_S}_loop
+ StrLen $6 $0
+ StrCpy $6 $R0 '' -$6
+ StrCmp${_WORDFUNC_S} $6 $0 0 -4
+ StrCpy $R1 '$R1$3'
+ goto WordFunc_WordAdd${_WORDFUNC_S}_loop
+
+ WordFunc_WordAdd${_WORDFUNC_S}_delete:
+ !insertmacro WordFind${_WORDFUNC_S}Call 2 $R0 $0 E+$4{} $R0
+ goto WordFunc_WordAdd${_WORDFUNC_S}_/word
+
+ WordFunc_WordAdd${_WORDFUNC_S}_error3:
+ StrCpy $R1 3
+ goto WordFunc_WordAdd${_WORDFUNC_S}_error
+ WordFunc_WordAdd${_WORDFUNC_S}_error1:
+ StrCpy $R1 1
+ WordFunc_WordAdd${_WORDFUNC_S}_error:
+ StrCmp $7 'E' 0 WordFunc_WordAdd${_WORDFUNC_S}_end
+ SetErrors
+
+ WordFunc_WordAdd${_WORDFUNC_S}_preend:
+ StrCpy $R0 $R1
+
+ WordFunc_WordAdd${_WORDFUNC_S}_end:
+ Pop $R1
+ Pop $7
+ Pop $6
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Pop $0
+ Exch $R0
+!macroend
+
+!define WordAdd `!insertmacro WordAddCall`
+!define un.WordAdd `!insertmacro WordAddCall`
+
+!macro WordAdd
+!macroend
+
+!macro un.WordAdd
+!macroend
+
+!macro WordAdd_
+ !verbose push
+ !verbose ${_WORDFUNC_VERBOSE}
+
+ !insertmacro WordAddBody ''
+
+ !verbose pop
+!macroend
+
+!define WordAddS `!insertmacro WordAddSCall`
+!define un.WordAddS `!insertmacro WordAddSCall`
+
+!macro WordAddS
!macroend
!macro un.WordAddS
- !ifndef un.WordAddS
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN `un.`
- !undef _WORDFUNC_S
- !define _WORDFUNC_S `S`
+!macroend
- !insertmacro WordAdd
+!macro WordAddS_
+ !verbose push
+ !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN
- !undef _WORDFUNC_S
- !define _WORDFUNC_S
- !verbose pop
- !endif
+ !insertmacro WordAddBody 'S'
+
+ !verbose pop
+!macroend
+
+!macro WordInsertBody _WORDFUNC_S
+ Exch $2
+ Exch
+ Exch $1
+ Exch
+ Exch 2
+ Exch $0
+ Exch 2
+ Exch 3
+ Exch $R0
+ Exch 3
+ Push $3
+ Push $4
+ Push $5
+ Push $6
+ Push $7
+ Push $8
+ Push $9
+ Push $R1
+ ClearErrors
+
+ StrCpy $5 ''
+ StrCpy $6 $0
+ StrCpy $7 }
+
+ StrCpy $9 ''
+ StrCpy $R1 $R0
+ StrCpy $3 $2 1
+ StrCpy $2 $2 '' 1
+ StrCmp $3 'E' 0 +3
+ StrCpy $9 'E'
+ goto -4
+
+ StrCmp${_WORDFUNC_S} $3 '+' +2
+ StrCmp${_WORDFUNC_S} $3 '-' 0 WordFunc_WordInsert${_WORDFUNC_S}_error3
+ IntOp $2 $2 + 0
+ StrCmp${_WORDFUNC_S} $2 0 WordFunc_WordInsert${_WORDFUNC_S}_error2
+ StrCmp${_WORDFUNC_S} $0 '' WordFunc_WordInsert${_WORDFUNC_S}_error1
+
+ StrCmp${_WORDFUNC_S} $2 1 0 WordFunc_WordInsert${_WORDFUNC_S}_two
+ GetLabelAddress $8 WordFunc_WordInsert${_WORDFUNC_S}_oneback
+ StrCmp${_WORDFUNC_S} $3 '+' WordFunc_WordInsert${_WORDFUNC_S}_call
+ StrCpy $7 {
+ goto WordFunc_WordInsert${_WORDFUNC_S}_call
+ WordFunc_WordInsert${_WORDFUNC_S}_oneback:
+ IfErrors 0 +2
+ StrCpy $4 $R0
+ StrCmp${_WORDFUNC_S} $3 '+' 0 +3
+ StrCpy $R0 '$1$0$4'
+ goto WordFunc_WordInsert${_WORDFUNC_S}_end
+ StrCpy $R0 '$4$0$1'
+ goto WordFunc_WordInsert${_WORDFUNC_S}_end
+
+ WordFunc_WordInsert${_WORDFUNC_S}_two:
+ IntOp $2 $2 - 1
+ GetLabelAddress $8 WordFunc_WordInsert${_WORDFUNC_S}_twoback
+ StrCmp${_WORDFUNC_S} $3 '+' 0 WordFunc_WordInsert${_WORDFUNC_S}_call
+ StrCpy $7 {
+ goto WordFunc_WordInsert${_WORDFUNC_S}_call
+ WordFunc_WordInsert${_WORDFUNC_S}_twoback:
+ IfErrors 0 WordFunc_WordInsert${_WORDFUNC_S}_tree
+ StrCmp${_WORDFUNC_S} $2$4 11 0 WordFunc_WordInsert${_WORDFUNC_S}_error2
+ StrCmp${_WORDFUNC_S} $3 '+' 0 +3
+ StrCpy $R0 '$R0$0$1'
+ goto WordFunc_WordInsert${_WORDFUNC_S}_end
+ StrCpy $R0 '$1$0$R0'
+ goto WordFunc_WordInsert${_WORDFUNC_S}_end
+
+ WordFunc_WordInsert${_WORDFUNC_S}_tree:
+ StrCpy $7 }
+ StrCpy $5 $4
+ IntOp $2 $2 + 1
+ GetLabelAddress $8 WordFunc_WordInsert${_WORDFUNC_S}_treeback
+ StrCmp${_WORDFUNC_S} $3 '+' WordFunc_WordInsert${_WORDFUNC_S}_call
+ StrCpy $7 {
+ goto WordFunc_WordInsert${_WORDFUNC_S}_call
+ WordFunc_WordInsert${_WORDFUNC_S}_treeback:
+ IfErrors 0 +3
+ StrCpy $4 ''
+ StrCpy $6 ''
+ StrCmp${_WORDFUNC_S} $3 '+' 0 +3
+ StrCpy $R0 '$5$0$1$6$4'
+ goto WordFunc_WordInsert${_WORDFUNC_S}_end
+ StrCpy $R0 '$4$6$1$0$5'
+ goto WordFunc_WordInsert${_WORDFUNC_S}_end
+
+ WordFunc_WordInsert${_WORDFUNC_S}_call:
+ !insertmacro WordFind${_WORDFUNC_S}Call 2 $R0 $0 E$3$2*$7 $4
+ goto $8
+
+ WordFunc_WordInsert${_WORDFUNC_S}_error3:
+ StrCpy $R0 3
+ goto WordFunc_WordInsert${_WORDFUNC_S}_error
+ WordFunc_WordInsert${_WORDFUNC_S}_error2:
+ StrCpy $R0 2
+ goto WordFunc_WordInsert${_WORDFUNC_S}_error
+ WordFunc_WordInsert${_WORDFUNC_S}_error1:
+ StrCpy $R0 1
+ WordFunc_WordInsert${_WORDFUNC_S}_error:
+ StrCmp $9 'E' +3
+ StrCpy $R0 $R1
+ goto +2
+ SetErrors
+
+ WordFunc_WordInsert${_WORDFUNC_S}_end:
+ Pop $R1
+ Pop $9
+ Pop $8
+ Pop $7
+ Pop $6
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Pop $0
+ Exch $R0
+!macroend
+
+!define WordInsert `!insertmacro WordInsertCall`
+!define un.WordInsert `!insertmacro WordInsertCall`
+
+!macro WordInsert
+!macroend
+
+!macro un.WordInsert
+!macroend
+
+!macro WordInsert_
+ !verbose push
+ !verbose ${_WORDFUNC_VERBOSE}
+
+ !insertmacro WordInsertBody ''
+
+ !verbose pop
+!macroend
+
+
+!define WordInsertS `!insertmacro WordInsertSCall`
+!define un.WordInsertS `!insertmacro WordInsertSCall`
+
+!macro WordInsertS
!macroend
!macro un.WordInsertS
- !ifndef un.WordInsertS
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN `un.`
- !undef _WORDFUNC_S
- !define _WORDFUNC_S `S`
+!macroend
- !insertmacro WordInsert
+!macro WordInsertS_
+ !verbose push
+ !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN
- !undef _WORDFUNC_S
- !define _WORDFUNC_S
- !verbose pop
- !endif
+ !insertmacro WordInsertBody 'S'
+
+ !verbose pop
+!macroend
+
+!macro StrFilterBody _WORDFUNC_S
+ Exch $2
+ Exch
+ Exch $1
+ Exch
+ Exch 2
+ Exch $0
+ Exch 2
+ Exch 3
+ Exch $R0
+ Exch 3
+ Push $3
+ Push $4
+ Push $5
+ Push $6
+ Push $7
+ Push $R1
+ Push $R2
+ Push $R3
+ Push $R4
+ Push $R5
+ Push $R6
+ Push $R7
+ Push $R8
+ ClearErrors
+
+ StrCpy $R2 $0 '' -3
+ StrCmp $R2 "eng" WordFunc_StrFilter${_WORDFUNC_S}_eng
+ StrCmp $R2 "rus" WordFunc_StrFilter${_WORDFUNC_S}_rus
+ WordFunc_StrFilter${_WORDFUNC_S}_eng:
+ StrCpy $4 65
+ StrCpy $5 90
+ StrCpy $6 97
+ StrCpy $7 122
+ goto WordFunc_StrFilter${_WORDFUNC_S}_langend
+ WordFunc_StrFilter${_WORDFUNC_S}_rus:
+ StrCpy $4 192
+ StrCpy $5 223
+ StrCpy $6 224
+ StrCpy $7 255
+ goto WordFunc_StrFilter${_WORDFUNC_S}_langend
+ ;...
+
+ WordFunc_StrFilter${_WORDFUNC_S}_langend:
+ StrCpy $R7 ''
+ StrCpy $R8 ''
+
+ StrCmp${_WORDFUNC_S} $2 '' 0 WordFunc_StrFilter${_WORDFUNC_S}_begin
+
+ WordFunc_StrFilter${_WORDFUNC_S}_restart1:
+ StrCpy $2 ''
+ StrCpy $3 $0 1
+ StrCmp${_WORDFUNC_S} $3 '+' +2
+ StrCmp${_WORDFUNC_S} $3 '-' 0 +3
+ StrCpy $0 $0 '' 1
+ goto +2
+ StrCpy $3 ''
+
+ IntOp $0 $0 + 0
+ StrCmp${_WORDFUNC_S} $0 0 +5
+ StrCpy $R7 $0 1 0
+ StrCpy $R8 $0 1 1
+ StrCpy $R2 $0 1 2
+ StrCmp${_WORDFUNC_S} $R2 '' WordFunc_StrFilter${_WORDFUNC_S}_filter WordFunc_StrFilter${_WORDFUNC_S}_error
+
+ WordFunc_StrFilter${_WORDFUNC_S}_restart2:
+ StrCmp${_WORDFUNC_S} $3 '' WordFunc_StrFilter${_WORDFUNC_S}_end
+ StrCpy $R7 ''
+ StrCpy $R8 '+-'
+ goto WordFunc_StrFilter${_WORDFUNC_S}_begin
+
+ WordFunc_StrFilter${_WORDFUNC_S}_filter:
+ StrCmp${_WORDFUNC_S} $R7 '1' +3
+ StrCmp${_WORDFUNC_S} $R7 '2' +2
+ StrCmp${_WORDFUNC_S} $R7 '3' 0 WordFunc_StrFilter${_WORDFUNC_S}_error
+
+ StrCmp${_WORDFUNC_S} $R8 '' WordFunc_StrFilter${_WORDFUNC_S}_begin
+ StrCmp${_WORDFUNC_S} $R7$R8 '23' +2
+ StrCmp${_WORDFUNC_S} $R7$R8 '32' 0 +3
+ StrCpy $R7 -1
+ goto WordFunc_StrFilter${_WORDFUNC_S}_begin
+ StrCmp${_WORDFUNC_S} $R7$R8 '13' +2
+ StrCmp${_WORDFUNC_S} $R7$R8 '31' 0 +3
+ StrCpy $R7 -2
+ goto WordFunc_StrFilter${_WORDFUNC_S}_begin
+ StrCmp${_WORDFUNC_S} $R7$R8 '12' +2
+ StrCmp${_WORDFUNC_S} $R7$R8 '21' 0 WordFunc_StrFilter${_WORDFUNC_S}_error
+ StrCpy $R7 -3
+
+ WordFunc_StrFilter${_WORDFUNC_S}_begin:
+ StrCpy $R6 0
+ StrCpy $R1 ''
+
+ WordFunc_StrFilter${_WORDFUNC_S}_loop:
+ StrCpy $R2 $R0 1 $R6
+ StrCmp${_WORDFUNC_S} $R2 '' WordFunc_StrFilter${_WORDFUNC_S}_restartchk
+
+ StrCmp${_WORDFUNC_S} $2 '' +7
+ StrCpy $R4 0
+ StrCpy $R5 $2 1 $R4
+ StrCmp${_WORDFUNC_S} $R5 '' WordFunc_StrFilter${_WORDFUNC_S}_addsymbol
+ StrCmp${_WORDFUNC_S} $R5 $R2 WordFunc_StrFilter${_WORDFUNC_S}_skipsymbol
+ IntOp $R4 $R4 + 1
+ goto -4
+
+ StrCmp${_WORDFUNC_S} $1 '' +7
+ StrCpy $R4 0
+ StrCpy $R5 $1 1 $R4
+ StrCmp${_WORDFUNC_S} $R5 '' +4
+ StrCmp${_WORDFUNC_S} $R5 $R2 WordFunc_StrFilter${_WORDFUNC_S}_addsymbol
+ IntOp $R4 $R4 + 1
+ goto -4
+
+ StrCmp${_WORDFUNC_S} $R7 '1' +2
+ StrCmp${_WORDFUNC_S} $R7 '-1' 0 +4
+ StrCpy $R4 48
+ StrCpy $R5 57
+ goto WordFunc_StrFilter${_WORDFUNC_S}_loop2
+ StrCmp${_WORDFUNC_S} $R8 '+-' 0 +2
+ StrCmp${_WORDFUNC_S} $3 '+' 0 +4
+ StrCpy $R4 $4
+ StrCpy $R5 $5
+ goto WordFunc_StrFilter${_WORDFUNC_S}_loop2
+ StrCpy $R4 $6
+ StrCpy $R5 $7
+
+ WordFunc_StrFilter${_WORDFUNC_S}_loop2:
+ IntFmt $R3 '%c' $R4
+ StrCmp $R2 $R3 WordFunc_StrFilter${_WORDFUNC_S}_found
+ StrCmp $R4 $R5 WordFunc_StrFilter${_WORDFUNC_S}_notfound
+ IntOp $R4 $R4 + 1
+ goto WordFunc_StrFilter${_WORDFUNC_S}_loop2
+
+ WordFunc_StrFilter${_WORDFUNC_S}_found:
+ StrCmp${_WORDFUNC_S} $R8 '+-' WordFunc_StrFilter${_WORDFUNC_S}_setcase
+ StrCmp${_WORDFUNC_S} $R7 '3' WordFunc_StrFilter${_WORDFUNC_S}_skipsymbol
+ StrCmp${_WORDFUNC_S} $R7 '-3' WordFunc_StrFilter${_WORDFUNC_S}_addsymbol
+ StrCmp${_WORDFUNC_S} $R8 '' WordFunc_StrFilter${_WORDFUNC_S}_addsymbol WordFunc_StrFilter${_WORDFUNC_S}_skipsymbol
+
+ WordFunc_StrFilter${_WORDFUNC_S}_notfound:
+ StrCmp${_WORDFUNC_S} $R8 '+-' WordFunc_StrFilter${_WORDFUNC_S}_addsymbol
+ StrCmp${_WORDFUNC_S} $R7 '3' 0 +2
+ StrCmp${_WORDFUNC_S} $R5 57 WordFunc_StrFilter${_WORDFUNC_S}_addsymbol +3
+ StrCmp${_WORDFUNC_S} $R7 '-3' 0 +5
+ StrCmp${_WORDFUNC_S} $R5 57 WordFunc_StrFilter${_WORDFUNC_S}_skipsymbol
+ StrCpy $R4 48
+ StrCpy $R5 57
+ goto WordFunc_StrFilter${_WORDFUNC_S}_loop2
+ StrCmp${_WORDFUNC_S} $R8 '' WordFunc_StrFilter${_WORDFUNC_S}_skipsymbol WordFunc_StrFilter${_WORDFUNC_S}_addsymbol
+
+ WordFunc_StrFilter${_WORDFUNC_S}_setcase:
+ StrCpy $R2 $R3
+ WordFunc_StrFilter${_WORDFUNC_S}_addsymbol:
+ StrCpy $R1 $R1$R2
+ WordFunc_StrFilter${_WORDFUNC_S}_skipsymbol:
+ IntOp $R6 $R6 + 1
+ goto WordFunc_StrFilter${_WORDFUNC_S}_loop
+
+ WordFunc_StrFilter${_WORDFUNC_S}_error:
+ SetErrors
+ StrCpy $R0 ''
+ goto WordFunc_StrFilter${_WORDFUNC_S}_end
+
+ WordFunc_StrFilter${_WORDFUNC_S}_restartchk:
+ StrCpy $R0 $R1
+ StrCmp${_WORDFUNC_S} $2 '' 0 WordFunc_StrFilter${_WORDFUNC_S}_restart1
+ StrCmp${_WORDFUNC_S} $R8 '+-' 0 WordFunc_StrFilter${_WORDFUNC_S}_restart2
+
+ WordFunc_StrFilter${_WORDFUNC_S}_end:
+ Pop $R8
+ Pop $R7
+ Pop $R6
+ Pop $R5
+ Pop $R4
+ Pop $R3
+ Pop $R2
+ Pop $R1
+ Pop $7
+ Pop $6
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Pop $0
+ Exch $R0
+!macroend
+
+!define StrFilter `!insertmacro StrFilterCall`
+!define un.StrFilter `!insertmacro StrFilterCall`
+
+!macro StrFilter
+!macroend
+
+!macro un.StrFilter
+!macroend
+
+!macro StrFilter_
+ !verbose push
+ !verbose ${_WORDFUNC_VERBOSE}
+
+ !insertmacro StrFilterBody ''
+
+ !verbose pop
+!macroend
+
+
+!define StrFilterS `!insertmacro StrFilterSCall`
+!define un.StrFilterS `!insertmacro StrFilterSCall`
+
+!macro StrFilterS
!macroend
!macro un.StrFilterS
- !ifndef un.StrFilterS
- !verbose push
- !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN `un.`
- !undef _WORDFUNC_S
- !define _WORDFUNC_S `S`
+!macroend
- !insertmacro StrFilter
+!macro StrFilterS_
+ !verbose push
+ !verbose ${_WORDFUNC_VERBOSE}
- !undef _WORDFUNC_UN
- !define _WORDFUNC_UN
- !undef _WORDFUNC_S
- !define _WORDFUNC_S
- !verbose pop
- !endif
+ !insertmacro StrFilterBody 'S'
+
+ !verbose pop
+!macroend
+
+!define VersionCompare `!insertmacro VersionCompareCall`
+!define un.VersionCompare `!insertmacro VersionCompareCall`
+
+!macro VersionCompare
+!macroend
+
+!macro un.VersionCompare
+!macroend
+
+!macro VersionCompare_
+ !verbose push
+ !verbose ${_WORDFUNC_VERBOSE}
+
+ Exch $1
+ Exch
+ Exch $0
+ Exch
+ Push $2
+ Push $3
+ Push $4
+ Push $5
+ Push $6
+ Push $7
+
+ WordFunc_VersionCompare_begin:
+ StrCpy $2 -1
+ IntOp $2 $2 + 1
+ StrCpy $3 $0 1 $2
+ StrCmp $3 '' +2
+ StrCmp $3 '.' 0 -3
+ StrCpy $4 $0 $2
+ IntOp $2 $2 + 1
+ StrCpy $0 $0 '' $2
+
+ StrCpy $2 -1
+ IntOp $2 $2 + 1
+ StrCpy $3 $1 1 $2
+ StrCmp $3 '' +2
+ StrCmp $3 '.' 0 -3
+ StrCpy $5 $1 $2
+ IntOp $2 $2 + 1
+ StrCpy $1 $1 '' $2
+
+ StrCmp $4$5 '' WordFunc_VersionCompare_equal
+
+ StrCpy $6 -1
+ IntOp $6 $6 + 1
+ StrCpy $3 $4 1 $6
+ StrCmp $3 '0' -2
+ StrCmp $3 '' 0 +2
+ StrCpy $4 0
+
+ StrCpy $7 -1
+ IntOp $7 $7 + 1
+ StrCpy $3 $5 1 $7
+ StrCmp $3 '0' -2
+ StrCmp $3 '' 0 +2
+ StrCpy $5 0
+
+ StrCmp $4 0 0 +2
+ StrCmp $5 0 WordFunc_VersionCompare_begin WordFunc_VersionCompare_newer2
+ StrCmp $5 0 WordFunc_VersionCompare_newer1
+ IntCmp $6 $7 0 WordFunc_VersionCompare_newer1 WordFunc_VersionCompare_newer2
+
+ StrCpy $4 '1$4'
+ StrCpy $5 '1$5'
+ IntCmp $4 $5 WordFunc_VersionCompare_begin WordFunc_VersionCompare_newer2 WordFunc_VersionCompare_newer1
+
+ WordFunc_VersionCompare_equal:
+ StrCpy $0 0
+ goto WordFunc_VersionCompare_end
+ WordFunc_VersionCompare_newer1:
+ StrCpy $0 1
+ goto WordFunc_VersionCompare_end
+ WordFunc_VersionCompare_newer2:
+ StrCpy $0 2
+
+ WordFunc_VersionCompare_end:
+ Pop $7
+ Pop $6
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Exch $0
+
+ !verbose pop
+!macroend
+
+!define VersionConvert `!insertmacro VersionConvertCall`
+!define un.VersionConvert `!insertmacro VersionConvertCall`
+
+!macro VersionConvert
+!macroend
+
+!macro un.VersionConvert
+!macroend
+
+!macro VersionConvert_
+ !verbose push
+ !verbose ${_WORDFUNC_VERBOSE}
+
+ Exch $1
+ Exch
+ Exch $0
+ Exch
+ Push $2
+ Push $3
+ Push $4
+ Push $5
+ Push $6
+ Push $7
+
+ StrCmp $1 '' 0 +2
+ StrCpy $1 'abcdefghijklmnopqrstuvwxyz'
+ StrCpy $1 $1 99
+
+ StrCpy $2 0
+ StrCpy $7 'dot'
+ goto WordFunc_VersionConvert_loop
+
+ WordFunc_VersionConvert_preloop:
+ IntOp $2 $2 + 1
+
+ WordFunc_VersionConvert_loop:
+ StrCpy $3 $0 1 $2
+ StrCmp $3 '' WordFunc_VersionConvert_endcheck
+ StrCmp $3 '.' WordFunc_VersionConvert_dot
+ StrCmp $3 '0' WordFunc_VersionConvert_digit
+ IntCmp $3 '0' WordFunc_VersionConvert_letter WordFunc_VersionConvert_letter WordFunc_VersionConvert_digit
+
+ WordFunc_VersionConvert_dot:
+ StrCmp $7 'dot' WordFunc_VersionConvert_replacespecial
+ StrCpy $7 'dot'
+ goto WordFunc_VersionConvert_preloop
+
+ WordFunc_VersionConvert_digit:
+ StrCmp $7 'letter' WordFunc_VersionConvert_insertdot
+ StrCpy $7 'digit'
+ goto WordFunc_VersionConvert_preloop
+
+ WordFunc_VersionConvert_letter:
+ StrCpy $5 0
+ StrCpy $4 $1 1 $5
+ IntOp $5 $5 + 1
+ StrCmp $4 '' WordFunc_VersionConvert_replacespecial
+ StrCmp $4 $3 0 -3
+ IntCmp $5 9 0 0 +2
+ StrCpy $5 '0$5'
+
+ StrCmp $7 'letter' +2
+ StrCmp $7 'dot' 0 +3
+ StrCpy $6 ''
+ goto +2
+ StrCpy $6 '.'
+
+ StrCpy $4 $0 $2
+ IntOp $2 $2 + 1
+ StrCpy $0 $0 '' $2
+ StrCpy $0 '$4$6$5$0'
+ StrLen $4 '$6$5'
+ IntOp $2 $2 + $4
+ IntOp $2 $2 - 1
+ StrCpy $7 'letter'
+ goto WordFunc_VersionConvert_loop
+
+ WordFunc_VersionConvert_replacespecial:
+ StrCmp $7 'dot' 0 +3
+ StrCpy $6 ''
+ goto +2
+ StrCpy $6 '.'
+
+ StrCpy $4 $0 $2
+ IntOp $2 $2 + 1
+ StrCpy $0 $0 '' $2
+ StrCpy $0 '$4$6$0'
+ StrLen $4 $6
+ IntOp $2 $2 + $4
+ IntOp $2 $2 - 1
+ StrCpy $7 'dot'
+ goto WordFunc_VersionConvert_loop
+
+ WordFunc_VersionConvert_insertdot:
+ StrCpy $4 $0 $2
+ StrCpy $0 $0 '' $2
+ StrCpy $0 '$4.$0'
+ StrCpy $7 'dot'
+ goto WordFunc_VersionConvert_preloop
+
+ WordFunc_VersionConvert_endcheck:
+ StrCpy $4 $0 1 -1
+ StrCmp $4 '.' 0 WordFunc_VersionConvert_end
+ StrCpy $0 $0 -1
+ goto -3
+
+ WordFunc_VersionConvert_end:
+ Pop $7
+ Pop $6
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Exch $0
+
+ !verbose pop
!macroend
!endif