Updates by Instructor

1. "WordReplace"
   -Added options "{", "}", "{*", "}*"

2. "GetOptions"
   -Now sets error flag if option does not found

3. "ConfigRead"
   -Now sets error flag if entry does not found

4. New case sensitive functions:
      "WordFindS", "WordFind2XS", "WordFind3XS", "WordReplaceS",
      "WordAddS", "WordInsertS", "StrFilterS", "TextCompareS",
      "ConfigReadS", "ConfigWriteS", "GetOptionsS"


git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4517 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2006-02-10 10:46:57 +00:00
parent 082160fb3e
commit aa43f0c349
9 changed files with 1534 additions and 572 deletions

View file

@ -30,7 +30,7 @@ Call functions:
\c SectionEnd
\S1{} Locate
\S1{locate} Locate
\b Find files, directories and empty directories with mask and size options.
@ -82,6 +82,7 @@ Call functions:
\\<b\\>Note:\\</b\\>
\\<br\\>- Error flag if disk or directory isn't exist
\\<br\\>- Error flag if syntax error
\\<br\\>- See also \W{http://nsis.sourceforge.net/Locate_plugin}{Locate plugin}
\\<b\\>Example (Find one file):\\</b\\>
@ -263,7 +264,7 @@ Call functions:
\c Push $0
\c FunctionEnd
\\<b\\>Example (Locate with banner - "\W{http://nsis.sourceforge.net/Banner_with_Cancel_button}{NxS}" plugin required):\\</b\\>
\\<b\\>Example (Locate with banner - \W{http://nsis.sourceforge.net/Nxs_plug-in}{NxS plugin} required):\\</b\\>
\c Section
\c nxs::Show /NOUNLOAD `$(^Name) Setup` /top `Setup searching something$\r$\nPlease wait... If you can..` /h 1 /can 1 /end
@ -289,7 +290,7 @@ Call functions:
\c Push $0
\c FunctionEnd
\S1{} GetSize
\S1{getsize} GetSize
\b Find the size of a file, files mask or directory.
@ -324,6 +325,7 @@ Call functions:
\\<b\\>Note:\\</b\\>
\\<br\\>- Error flag if disk or directory isn't exist
\\<br\\>- Error flag if syntax error
\\<br\\>- See also \W{http://nsis.sourceforge.net/Locate_plugin}{Locate plugin}
\\<b\\>Example (1):\\</b\\>
@ -368,7 +370,7 @@ Call functions:
\c MessageBox MB_OK "Error"
\c SectionEnd
\S1{} DriveSpace
\S1{drivespace} DriveSpace
\b Get total, occupied or free space of the drive.
@ -402,7 +404,7 @@ Call functions:
\c ; $R0="2530" megabytes free on drive C:
\c SectionEnd
\S1{} GetDrives
\S1{getdrives} GetDrives
\b Find all available drives in the system.
@ -475,7 +477,7 @@ Call functions:
\c Push $0
\c FunctionEnd
\S1{} GetTime
\S1{gettime} GetTime
\b Get local or system time.
@ -508,6 +510,7 @@ Call functions:
\\<b\\>Note:\\</b\\>
\\<br\\>- Error flag if file isn't exist
\\<br\\>- Error flag if syntax error
\\<br\\>- See also \W{http://nsis.sourceforge.net/Time_plugin}{Time plugin}
\\<b\\>Example (Get local time):\\</b\\>
@ -575,7 +578,7 @@ Call functions:
\c MessageBox MB_OK 'Date=$0/$1/$2 ($3)$\nTime=$4:$5:$6 $7'
\c SectionEnd
\S1{} GetFileAttributes
\S1{getfileattributes} GetFileAttributes
\b Get attributes of file or directory.
@ -599,7 +602,7 @@ Call functions:
\c ; $var=0 file has no specified attributes
\\<b\\>Note:\\</b\\>
\\<br\\>-Error flag if file isn't exist
\\<br\\>- Error flag if file doesn't exist
\\<b\\>Example1:\\</b\\>
@ -623,7 +626,7 @@ Call functions:
\c ; $R0=0
\c SectionEnd
\S1{} GetFileVersion
\S1{getfileversion} GetFileVersion
\b Get version information from executable file.
@ -635,8 +638,8 @@ Call functions:
\c $var ; Result: Version number
\\<b\\>Note:\\</b\\>
\\<br\\>-Error flag if file isn't exist
\\<br\\>-Error flag if file isn't contain version information
\\<br\\>- Error flag if file doesn't exist
\\<br\\>- Error flag if file doesn't contain version information
\\<b\\>Example:\\</b\\>
@ -646,7 +649,7 @@ Call functions:
\c ; $R0="1.1.0.12"
\c SectionEnd
\S1{} GetExeName
\S1{getexename} GetExeName
\b Get installer filename (with valid case for Windows 98/Me).
@ -661,7 +664,7 @@ Call functions:
\c ; $R0="C:\ftp\program.exe"
\c SectionEnd
\S1{} GetExePath
\S1{getexepath} GetExePath
\b Get installer pathname ($EXEDIR with valid case for Windows 98/Me).
@ -676,7 +679,7 @@ Call functions:
\c ; $R0="C:\ftp"
\c SectionEnd
\S1{} GetParameters
\S1{headers_getparameters} GetParameters
\b Get command line parameters.
@ -691,7 +694,7 @@ Call functions:
\c ; $R0="[parameters]"
\c SectionEnd
\S1{} GetOptions
\S1{getoptions} GetOptions
\b Get options from command line parameters.
@ -706,14 +709,18 @@ Call functions:
\c $var ; Result: option string
\\<b\\>Note:\\</b\\>
\\<br\\>- Error flag if option not found
\\<br\\>- First option symbol it is delimiter
\\<b\\>Example1:\\</b\\>
\c Section
\c ${GetOptions} "/INSTDIR=Temp /SILENT=yes /ADMIN=qwerty" "/ADMIN=" $R0
\c ;$R0=qwerty
\c ${GetOptions} "/S /T" "/T" $R0
\c
\c IfErrors 0 +2
\c MessageBox MB_OK "Not found" IDOK +2
\c MessageBox MB_OK "Found"
\c SectionEnd
\\<b\\>Example2:\\</b\\>
@ -737,7 +744,11 @@ Call functions:
\c ;$R0="C:/Program Files/Common Files"
\c SectionEnd
\S1{} GetRoot
\S1{getoptionss} GetOptionsS
\b Same as \R{getoptions}{GetOptions}, but case sensitive.
\S1{getroot} GetRoot
\b Get root directory.
@ -759,7 +770,7 @@ Call functions:
\c ; $R0="\\SuperPimp\NSIS"
\c SectionEnd
\S1{} GetParent
\S1{headers_getparent} GetParent
\b Get parent directory.
@ -774,7 +785,7 @@ Call functions:
\c ; $R0="C:\Program Files\Winamp"
\c SectionEnd
\S1{} GetFileName
\S1{getfilename} GetFileName
\b Get last part from directory path.
@ -789,7 +800,7 @@ Call functions:
\c ; $R0="uninstwa.exe"
\c SectionEnd
\S1{} GetBaseName
\S1{getbasename} GetBaseName
\b Get file name without extension.
@ -804,7 +815,7 @@ Call functions:
\c ; $R0="program"
\c SectionEnd
\S1{} GetFileExt
\S1{getfileext} GetFileExt
\b Get extention of file.
@ -819,7 +830,7 @@ Call functions:
\c ; $R0="exe"
\c SectionEnd
\S1{} BannerTrimPath
\S1{bannertrimpath} BannerTrimPath
\b Trim string path for banner.
@ -882,7 +893,7 @@ Call functions:
\c Push $0
\c FunctionEnd
\\<b\\>Example (\W{http://nsis.sourceforge.net/Banner_with_Cancel_button}{NxS} plugin):\\</b\\>
\\<b\\>Example (\W{http://nsis.sourceforge.net/Nxs_plug-in}{NxS plugin}):\\</b\\>
\c !include "FileFunc.nsh"
\c !insertmacro Locate
@ -914,7 +925,7 @@ Call functions:
\c Push $0
\c FunctionEnd
\S1{} DirState
\S1{dirstate} DirState
\b Check directory full, empty or not exist.
@ -935,7 +946,7 @@ Call functions:
\c ; $R0="1" directory is full
\c SectionEnd
\S1{} RefreshShellIcons
\S1{refreshshellicons} RefreshShellIcons
\b After changing file associations, you can call this function to refresh the shell immediately.
@ -981,7 +992,7 @@ Call functions:
\c SectionEnd
\S1{} LineFind
\S1{linefind} LineFind
\b Find specified lines in text file, and edit or view these lines in callback function.
@ -1025,8 +1036,8 @@ Call functions:
\c FunctionEnd
\\<b\\>Note:\\</b\\>
\\<br\\>-Error flag if input file isn't exists
\\<br\\>-Error flag if output file path isn't exists
\\<br\\>- Error flag if input file doesn't exist
\\<br\\>- Error flag if output file path doesn't exist
\\<br\\>- Ranges must be specified on growth (2 4:5 9:-8 -5:-4 -2:-1)
\\<br\\>- Output file will not be updated if no changes made.
@ -1182,7 +1193,7 @@ Call functions:
\c Push $0
\c FunctionEnd
\S1{} LineRead
\S1{lineread} LineRead
\b Get line in file specified with number.
@ -1199,7 +1210,7 @@ Call functions:
\c $var ; Result: Line
\\<b\\>Note:\\</b\\>
\\<br\\>-Error flag if input file isn't exists
\\<br\\>- Error flag if input file doesn't exist
\\<br\\>- Error flag if line number not found
\\<b\\>Example:\\</b\\>
@ -1209,7 +1220,7 @@ Call functions:
\c ; $R0="Last line$\r$\n"
\c SectionEnd
\S1{} FileReadFromEnd
\S1{filereadfromend} FileReadFromEnd
\b Read text file from end line by line.
@ -1232,7 +1243,7 @@ Call functions:
\c FunctionEnd
\\<b\\>Note:\\</b\\>
\\<br\\>-Error flag if input file isn't exists
\\<br\\>- Error flag if input file doesn't exist
\\<b\\>Example1:\\</b\\>
@ -1275,7 +1286,7 @@ Call functions:
\c Push $0
\c FunctionEnd
\S1{} LineSum
\S1{linesum} LineSum
\b Get sum of lines in text file.
@ -1287,7 +1298,7 @@ Call functions:
\c $var ; Result: Sum of lines
\\<b\\>Note:\\</b\\>
\\<br\\>-Error flag if input file isn't exists
\\<br\\>- Error flag if input file doesn't exist
\\<b\\>Example:\\</b\\>
@ -1296,7 +1307,7 @@ Call functions:
\c ; $R0="54"
\c SectionEnd
\S1{} FileJoin
\S1{filejoin} FileJoin
\b Join two files in one (File1 + File2 = File3).
@ -1310,8 +1321,8 @@ Call functions:
\c ; If [File3]="" Then add [File2] to [File1]
\\<b\\>Note:\\</b\\>
\\<br\\>-Error flag if input files aren't exists
\\<br\\>-Error flag if output file path isn't exists
\\<br\\>- Error flag if input files don't exist
\\<br\\>- Error flag if output file path doesn't exist
\\<b\\>Example1 (Join: a.log + b.log = Z.log):\\</b\\>
@ -1325,7 +1336,7 @@ Call functions:
\c ${FileJoin} "C:\a.log" "C:\logs\b.log" "C:\a.log"
\c SectionEnd
\S1{} TextCompare
\S1{textcompare} TextCompare
\b Compare two text files.
@ -1360,7 +1371,7 @@ Call functions:
\c FunctionEnd
\\<b\\>Note:\\</b\\>
\\<br\\>-Error flag if File1 or File2 isn't exist
\\<br\\>- Error flag if File1 or File2 doesn't exist
\\<br\\>- Error flag if syntax error
\\<b\\>Example (Different or Equal):\\</b\\>
@ -1496,7 +1507,11 @@ Call functions:
\c Push $0
\c FunctionEnd
\S1{} ConfigRead
\S1{textcompares} TextCompareS
\b Same as \R{textcompare}{TextCompare}, but case sensitive.
\S1{configread} ConfigRead
\b Read value from entry name in config file.
@ -1511,7 +1526,8 @@ Call functions:
\c $var ; Result: Value
\\<b\\>Note:\\</b\\>
\\<br\\>-Error flag if file isn't exist
\\<br\\>- Error flag if entry not found
\\<br\\>- Error flag if file doesn't exist
\\<b\\>Example1:\\</b\\>
@ -1527,7 +1543,11 @@ Call functions:
\c ;$R0=30
\c SectionEnd
\S1{} ConfigWrite
\S1{configreads} ConfigReadS
\b Same as \R{configread}{ConfigRead}, but case sensitive.
\S1{configwrite} ConfigWrite
\b Write value from entry name in config file.
@ -1549,7 +1569,7 @@ Call functions:
\c ; $var=SAME Entry and Value already exist
\\<b\\>Note:\\</b\\>
\\<br\\>-Error flag if file isn't exist
\\<br\\>- Error flag if file doesn't exist
\\<br\\>- Error flag if file can't be opened
\\<b\\>Example1:\\</b\\>
@ -1573,7 +1593,11 @@ Call functions:
\c ;$R0=DELETED
\c SectionEnd
\S1{} FileRecode
\S1{configwrites} ConfigWriteS
\b Same as \R{configwrite}{ConfigWrite}, but case sensitive.
\S1{filerecode} FileRecode
\b Recode text file from DOS to Windows format and vice-versa.
@ -1587,7 +1611,7 @@ Call functions:
\c ; CharToOem -from Windows to DOS
\\<b\\>Note:\\</b\\>
\\<br\\>-Error flag if file isn't exist
\\<br\\>- Error flag if file doesn't exist
\\<br\\>- Error flag if syntax error
\\<b\\>Example:\\</b\\>
@ -1596,7 +1620,7 @@ Call functions:
\c ${FileRecode} "C:\SCANDISK.LOG" "CharToOem"
\c SectionEnd
\S1{} TrimNewLines
\S1{headers_trimnewlines} TrimNewLines
\b Trim newlines in a string.
@ -1644,7 +1668,7 @@ Call functions:
\c SectionEnd
\S1{} WordFind
\S1{wordfind} WordFind
\b Multi-features string function.
@ -1867,7 +1891,11 @@ Call functions:
\c ; $R0="OneWord"
\c SectionEnd
\S1{} WordFind2X
\S1{wordfinds} WordFindS
\b Same as \R{wordfind}{WordFind}, but case sensitive.
\S1{wordfind2x} WordFind2X
\b Find word between two delimiters.
@ -1975,7 +2003,11 @@ Call functions:
\c end:
\c SectionEnd
\S1{} WordFind3X
\S1{wordfind2xs} WordFind2XS
\b Same as \R{wordfind2x}{WordFind2X}, but case sensitive.
\S1{wordfind3x} WordFind3X
\b Find a word that contains a string, between two delimiters.
@ -2079,7 +2111,11 @@ Call functions:
\c end:
\c SectionEnd
\S1{} WordReplace
\S1{wordfind3xs} WordFind3XS
\b Same as \R{wordfind3x}{WordFind3X}, but case sensitive.
\S1{wordreplace} WordReplace
\b Replace or delete word from string.
@ -2098,17 +2134,25 @@ Call functions:
\c ; -number : word number from end
\c ; +number* : word number from start multiple-replace
\c ; -number* : word number from end multiple-replace
\c ; + : replace or delete all found
\c ; +* : multiple-replace all found
\c ; {} : if exists replace or delete all delimiters
\c ; from edges (no errorlevel output)
\c ; {}* : if exists multiple-replace all delimiters
\c ; from edges (no errorlevel output)
\c ; + : replace all results
\c ; +* : multiple-replace all results
\c ; { : if exists replace all delimiters
\c ; from left edge
\c ; } : if exists replace all delimiters
\c ; from right edge
\c ; {} : if exists replace all delimiters
\c ; from edges
\c ; {* : if exists multiple-replace all
\c ; delimiters from left edge
\c ; }* : if exists multiple-replace all
\c ; delimiters from right edge
\c ; {}* : if exists multiple-replace all
\c ; delimiters from edges
\c ;
\c ;[E]
\c ; with errorlevel output
\c ; IfErrors:
\c ; $var=1 word to replace or delete not found
\c ; $var=1 word to replace not found
\c ; $var=2 no such word number
\c ; $var=3 syntax error (Use: +1,-1,+1*,-1*,+,+*,{},{}*)
\c ;[]
@ -2168,7 +2212,11 @@ Call functions:
\c end:
\c SectionEnd
\S1{} WordAdd
\S1{wordreplaces} WordReplaceS
\b Same as \R{wordreplace}{WordReplace}, but case sensitive.
\S1{wordadd} WordAdd
\b Add words to string1 from string2 if not exist or delete words if exist.
@ -2254,7 +2302,11 @@ Call functions:
\c end:
\c SectionEnd
\S1{} WordInsert
\S1{wordadds} WordAddS
\b Same as \R{wordadd}{WordAdd}, but case sensitive.
\S1{wordinsert} WordInsert
\b Insert word in string.
@ -2320,7 +2372,11 @@ Call functions:
\c end:
\c SectionEnd
\S1{} StrFilter
\S1{wordinserts} WordInsertS
\b Same as \R{wordinsert}{WordInsert}, but case sensitive.
\S1{strfilter} StrFilter
\b Convert string to uppercase or lowercase.
@ -2464,7 +2520,11 @@ Call functions:
\c Exch $R0
\c FunctionEnd
\S1{} VersionCompare
\S1{strfilters} StrFilterS
\b Same as \R{strfilter}{StrFilter}, but case sensitive.
\S1{versioncompare} VersionCompare
\b Compare version numbers.
@ -2486,7 +2546,7 @@ Call functions:
\c ; $R0="1"
\c SectionEnd
\S1{} VersionConvert
\S1{versionconvert} VersionConvert
\b Convert version in the numerical format which can be compared.

View file

@ -3,7 +3,7 @@
; File Functions
;_____________________________________________________________________________
;
; 2005 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
; 2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
Name "File Functions"
OutFile "FileFunc.exe"
@ -670,6 +670,7 @@ Function LeaveCustom
GetOptions:
${GetOptions} "$R1" "$R3" $0
IfErrors error
StrCpy $R0 '$0'
goto send

View file

@ -3,7 +3,7 @@
; File Functions Test
;_____________________________________________________________________________
;
; 2005 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
; 2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
Name "File Functions Test"
OutFile "FileFuncTest.exe"
@ -33,6 +33,7 @@ Var OUT7
!insertmacro GetExePath
!insertmacro GetParameters
!insertmacro GetOptions
!insertmacro GetOptionsS
!insertmacro GetRoot
!insertmacro GetParent
!insertmacro GetFileName
@ -53,6 +54,7 @@ Var OUT7
!insertmacro un.GetExePath
!insertmacro un.GetParameters
!insertmacro un.GetOptions
!insertmacro un.GetOptionsS
!insertmacro un.GetRoot
!insertmacro un.GetParent
!insertmacro un.GetFileName
@ -281,9 +283,38 @@ Section GetOptions
StrCmp $OUT1 '"C:/Program Files/Common Files"' 0 error
${GetOptions} `/INSTDIR='"C:/Program Files/Common Files"' /SILENT=yes` '/INSTDIR*=' $OUT1
IfErrors 0 error
StrCmp $OUT1 '' 0 error
${GetOptions} `/INSTDIR="C:/Program Files/Common Files" /SILENT=yes` '' $OUT1
IfErrors 0 error
StrCmp $OUT1 '' 0 error
${GetOptionsS} '/INSTDIR=C:\Program Files\Common Files /SILENT' '/SILENT' $OUT1
IfErrors error
StrCmp $OUT1 '' 0 error
goto +2
error:
SetErrors
${StackVerificationEnd}
SectionEnd
Section GetOptionsS
${StackVerificationStart} GetOptionsS
${GetOptionsS} '/INSTDIR=C:\Program Files\Common Files /SILENT=yes' '/INSTDIR=' $OUT1
IfErrors error
StrCmp $OUT1 'C:\Program Files\Common Files' 0 error
${GetOptionsS} '/INSTDIR=C:\Program Files\Common Files /SILENT=yes' '/Instdir=' $OUT1
IfErrors 0 error
StrCmp $OUT1 '' 0 error
${GetOptionsS} '/INSTDIR=C:\Program Files\Common Files /SILENT' '/SILENT' $OUT1
IfErrors error
StrCmp $OUT1 '' 0 error
goto +2
@ -510,6 +541,7 @@ Section un.Uninstall
${un.GetExePath} $OUT1
${un.GetParameters} $OUT1
${un.GetOptions} '/INSTDIR=C:\Program Files\Common Files /SILENT=yes' '/INSTDIR=' $OUT1
${un.GetOptionsS} '/INSTDIR=C:\Program Files\Common Files /SILENT=yes' '/INSTDIR=' $OUT1
${un.GetRoot} 'C:\Program Files\NSIS' $OUT1
${un.GetParent} 'C:\Program Files\Winamp\uninstwa.exe' $OUT1
${un.GetFileName} 'C:\Program Files\Winamp\uninstwa.exe' $OUT1

View file

@ -3,7 +3,7 @@
; Text Functions
;_____________________________________________________________________________
;
; 2005 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
; 2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
Name "Text Functions"
OutFile "TextFunc.exe"
@ -142,12 +142,19 @@ Function LeaveCustom
goto +2
FileWrite $0 '!include "WordFunc.nsh"$\r$\n'
FileWrite $0 '!insertmacro WordFind$\r$\n'
FileWrite $0 '!insertmacro WordFindS$\r$\n'
FileWrite $0 '!insertmacro WordFind2X$\r$\n'
FileWrite $0 '!insertmacro WordFind2XS$\r$\n'
FileWrite $0 '!insertmacro WordFind3X$\r$\n'
FileWrite $0 '!insertmacro WordFind3XS$\r$\n'
FileWrite $0 '!insertmacro WordReplace$\r$\n'
FileWrite $0 '!insertmacro WordReplaceS$\r$\n'
FileWrite $0 '!insertmacro WordAdd$\r$\n'
FileWrite $0 '!insertmacro WordAddS$\r$\n'
FileWrite $0 '!insertmacro WordInsert$\r$\n'
FileWrite $0 '!insertmacro WordInsertS$\r$\n'
FileWrite $0 '!insertmacro StrFilter$\r$\n'
FileWrite $0 '!insertmacro StrFilterS$\r$\n'
TextFuncInclude:
IfFileExists '$EXEDIR\TextFunc.nsh' 0 +3
FileWrite $0 '!include "$EXEDIR\TextFunc.nsh"$\r$\n'
@ -257,9 +264,11 @@ Function LeaveCustom
FileWrite $0 " FileWrite $$R4 '---Second Line ...---$$\$8$$\$9'$\r$\n$\r$\n"
goto endwrite
Example5LF:
FileWrite $0 " ; Use any of WordFunctions:$\r$\n"
FileWrite $0 " ; $7WordFind}|$7WordFind2X}|$7WordFind3X}|$\r$\n"
FileWrite $0 " ; $7WordReplace}|$7WordAdd}|$7WordInsert}|$7StrFilter}$\r$\n$\r$\n"
FileWrite $0 " ; You can use:$\r$\n"
FileWrite $0 " ; $7WordFind}|$7WordFindS}|$7WordFind2X}|$7WordFind2XS}|$\r$\n"
FileWrite $0 " ; $7WordFind3X}|$7WordFind3XS}|$7WordReplace}|$7WordReplaceS}|$\r$\n"
FileWrite $0 " ; $7WordAdd}|$7WordAddS}|$7WordInsert}|$7WordInsertS}|$\r$\n"
FileWrite $0 " ; $7StrFilter}|$7StrFilterS}$\r$\n$\r$\n"
FileWrite $0 " $7WordReplace} '$$R9' ' ' '_' '+*' $$R9$\r$\n$\r$\n"
goto endwrite
Example6LF:

View file

@ -3,7 +3,7 @@
; Text Functions Test
;_____________________________________________________________________________
;
; 2005 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
; 2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
Name "Text Functions Test"
OutFile "TextFuncTest.exe"
@ -26,8 +26,11 @@ Var OUT
!insertmacro LineSum
!insertmacro FileJoin
!insertmacro TextCompare
!insertmacro TextCompareS
!insertmacro ConfigRead
!insertmacro ConfigReadS
!insertmacro ConfigWrite
!insertmacro ConfigWriteS
!insertmacro FileRecode
!insertmacro TrimNewLines
@ -37,8 +40,11 @@ Var OUT
!insertmacro un.LineSum
!insertmacro un.FileJoin
!insertmacro un.TextCompare
!insertmacro un.TextCompareS
!insertmacro un.ConfigRead
!insertmacro un.ConfigReadS
!insertmacro un.ConfigWrite
!insertmacro un.ConfigWriteS
!insertmacro un.FileRecode
!insertmacro un.TrimNewLines
@ -120,16 +126,16 @@ FunctionEnd
Section CreateTestFile
GetTempFileName $TEMPFILE1 $PLUGINSDIR
GetTempFileName $TEMPFILE1
FileOpen $HANDLE $TEMPFILE1 w
FileWrite $HANDLE '1=a$\r$\n'
FileWrite $HANDLE '2=b$\r$\n'
FileWrite $HANDLE '3=c$\r$\n'
FileWrite $HANDLE '4=d$\r$\n'
FileWrite $HANDLE '5=e$\r$\n'
FileWrite $HANDLE '1A=a$\r$\n'
FileWrite $HANDLE '2B=b$\r$\n'
FileWrite $HANDLE '3C=c$\r$\n'
FileWrite $HANDLE '4D=d$\r$\n'
FileWrite $HANDLE '5E=e$\r$\n'
FileClose $HANDLE
GetTempFileName $TEMPFILE2 $PLUGINSDIR
GetTempFileName $TEMPFILE3 $PLUGINSDIR
GetTempFileName $TEMPFILE2
GetTempFileName $TEMPFILE3
SectionEnd
@ -138,14 +144,14 @@ Section LineFind
${LineFind} '$TEMPFILE1' '/NUL' '1:-4 3 -1' 'LineFindCallback1'
IfErrors error
StrCmp $OUT '|1:2|-5|1|1=a$\r$\n|1:2|-4|2|2=b$\r$\n|3:3|-3|3|3=c$\r$\n' 0 error
StrCmp $OUT '|1:2|-5|1|1A=a$\r$\n|1:2|-4|2|2B=b$\r$\n|3:3|-3|3|3C=c$\r$\n' 0 error
StrCpy $OUT ''
SetDetailsPrint none
${LineFind} '$TEMPFILE1' '$TEMPFILE2' '1:-1' 'LineFindCallback2'
SetDetailsPrint both
IfErrors error
StrCmp $OUT '|1:-1||1|1=a$\r$\n|1:-1||2|4=d$\r$\n|1:-1||3|3=c$\r$\n|1:-1||4|2=x$\r$\n|1:-1||5|5=e$\r$\n' 0 error
StrCmp $OUT '|1:-1||1|1A=a$\r$\n|1:-1||2|4D=d$\r$\n|1:-1||3|3C=c$\r$\n|1:-1||4|2B=B$\r$\n|1:-1||5|5E=e$\r$\n' 0 error
goto +2
error:
@ -164,9 +170,9 @@ FunctionEnd
Function LineFindCallback2
StrCmp $R8 2 0 +2
StrCpy $R9 '4=d$\r$\n'
StrCpy $R9 '4D=d$\r$\n'
StrCmp $R8 4 0 +2
StrCpy $R9 '2=x$\r$\n'
StrCpy $R9 '2B=B$\r$\n'
StrCpy $OUT '$OUT|$R6|$R7|$R8|$R9'
@ -179,7 +185,7 @@ Section LineRead
${LineRead} '$TEMPFILE1' '-1' $OUT
IfErrors error
StrCmp $OUT '5=e$\r$\n' 0 error
StrCmp $OUT '5E=e$\r$\n' 0 error
goto +2
error:
@ -195,7 +201,7 @@ Section FileReadFromEnd
StrCpy $OUT ''
${FileReadFromEnd} '$TEMPFILE1' 'FileReadFromEndCallback'
IfErrors error
StrCmp $OUT '|-1|5|5=e$\r$\n|-2|4|4=d$\r$\n|-3|3|3=c$\r$\n|-4|2|2=b$\r$\n' 0 error
StrCmp $OUT '|-1|5|5E=e$\r$\n|-2|4|4D=d$\r$\n|-3|3|3C=c$\r$\n|-4|2|2B=b$\r$\n' 0 error
goto +2
error:
@ -244,19 +250,37 @@ Section TextCompare
StrCpy $OUT ''
${TextCompare} '$TEMPFILE1' '$TEMPFILE2' 'FastDiff' 'TextCompareCallback'
StrCmp $OUT '|2|4=d$\r$\n|2|2=b$\r$\n|4|2=x$\r$\n|4|4=d$\r$\n' 0 error
StrCmp $OUT '|2|4D=d$\r$\n|2|2B=b$\r$\n|4|2B=B$\r$\n|4|4D=d$\r$\n' 0 error
StrCpy $OUT ''
${TextCompare} '$TEMPFILE1' '$TEMPFILE2' 'FastEqual' 'TextCompareCallback'
StrCmp $OUT '|1|1=a$\r$\n|1|1=a$\r$\n|3|3=c$\r$\n|3|3=c$\r$\n|5|5=e$\r$\n|5|5=e$\r$\n' 0 error
StrCmp $OUT '|1|1A=a$\r$\n|1|1A=a$\r$\n|3|3C=c$\r$\n|3|3C=c$\r$\n|5|5E=e$\r$\n|5|5E=e$\r$\n' 0 error
StrCpy $OUT ''
${TextCompare} '$TEMPFILE1' '$TEMPFILE2' 'SlowDiff' 'TextCompareCallback'
StrCmp $OUT '|||2|2=b$\r$\n' 0 error
StrCmp $OUT '' 0 error
StrCpy $OUT ''
${TextCompare} '$TEMPFILE1' '$TEMPFILE2' 'SlowEqual' 'TextCompareCallback'
StrCmp $OUT '|1|1=a$\r$\n|1|1=a$\r$\n|3|3=c$\r$\n|3|3=c$\r$\n|2|4=d$\r$\n|4|4=d$\r$\n|5|5=e$\r$\n|5|5=e$\r$\n' 0 error
StrCmp $OUT '|1|1A=a$\r$\n|1|1A=a$\r$\n|4|2B=B$\r$\n|2|2B=b$\r$\n|3|3C=c$\r$\n|3|3C=c$\r$\n|2|4D=d$\r$\n|4|4D=d$\r$\n|5|5E=e$\r$\n|5|5E=e$\r$\n' 0 error
goto +2
error:
SetErrors
${StackVerificationEnd}
SectionEnd
Section TextCompareS
${StackVerificationStart} TextCompareS
StrCpy $OUT ''
${TextCompareS} '$TEMPFILE1' '$TEMPFILE2' 'SlowDiff' 'TextCompareCallback'
StrCmp $OUT '|||2|2B=b$\r$\n' 0 error
StrCpy $OUT ''
${TextCompareS} '$TEMPFILE1' '$TEMPFILE2' 'SlowEqual' 'TextCompareCallback'
StrCmp $OUT '|1|1A=a$\r$\n|1|1A=a$\r$\n|3|3C=c$\r$\n|3|3C=c$\r$\n|2|4D=d$\r$\n|4|4D=d$\r$\n|5|5E=e$\r$\n|5|5E=e$\r$\n' 0 error
goto +2
error:
@ -275,10 +299,31 @@ FunctionEnd
Section ConfigRead
${StackVerificationStart} ConfigRead
${ConfigRead} '$TEMPFILE1' '3=' $OUT
${ConfigRead} '$TEMPFILE1' '3c=' $OUT
StrCmp $OUT 'c' 0 error
${ConfigRead} '$TEMPFILE1' '6=' $OUT
${ConfigRead} '$TEMPFILE1' '6F=' $OUT
StrCmp $OUT '' 0 error
${ConfigRead} '$TEMPFILE1' 'FF=' $OUT
IfErrors 0 error
goto +2
error:
SetErrors
${StackVerificationEnd}
SectionEnd
Section ConfigReadS
${StackVerificationStart} ConfigReadS
${ConfigReadS} '$TEMPFILE1' '3C=' $OUT
StrCmp $OUT 'c' 0 error
${ConfigReadS} '$TEMPFILE1' '3c=' $OUT
IfErrors 0 error
StrCmp $OUT '' 0 error
goto +2
@ -292,16 +337,30 @@ SectionEnd
Section ConfigWrite
${StackVerificationStart} ConfigWrite
${ConfigWrite} '$TEMPFILE1' '5=' 'e**' $OUT
${ConfigWrite} '$TEMPFILE1' '5E=' 'e**' $OUT
StrCmp $OUT 'CHANGED' 0 error
${ConfigWrite} '$TEMPFILE1' '2=' '' $OUT
${ConfigWrite} '$TEMPFILE1' '2B=' '' $OUT
StrCmp $OUT 'DELETED' 0 error
${ConfigWrite} '$TEMPFILE1' '3=' 'c' $OUT
${ConfigWrite} '$TEMPFILE1' '3c=' 'c' $OUT
StrCmp $OUT 'SAME' 0 error
${ConfigWrite} '$TEMPFILE1' '6=' '*' $OUT
${ConfigWrite} '$TEMPFILE1' '6F=' '*' $OUT
StrCmp $OUT 'ADDED' 0 error
goto +2
error:
SetErrors
${StackVerificationEnd}
SectionEnd
Section ConfigWriteS
${StackVerificationStart} ConfigWriteS
${ConfigWriteS} '$TEMPFILE1' '5e=' 'e**' $OUT
StrCmp $OUT 'ADDED' 0 error
goto +2
@ -342,15 +401,16 @@ SectionEnd
Section WriteUninstaller
SetDetailsPrint none
Delete $TEMPFILE1
Delete $TEMPFILE2
Delete $TEMPFILE3
SetDetailsPrint both
goto +2
WriteUninstaller '$EXEDIR\un.TextFuncTest.exe'
SectionEnd
Function .onInit
InitPluginsDir
FunctionEnd
;############### UNINSTALL ###############
@ -361,8 +421,11 @@ Section un.Uninstall
${un.LineSum} '$TEMPFILE1' $OUT
${un.FileJoin} '$TEMPFILE1' '$TEMPFILE2' '$TEMPFILE3'
${un.TextCompare} '$TEMPFILE1' '$TEMPFILE2' 'FastDiff' 'un.TextCompareCallback'
${un.ConfigRead} '$TEMPFILE1' '3=' $OUT
${un.ConfigWrite} '$TEMPFILE1' '5=' 'e**' $OUT
${un.TextCompareS} '$TEMPFILE1' '$TEMPFILE2' 'FastDiff' 'un.TextCompareCallback'
${un.ConfigRead} '$TEMPFILE1' '3c=' $OUT
${un.ConfigReadS} '$TEMPFILE1' '3c=' $OUT
${un.ConfigWrite} '$TEMPFILE1' '5E=' 'e**' $OUT
${un.ConfigWriteS} '$TEMPFILE1' '5E=' 'e**' $OUT
${un.FileRecode} '$TEMPFILE1' 'CharToOem'
${un.TrimNewLines} 'Text Line$\r$\n' $OUT
SectionEnd

View file

@ -3,7 +3,7 @@
; Word Functions Test
;_____________________________________________________________________________
;
; 2005 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
; 2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
Name "Word Functions Test"
OutFile "WordFuncTest.exe"
@ -17,22 +17,36 @@ Var OUT
!include "WordFunc.nsh"
!insertmacro WordFind
!insertmacro WordFindS
!insertmacro WordFind2X
!insertmacro WordFind2XS
!insertmacro WordFind3X
!insertmacro WordFind3XS
!insertmacro WordReplace
!insertmacro WordReplaceS
!insertmacro WordAdd
!insertmacro WordAddS
!insertmacro WordInsert
!insertmacro WordInsertS
!insertmacro StrFilter
!insertmacro StrFilterS
!insertmacro VersionCompare
!insertmacro VersionConvert
!insertmacro un.WordFind
!insertmacro un.WordFindS
!insertmacro un.WordFind2X
!insertmacro un.WordFind2XS
!insertmacro un.WordFind3X
!insertmacro un.WordFind3XS
!insertmacro un.WordReplace
!insertmacro un.WordReplaceS
!insertmacro un.WordAdd
!insertmacro un.WordAddS
!insertmacro un.WordInsert
!insertmacro un.WordInsertS
!insertmacro un.StrFilter
!insertmacro un.StrFilterS
!insertmacro un.VersionCompare
!insertmacro un.VersionConvert
@ -175,6 +189,23 @@ Section WordFind
SectionEnd
Section WordFindS
${StackVerificationStart} WordFindS
${WordFindS} 'C:\io.sys|||Program Files|||WINDOWS' '||' '/|PROGRAM FILES' $OUT
StrCmp $OUT 'C:\io.sys|||Program Files|||WINDOWS' 0 error
${WordFindS} 'C:\io.sys|||Program Files|||WINDOWS' '||' '/|Program Files' $OUT
StrCmp $OUT '2' 0 error
goto +2
error:
SetErrors
${StackVerificationEnd}
SectionEnd
Section WordFind2X
${StackVerificationStart} WordFind2X
@ -219,6 +250,23 @@ Section WordFind2X
SectionEnd
Section WordFind2XS
${StackVerificationStart} WordFind2XS
${WordFind2XS} 'C:\WINDOWS C:\io.sys C:\logo.sys' '\' '.' '/LOGO' $OUT
StrCmp $OUT 'C:\WINDOWS C:\io.sys C:\logo.sys' 0 error
${WordFind2XS} 'C:\WINDOWS C:\io.sys C:\logo.sys' '\' '.' '/logo' $OUT
StrCmp $OUT '2' 0 error
goto +2
error:
SetErrors
${StackVerificationEnd}
SectionEnd
Section WordFind3X
${StackVerificationStart} WordFind3X
@ -260,6 +308,23 @@ Section WordFind3X
SectionEnd
Section WordFind3XS
${StackVerificationStart} WordFind3XS
${WordFind3XS} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '/2.baa' $OUT
StrCmp $OUT '[1.AAB];[2.BAA];[3.BBB];' 0 error
${WordFind3XS} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '/2.BAA' $OUT
StrCmp $OUT '2' 0 error
goto +2
error:
SetErrors
${StackVerificationEnd}
SectionEnd
Section WordReplace
${StackVerificationStart} WordReplace
@ -301,6 +366,23 @@ Section WordReplace
SectionEnd
Section WordReplaceS
${StackVerificationStart} WordReplaceS
${WordReplaceS} 'C:\io.sys C:\logo.sys C:\WINDOWS' 'SYS' 'bmp' '+2' $OUT
StrCmp $OUT 'C:\io.sys C:\logo.sys C:\WINDOWS' 0 error
${WordReplaceS} 'C:\io.sys C:\logo.sys C:\WINDOWS' 'sys' 'bmp' '+2' $OUT
StrCmp $OUT 'C:\io.sys C:\logo.bmp C:\WINDOWS' 0 error
goto +2
error:
SetErrors
${StackVerificationEnd}
SectionEnd
Section WordAdd
${StackVerificationStart} WordAdd
@ -339,6 +421,23 @@ Section WordAdd
SectionEnd
Section WordAddS
${StackVerificationStart} WordAddS
${WordAddS} 'C:\io.sys C:\WINDOWS' ' ' '+C:\windows C:\config.sys' $OUT
StrCmp $OUT 'C:\io.sys C:\WINDOWS C:\windows C:\config.sys' 0 error
${WordAddS} 'C:\io.sys C:\WINDOWS' ' ' '+C:\WINDOWS C:\config.sys' $OUT
StrCmp $OUT 'C:\io.sys C:\WINDOWS C:\config.sys' 0 error
goto +2
error:
SetErrors
${StackVerificationEnd}
SectionEnd
Section WordInsert
${StackVerificationStart} WordInsert
@ -371,6 +470,23 @@ Section WordInsert
SectionEnd
Section WordInsertS
${StackVerificationStart} WordInsertS
${WordInsertS} 'C:\io.sys x C:\logo.sys' ' X ' 'C:\NTLDR' '+2' $OUT
StrCmp $OUT 'C:\io.sys x C:\logo.sys X C:\NTLDR' 0 error
${WordInsertS} 'C:\io.sys x C:\logo.sys' ' x ' 'C:\NTLDR' '+2' $OUT
StrCmp $OUT 'C:\io.sys x C:\NTLDR x C:\logo.sys' 0 error
goto +2
error:
SetErrors
${StackVerificationEnd}
SectionEnd
Section StrFilter
${StackVerificationStart} StrFilter
@ -409,6 +525,21 @@ Section StrFilter
SectionEnd
Section StrFilterS
${StackVerificationStart} StrFilterS
${StrFilterS} '123abc 456DEF 7890|%#' '13' 'af' '4590' $OUT
IfErrors error
StrCmp $OUT '123a 6 78|%#' 0 error
goto +2
error:
SetErrors
${StackVerificationEnd}
SectionEnd
Section VersionCompare
${StackVerificationStart} VersionCompare
@ -478,12 +609,19 @@ SectionEnd
Section un.Uninstall
${un.WordFind} 'C:\io.sys C:\Program Files C:\WINDOWS' ' C:\' '-02' $OUT
${un.WordFindS} 'C:\io.sys C:\Program Files C:\WINDOWS' ' C:\' '-02' $OUT
${un.WordFind2X} '[C:\io.sys];[C:\logo.sys];[C:\WINDOWS]' '[C:\' '];' '+2' $OUT
${un.WordFind2XS} '[C:\io.sys];[C:\logo.sys];[C:\WINDOWS]' '[C:\' '];' '+2' $OUT
${un.WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '+1' $OUT
${un.WordFind3XS} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '+1' $OUT
${un.WordReplace} 'C:\io.sys C:\logo.sys C:\WINDOWS' 'SYS' 'bmp' '+2' $OUT
${un.WordReplaceS} 'C:\io.sys C:\logo.sys C:\WINDOWS' 'SYS' 'bmp' '+2' $OUT
${un.WordAdd} 'C:\io.sys C:\WINDOWS' ' ' '+C:\WINDOWS C:\config.sys' $OUT
${un.WordAddS} 'C:\io.sys C:\WINDOWS' ' ' '+C:\WINDOWS C:\config.sys' $OUT
${un.WordInsert} 'C:\io.sys C:\WINDOWS' ' ' 'C:\logo.sys' '-2' $OUT
${un.WordInsertS} 'C:\io.sys C:\WINDOWS' ' ' 'C:\logo.sys' '-2' $OUT
${un.StrFilter} '123abc 456DEF 7890|%#' '+' '' '' $OUT
${un.StrFilterS} '123abc 456DEF 7890|%#' '+' '' '' $OUT
${un.VersionCompare} '1.1.1.9' '1.1.1.01' $OUT
${un.VersionConvert} '9.0a' '' $OUT
SectionEnd

View file

@ -1,10 +1,10 @@
/*
_____________________________________________________________________________
File Functions Header v2.9
File Functions Header v3.0
_____________________________________________________________________________
2005 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
See documentation for more information about the following functions.
@ -18,14 +18,14 @@ _____________________________________________________________________________
FileFunction=[Locate|GetSize|DriveSpace|GetDrives|GetTime|GetFileAttributes|
GetFileVersion|GetExeName|GetExePath|GetParameters|GetOptions|
GetRoot|GetParent|GetFileName|GetBaseName|GetFileExt|
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.GetRoot|
un.GetParent|un.GetFileName|un.GetBaseName|un.GetFileExt|
un.BannerTrimPath|un.DirState|un.RefreshShellIcons]
un.GetExePath|un.GetParameters|un.GetOptions|un.GetOptionsS|
un.GetRoot|un.GetParent|un.GetFileName|un.GetBaseName|
un.GetFileExt|un.BannerTrimPath|un.DirState|un.RefreshShellIcons]
_____________________________________________________________________________
@ -70,7 +70,7 @@ RefreshShellIcons
; !include "FileFunc.nsh"
; !insertmacro Locate
; ${FILEFUNC_VERBOSE} 4 # all verbosity
; !insertmacro GetTime
; !insertmacro VersionCompare
; ${FILEFUNC_VERBOSE} 3 # no script
!verbose push
@ -81,6 +81,7 @@ RefreshShellIcons
!verbose ${_FILEFUNC_VERBOSE}
!define FILEFUNC_VERBOSE `!insertmacro FILEFUNC_VERBOSE`
!define _FILEFUNC_UN
!define _FILEFUNC_S
!verbose pop
!macro FILEFUNC_VERBOSE _VERBOSE
@ -88,12 +89,12 @@ RefreshShellIcons
!verbose 3
!undef _FILEFUNC_VERBOSE
!define _FILEFUNC_VERBOSE ${_VERBOSE}
!verbose 4
!echo `"verbosity=${_VERBOSE}"`
!verbose pop
!macroend
# Install. Case insensitive. #
!macro LocateCall _PATH _OPTIONS _FUNC
!verbose push
!verbose ${_FILEFUNC_VERBOSE}
@ -563,8 +564,6 @@ RefreshShellIcons
Pop $0
FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -796,8 +795,6 @@ RefreshShellIcons
Exch $0
FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -913,8 +910,6 @@ RefreshShellIcons
Exch $0
FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -1041,8 +1036,6 @@ RefreshShellIcons
Pop $0
FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -1178,8 +1171,6 @@ RefreshShellIcons
Exch $0
FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -1327,8 +1318,6 @@ RefreshShellIcons
Exch $0
FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -1372,8 +1361,6 @@ RefreshShellIcons
Exch $0
FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -1397,8 +1384,6 @@ RefreshShellIcons
Exch $0
FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -1422,8 +1407,6 @@ RefreshShellIcons
Exch $0
FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -1467,19 +1450,17 @@ RefreshShellIcons
Exch $0
FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
!macro GetOptions
!ifndef ${_FILEFUNC_UN}GetOptions
!ifndef ${_FILEFUNC_UN}GetOptions${_FILEFUNC_S}
!verbose push
!verbose ${_FILEFUNC_VERBOSE}
!define ${_FILEFUNC_UN}GetOptions `!insertmacro ${_FILEFUNC_UN}GetOptionsCall`
!define ${_FILEFUNC_UN}GetOptions${_FILEFUNC_S} `!insertmacro ${_FILEFUNC_UN}GetOptions${_FILEFUNC_S}Call`
Function ${_FILEFUNC_UN}GetOptions
Function ${_FILEFUNC_UN}GetOptions${_FILEFUNC_S}
Exch $1
Exch
Exch $0
@ -1490,6 +1471,7 @@ RefreshShellIcons
Push $5
Push $6
Push $7
ClearErrors
StrCpy $2 $1 '' 1
StrCpy $1 $1 1
@ -1503,44 +1485,44 @@ RefreshShellIcons
quote:
IntOp $4 $4 + 1
StrCpy $5 $0 1 $4
StrCmp $5$7 '0' notfound
StrCmp $5 '' trimright
StrCmp $5 '"' 0 +7
StrCmp $6 '' 0 +3
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 $6 '"' 0 +3
StrCmp${_FILEFUNC_S} $6 '"' 0 +3
StrCpy $6 ''
goto quote
StrCmp $5 `'` 0 +7
StrCmp $6 `` 0 +3
StrCmp${_FILEFUNC_S} $5 `'` 0 +7
StrCmp${_FILEFUNC_S} $6 `` 0 +3
StrCpy $6 `'`
goto quote
StrCmp $6 `'` 0 +3
StrCmp${_FILEFUNC_S} $6 `'` 0 +3
StrCpy $6 ``
goto quote
StrCmp $5 '`' 0 +7
StrCmp $6 '' 0 +3
StrCmp${_FILEFUNC_S} $5 '`' 0 +7
StrCmp${_FILEFUNC_S} $6 '' 0 +3
StrCpy $6 '`'
goto quote
StrCmp $6 '`' 0 +3
StrCmp${_FILEFUNC_S} $6 '`' 0 +3
StrCpy $6 ''
goto quote
StrCmp $6 '"' quote
StrCmp $6 `'` quote
StrCmp $6 '`' quote
StrCmp $5 $1 0 quote
StrCmp $7 0 trimleft trimright
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 $5 '' notfound
StrCmp $5 $2 0 quote
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 $4 ' ' 0 +3
StrCmp${_FILEFUNC_S} $4 ' ' 0 +3
StrCpy $0 $0 '' 1
goto -3
StrCpy $7 1
@ -1549,19 +1531,20 @@ RefreshShellIcons
trimright:
StrCpy $0 $0 $4
StrCpy $4 $0 1 -1
StrCmp $4 ' ' 0 +3
StrCmp${_FILEFUNC_S} $4 ' ' 0 +3
StrCpy $0 $0 -1
goto -3
StrCpy $3 $0 1
StrCpy $4 $0 1 -1
StrCmp $3 $4 0 end
StrCmp $3 '"' +3
StrCmp $3 `'` +2
StrCmp $3 '`' 0 end
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:
@ -1575,8 +1558,6 @@ RefreshShellIcons
Exch $0
FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -1628,8 +1609,6 @@ RefreshShellIcons
Exch $0
FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -1662,8 +1641,6 @@ RefreshShellIcons
Exch $0
FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -1698,8 +1675,6 @@ RefreshShellIcons
Exch $0
FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -1747,8 +1722,6 @@ RefreshShellIcons
Exch $0
FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -1787,8 +1760,6 @@ RefreshShellIcons
Exch $0
FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -1882,8 +1853,6 @@ RefreshShellIcons
Exch $0
FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -1918,8 +1887,6 @@ RefreshShellIcons
Exch $0
FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -1934,12 +1901,13 @@ RefreshShellIcons
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
# Uninstall. Case insensitive. #
!macro un.LocateCall _PATH _OPTIONS _FUNC
!verbose push
!verbose ${_FILEFUNC_VERBOSE}
@ -2136,6 +2104,8 @@ RefreshShellIcons
!insertmacro Locate
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -2149,6 +2119,8 @@ RefreshShellIcons
!insertmacro GetSize
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -2162,6 +2134,8 @@ RefreshShellIcons
!insertmacro DriveSpace
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -2175,6 +2149,8 @@ RefreshShellIcons
!insertmacro GetDrives
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -2188,6 +2164,8 @@ RefreshShellIcons
!insertmacro GetTime
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -2201,6 +2179,8 @@ RefreshShellIcons
!insertmacro GetFileAttributes
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -2214,6 +2194,8 @@ RefreshShellIcons
!insertmacro GetFileVersion
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -2227,6 +2209,8 @@ RefreshShellIcons
!insertmacro GetExeName
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -2240,6 +2224,8 @@ RefreshShellIcons
!insertmacro GetExePath
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -2253,6 +2239,8 @@ RefreshShellIcons
!insertmacro GetParameters
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -2266,6 +2254,8 @@ RefreshShellIcons
!insertmacro GetOptions
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -2279,6 +2269,8 @@ RefreshShellIcons
!insertmacro GetRoot
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -2292,6 +2284,8 @@ RefreshShellIcons
!insertmacro GetParent
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -2305,6 +2299,8 @@ RefreshShellIcons
!insertmacro GetFileName
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -2318,6 +2314,8 @@ RefreshShellIcons
!insertmacro GetBaseName
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -2331,6 +2329,8 @@ RefreshShellIcons
!insertmacro GetFileExt
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -2344,6 +2344,8 @@ RefreshShellIcons
!insertmacro BannerTrimPath
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -2357,6 +2359,8 @@ RefreshShellIcons
!insertmacro DirState
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
@ -2370,6 +2374,68 @@ RefreshShellIcons
!insertmacro RefreshShellIcons
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop
!endif
!macroend
# Install. Case sensitive. #
!macro GetOptionsSCall _PARAMETERS _OPTION _RESULT
!verbose push
!verbose ${_FILEFUNC_VERBOSE}
Push `${_PARAMETERS}`
Push `${_OPTION}`
Call GetOptionsS
Pop ${_RESULT}
!verbose pop
!macroend
!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`
!insertmacro GetOptions
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!undef _FILEFUNC_S
!define _FILEFUNC_S
!verbose pop
!endif
!macroend

View file

@ -1,10 +1,10 @@
/*
_____________________________________________________________________________
Text Functions Header v2.1
Text Functions Header v2.2
_____________________________________________________________________________
2005 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
See documentation for more information about the following functions.
@ -17,12 +17,13 @@ _____________________________________________________________________________
TextFunction=[LineFind|LineRead|FileReadFromEnd|LineSum|FileJoin|
TextCompare|ConfigRead|ConfigWrite|FileRecode|TrimNewLines]
TextCompare|TextCompareS|ConfigRead|ConfigReadS|
ConfigWrite|ConfigWriteS|FileRecode|TrimNewLines]
un.TextFunction=[un.LineFind|un.LineRead|un.FileReadFromEnd|un.LineSum|
un.FileJoin|un.TextCompare|un.ConfigRead|un.ConfigWrite|
un.FileRecode|un.TrimNewLines]
un.FileJoin|un.TextCompare|un.TextCompareS|un.ConfigRead|
un.ConfigReadS|un.ConfigWrite|un.ConfigWriteS|un.FileRecode|
un.TrimNewLines]
_____________________________________________________________________________
@ -66,6 +67,7 @@ TrimNewLines
!verbose ${_TEXTFUNC_VERBOSE}
!define TEXTFUNC_VERBOSE `!insertmacro TEXTFUNC_VERBOSE`
!define _TEXTFUNC_UN
!define _TEXTFUNC_S
!verbose pop
!macro TEXTFUNC_VERBOSE _VERBOSE
@ -73,12 +75,12 @@ TrimNewLines
!verbose 3
!undef _TEXTFUNC_VERBOSE
!define _TEXTFUNC_VERBOSE ${_VERBOSE}
!verbose 4
!echo `"verbosity=${_VERBOSE}"`
!verbose pop
!macroend
# Install. Case insensitive. #
!macro LineFindCall _INPUT _OUTPUT _RANGE _FUNC
!verbose push
!verbose ${_TEXTFUNC_VERBOSE}
@ -432,8 +434,6 @@ TrimNewLines
Pop $0
FunctionEnd
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop
!endif
!macroend
@ -493,8 +493,6 @@ TrimNewLines
Exch $0
FunctionEnd
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop
!endif
!macroend
@ -560,8 +558,6 @@ TrimNewLines
Pop $0
FunctionEnd
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop
!endif
!macroend
@ -600,8 +596,6 @@ TrimNewLines
Exch $0
FunctionEnd
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop
!endif
!macroend
@ -680,19 +674,17 @@ TrimNewLines
Pop $0
FunctionEnd
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop
!endif
!macroend
!macro TextCompare
!ifndef ${_TEXTFUNC_UN}TextCompare
!ifndef ${_TEXTFUNC_UN}TextCompare${_TEXTFUNC_S}
!verbose push
!verbose ${_TEXTFUNC_VERBOSE}
!define ${_TEXTFUNC_UN}TextCompare `!insertmacro ${_TEXTFUNC_UN}TextCompareCall`
!define ${_TEXTFUNC_UN}TextCompare${_TEXTFUNC_S} `!insertmacro ${_TEXTFUNC_UN}TextCompare${_TEXTFUNC_S}Call`
Function ${_TEXTFUNC_UN}TextCompare
Function ${_TEXTFUNC_UN}TextCompare${_TEXTFUNC_S}
Exch $3
Exch
Exch $2
@ -729,31 +721,31 @@ TrimNewLines
StrCpy $8 0
nextline:
StrCmp $4 '' fast
StrCmp${_TEXTFUNC_S} $4 '' fast
IntOp $8 $8 + 1
FileRead $4 $9
IfErrors 0 +4
FileClose $4
StrCpy $4 ''
StrCmp $5 '' end
StrCmp${_TEXTFUNC_S} $5 '' end
StrCmp $2 'FastDiff' fast
StrCmp $2 'FastEqual' fast slow
fast:
StrCmp $5 '' call
StrCmp${_TEXTFUNC_S} $5 '' call
IntOp $6 $6 + 1
FileRead $5 $7
IfErrors 0 +5
FileClose $5
StrCpy $5 ''
StrCmp $4 '' end
StrCmp${_TEXTFUNC_S} $4 '' end
StrCmp $2 'FastDiff' call close
StrCmp $2 'FastDiff' 0 +2
StrCmp $7 $9 nextline call
StrCmp $7 $9 call nextline
StrCmp${_TEXTFUNC_S} $7 $9 nextline call
StrCmp${_TEXTFUNC_S} $7 $9 call nextline
slow:
StrCmp $4 '' close
StrCmp${_TEXTFUNC_S} $4 '' close
StrCpy $6 ''
DetailPrint '$8. $9'
FileSeek $5 0
@ -763,9 +755,9 @@ TrimNewLines
IfErrors 0 +2
StrCmp $2 'SlowDiff' call nextline
StrCmp $2 'SlowDiff' 0 +2
StrCmp $7 $9 nextline slownext
StrCmp${_TEXTFUNC_S} $7 $9 nextline slownext
IntOp $6 $6 + 1
StrCmp $7 $9 0 slownext
StrCmp${_TEXTFUNC_S} $7 $9 0 slownext
call:
Push $2
@ -810,19 +802,17 @@ TrimNewLines
Pop $0
FunctionEnd
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop
!endif
!macroend
!macro ConfigRead
!ifndef ${_TEXTFUNC_UN}ConfigRead
!ifndef ${_TEXTFUNC_UN}ConfigRead${_TEXTFUNC_S}
!verbose push
!verbose ${_TEXTFUNC_VERBOSE}
!define ${_TEXTFUNC_UN}ConfigRead `!insertmacro ${_TEXTFUNC_UN}ConfigReadCall`
!define ${_TEXTFUNC_UN}ConfigRead${_TEXTFUNC_S} `!insertmacro ${_TEXTFUNC_UN}ConfigRead${_TEXTFUNC_S}Call`
Function ${_TEXTFUNC_UN}ConfigRead
Function ${_TEXTFUNC_UN}ConfigRead${_TEXTFUNC_S}
Exch $1
Exch
Exch $0
@ -835,24 +825,22 @@ TrimNewLines
FileOpen $2 $0 r
IfErrors error
StrLen $0 $1
StrCmp $0 0 error
StrCmp${_TEXTFUNC_S} $0 0 error
readnext:
FileRead $2 $3
IfErrors empty
IfErrors error
StrCpy $4 $3 $0
StrCmp $4 $1 0 readnext
StrCmp${_TEXTFUNC_S} $4 $1 0 readnext
StrCpy $0 $3 '' $0
StrCpy $4 $0 1 -1
StrCmp $4 '$\r' +2
StrCmp $4 '$\n' 0 close
StrCmp${_TEXTFUNC_S} $4 '$\r' +2
StrCmp${_TEXTFUNC_S} $4 '$\n' 0 close
StrCpy $0 $0 -1
goto -4
error:
SetErrors
empty:
StrCpy $0 ''
close:
@ -865,19 +853,17 @@ TrimNewLines
Exch $0
FunctionEnd
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop
!endif
!macroend
!macro ConfigWrite
!ifndef ${_TEXTFUNC_UN}ConfigWrite
!ifndef ${_TEXTFUNC_UN}ConfigWrite${_TEXTFUNC_S}
!verbose push
!verbose ${_TEXTFUNC_VERBOSE}
!define ${_TEXTFUNC_UN}ConfigWrite `!insertmacro ${_TEXTFUNC_UN}ConfigWriteCall`
!define ${_TEXTFUNC_UN}ConfigWrite${_TEXTFUNC_S} `!insertmacro ${_TEXTFUNC_UN}ConfigWrite${_TEXTFUNC_S}Call`
Function ${_TEXTFUNC_UN}ConfigWrite
Function ${_TEXTFUNC_UN}ConfigWrite${_TEXTFUNC_S}
Exch $2
Exch
Exch $1
@ -896,7 +882,7 @@ TrimNewLines
IfErrors error
StrLen $0 $1
StrCmp $0 0 0 readnext
StrCmp${_TEXTFUNC_S} $0 0 0 readnext
StrCpy $0 ''
goto close
@ -904,20 +890,20 @@ TrimNewLines
FileRead $3 $4
IfErrors add
StrCpy $5 $4 $0
StrCmp $5 $1 0 readnext
StrCmp${_TEXTFUNC_S} $5 $1 0 readnext
StrCpy $5 0
IntOp $5 $5 - 1
StrCpy $6 $4 1 $5
StrCmp $6 '$\r' -2
StrCmp $6 '$\n' -3
StrCmp${_TEXTFUNC_S} $6 '$\r' -2
StrCmp${_TEXTFUNC_S} $6 '$\n' -3
StrCpy $6 $4
StrCmp $5 -1 +3
StrCmp${_TEXTFUNC_S} $5 -1 +3
IntOp $5 $5 + 1
StrCpy $6 $4 $5
StrCmp $2 '' change
StrCmp $6 '$1$2' 0 change
StrCmp${_TEXTFUNC_S} $2 '' change
StrCmp${_TEXTFUNC_S} $6 '$1$2' 0 change
StrCpy $0 SAME
goto close
@ -933,26 +919,26 @@ TrimNewLines
FileSeek $3 $5 SET
System::Call 'kernel32::ReadFile(i r3, i r0, i $6, t.,)'
FileSeek $3 $4 SET
StrCmp $2 '' +2
StrCmp${_TEXTFUNC_S} $2 '' +2
FileWrite $3 '$1$2$\r$\n'
System::Call 'kernel32::WriteFile(i r3, i r0, i $6, t.,)'
System::Call 'kernel32::SetEndOfFile(i r3)'
System::Free $0
StrCmp $2 '' +3
StrCmp${_TEXTFUNC_S} $2 '' +3
StrCpy $0 CHANGED
goto close
StrCpy $0 DELETED
goto close
add:
StrCmp $2 '' 0 +3
StrCmp${_TEXTFUNC_S} $2 '' 0 +3
StrCpy $0 SAME
goto close
FileSeek $3 -1 END
FileRead $3 $4
IfErrors +4
StrCmp $4 '$\r' +3
StrCmp $4 '$\n' +2
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
@ -975,8 +961,6 @@ TrimNewLines
Exch $0
FunctionEnd
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop
!endif
!macroend
@ -1026,8 +1010,6 @@ TrimNewLines
Pop $0
FunctionEnd
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop
!endif
!macroend
@ -1057,12 +1039,13 @@ TrimNewLines
Exch $0
FunctionEnd
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop
!endif
!macroend
# Uninstall. Case insensitive. #
!macro un.LineFindCall _INPUT _OUTPUT _RANGE _FUNC
!verbose push
!verbose ${_TEXTFUNC_VERBOSE}
@ -1180,6 +1163,8 @@ TrimNewLines
!insertmacro LineFind
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop
!endif
!macroend
@ -1193,6 +1178,8 @@ TrimNewLines
!insertmacro LineRead
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop
!endif
!macroend
@ -1206,6 +1193,8 @@ TrimNewLines
!insertmacro FileReadFromEnd
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop
!endif
!macroend
@ -1219,6 +1208,8 @@ TrimNewLines
!insertmacro LineSum
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop
!endif
!macroend
@ -1232,6 +1223,8 @@ TrimNewLines
!insertmacro FileJoin
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop
!endif
!macroend
@ -1245,6 +1238,8 @@ TrimNewLines
!insertmacro TextCompare
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop
!endif
!macroend
@ -1258,6 +1253,8 @@ TrimNewLines
!insertmacro ConfigRead
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop
!endif
!macroend
@ -1271,6 +1268,8 @@ TrimNewLines
!insertmacro ConfigWrite
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop
!endif
!macroend
@ -1284,6 +1283,8 @@ TrimNewLines
!insertmacro FileRecode
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop
!endif
!macroend
@ -1297,6 +1298,186 @@ TrimNewLines
!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}
Push $0
Push `${_FILE1}`
Push `${_FILE2}`
Push `${_OPTION}`
GetFunctionAddress $0 `${_FUNC}`
Push `$0`
Call TextCompareS
Pop $0
!verbose pop
!macroend
!macro ConfigReadSCall _FILE _ENTRY _RESULT
!verbose push
!verbose ${_TEXTFUNC_VERBOSE}
Push `${_FILE}`
Push `${_ENTRY}`
Call ConfigReadS
Pop ${_RESULT}
!verbose pop
!macroend
!macro ConfigWriteSCall _FILE _ENTRY _VALUE _RESULT
!verbose push
!verbose ${_TEXTFUNC_VERBOSE}
Push `${_FILE}`
Push `${_ENTRY}`
Push `${_VALUE}`
Call ConfigWriteS
Pop ${_RESULT}
!verbose pop
!macroend
!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`
!insertmacro TextCompare
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!undef _TEXTFUNC_S
!define _TEXTFUNC_S
!verbose pop
!endif
!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`
!insertmacro ConfigRead
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!undef _TEXTFUNC_S
!define _TEXTFUNC_S
!verbose pop
!endif
!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`
!insertmacro ConfigWrite
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!undef _TEXTFUNC_S
!define _TEXTFUNC_S
!verbose pop
!endif
!macroend

File diff suppressed because it is too large Load diff