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

View file

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

View file

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

View file

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

View file

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

View file

@ -3,7 +3,7 @@
; Word Functions Test ; Word Functions Test
;_____________________________________________________________________________ ;_____________________________________________________________________________
; ;
; 2005 Shengalts Aleksander aka Instructor (Shengalts@mail.ru) ; 2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
Name "Word Functions Test" Name "Word Functions Test"
OutFile "WordFuncTest.exe" OutFile "WordFuncTest.exe"
@ -17,22 +17,36 @@ Var OUT
!include "WordFunc.nsh" !include "WordFunc.nsh"
!insertmacro WordFind !insertmacro WordFind
!insertmacro WordFindS
!insertmacro WordFind2X !insertmacro WordFind2X
!insertmacro WordFind2XS
!insertmacro WordFind3X !insertmacro WordFind3X
!insertmacro WordFind3XS
!insertmacro WordReplace !insertmacro WordReplace
!insertmacro WordReplaceS
!insertmacro WordAdd !insertmacro WordAdd
!insertmacro WordAddS
!insertmacro WordInsert !insertmacro WordInsert
!insertmacro WordInsertS
!insertmacro StrFilter !insertmacro StrFilter
!insertmacro StrFilterS
!insertmacro VersionCompare !insertmacro VersionCompare
!insertmacro VersionConvert !insertmacro VersionConvert
!insertmacro un.WordFind !insertmacro un.WordFind
!insertmacro un.WordFindS
!insertmacro un.WordFind2X !insertmacro un.WordFind2X
!insertmacro un.WordFind2XS
!insertmacro un.WordFind3X !insertmacro un.WordFind3X
!insertmacro un.WordFind3XS
!insertmacro un.WordReplace !insertmacro un.WordReplace
!insertmacro un.WordReplaceS
!insertmacro un.WordAdd !insertmacro un.WordAdd
!insertmacro un.WordAddS
!insertmacro un.WordInsert !insertmacro un.WordInsert
!insertmacro un.WordInsertS
!insertmacro un.StrFilter !insertmacro un.StrFilter
!insertmacro un.StrFilterS
!insertmacro un.VersionCompare !insertmacro un.VersionCompare
!insertmacro un.VersionConvert !insertmacro un.VersionConvert
@ -175,6 +189,23 @@ Section WordFind
SectionEnd 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 Section WordFind2X
${StackVerificationStart} WordFind2X ${StackVerificationStart} WordFind2X
@ -219,6 +250,23 @@ Section WordFind2X
SectionEnd 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 Section WordFind3X
${StackVerificationStart} WordFind3X ${StackVerificationStart} WordFind3X
@ -260,6 +308,23 @@ Section WordFind3X
SectionEnd 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 Section WordReplace
${StackVerificationStart} WordReplace ${StackVerificationStart} WordReplace
@ -301,6 +366,23 @@ Section WordReplace
SectionEnd 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 Section WordAdd
${StackVerificationStart} WordAdd ${StackVerificationStart} WordAdd
@ -339,6 +421,23 @@ Section WordAdd
SectionEnd 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 Section WordInsert
${StackVerificationStart} WordInsert ${StackVerificationStart} WordInsert
@ -371,6 +470,23 @@ Section WordInsert
SectionEnd 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 Section StrFilter
${StackVerificationStart} StrFilter ${StackVerificationStart} StrFilter
@ -409,6 +525,21 @@ Section StrFilter
SectionEnd 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 Section VersionCompare
${StackVerificationStart} VersionCompare ${StackVerificationStart} VersionCompare
@ -478,12 +609,19 @@ SectionEnd
Section un.Uninstall Section un.Uninstall
${un.WordFind} 'C:\io.sys C:\Program Files C:\WINDOWS' ' C:\' '-02' $OUT ${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.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.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.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.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.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.StrFilter} '123abc 456DEF 7890|%#' '+' '' '' $OUT
${un.StrFilterS} '123abc 456DEF 7890|%#' '+' '' '' $OUT
${un.VersionCompare} '1.1.1.9' '1.1.1.01' $OUT ${un.VersionCompare} '1.1.1.9' '1.1.1.01' $OUT
${un.VersionConvert} '9.0a' '' $OUT ${un.VersionConvert} '9.0a' '' $OUT
SectionEnd 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. See documentation for more information about the following functions.
@ -18,14 +18,14 @@ _____________________________________________________________________________
FileFunction=[Locate|GetSize|DriveSpace|GetDrives|GetTime|GetFileAttributes| FileFunction=[Locate|GetSize|DriveSpace|GetDrives|GetTime|GetFileAttributes|
GetFileVersion|GetExeName|GetExePath|GetParameters|GetOptions| GetFileVersion|GetExeName|GetExePath|GetParameters|GetOptions|
GetRoot|GetParent|GetFileName|GetBaseName|GetFileExt| GetOptionsS|GetRoot|GetParent|GetFileName|GetBaseName|GetFileExt|
BannerTrimPath|DirState|RefreshShellIcons] BannerTrimPath|DirState|RefreshShellIcons]
un.FileFunction=[un.Locate|un.GetSize|un.DriveSpace|un.GetDrives|un.GetTime| un.FileFunction=[un.Locate|un.GetSize|un.DriveSpace|un.GetDrives|un.GetTime|
un.GetFileAttributes|un.GetFileVersion|un.GetExeName| un.GetFileAttributes|un.GetFileVersion|un.GetExeName|
un.GetExePath|un.GetParameters|un.GetOptions|un.GetRoot| un.GetExePath|un.GetParameters|un.GetOptions|un.GetOptionsS|
un.GetParent|un.GetFileName|un.GetBaseName|un.GetFileExt| un.GetRoot|un.GetParent|un.GetFileName|un.GetBaseName|
un.BannerTrimPath|un.DirState|un.RefreshShellIcons] un.GetFileExt|un.BannerTrimPath|un.DirState|un.RefreshShellIcons]
_____________________________________________________________________________ _____________________________________________________________________________
@ -61,7 +61,7 @@ RefreshShellIcons
;_____________________________________________________________________________ ;_____________________________________________________________________________
; ;
; Macros ; Macros
;_____________________________________________________________________________ ;_____________________________________________________________________________
; ;
; Change log window verbosity (default: 3=no script) ; Change log window verbosity (default: 3=no script)
@ -70,7 +70,7 @@ RefreshShellIcons
; !include "FileFunc.nsh" ; !include "FileFunc.nsh"
; !insertmacro Locate ; !insertmacro Locate
; ${FILEFUNC_VERBOSE} 4 # all verbosity ; ${FILEFUNC_VERBOSE} 4 # all verbosity
; !insertmacro GetTime ; !insertmacro VersionCompare
; ${FILEFUNC_VERBOSE} 3 # no script ; ${FILEFUNC_VERBOSE} 3 # no script
!verbose push !verbose push
@ -81,6 +81,7 @@ RefreshShellIcons
!verbose ${_FILEFUNC_VERBOSE} !verbose ${_FILEFUNC_VERBOSE}
!define FILEFUNC_VERBOSE `!insertmacro FILEFUNC_VERBOSE` !define FILEFUNC_VERBOSE `!insertmacro FILEFUNC_VERBOSE`
!define _FILEFUNC_UN !define _FILEFUNC_UN
!define _FILEFUNC_S
!verbose pop !verbose pop
!macro FILEFUNC_VERBOSE _VERBOSE !macro FILEFUNC_VERBOSE _VERBOSE
@ -88,12 +89,12 @@ RefreshShellIcons
!verbose 3 !verbose 3
!undef _FILEFUNC_VERBOSE !undef _FILEFUNC_VERBOSE
!define _FILEFUNC_VERBOSE ${_VERBOSE} !define _FILEFUNC_VERBOSE ${_VERBOSE}
!verbose 4
!echo `"verbosity=${_VERBOSE}"`
!verbose pop !verbose pop
!macroend !macroend
# Install. Case insensitive. #
!macro LocateCall _PATH _OPTIONS _FUNC !macro LocateCall _PATH _OPTIONS _FUNC
!verbose push !verbose push
!verbose ${_FILEFUNC_VERBOSE} !verbose ${_FILEFUNC_VERBOSE}
@ -563,8 +564,6 @@ RefreshShellIcons
Pop $0 Pop $0
FunctionEnd FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -796,8 +795,6 @@ RefreshShellIcons
Exch $0 Exch $0
FunctionEnd FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -913,8 +910,6 @@ RefreshShellIcons
Exch $0 Exch $0
FunctionEnd FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -1041,8 +1036,6 @@ RefreshShellIcons
Pop $0 Pop $0
FunctionEnd FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -1178,8 +1171,6 @@ RefreshShellIcons
Exch $0 Exch $0
FunctionEnd FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -1327,8 +1318,6 @@ RefreshShellIcons
Exch $0 Exch $0
FunctionEnd FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -1372,8 +1361,6 @@ RefreshShellIcons
Exch $0 Exch $0
FunctionEnd FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -1397,8 +1384,6 @@ RefreshShellIcons
Exch $0 Exch $0
FunctionEnd FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -1422,8 +1407,6 @@ RefreshShellIcons
Exch $0 Exch $0
FunctionEnd FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -1467,19 +1450,17 @@ RefreshShellIcons
Exch $0 Exch $0
FunctionEnd FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
!macro GetOptions !macro GetOptions
!ifndef ${_FILEFUNC_UN}GetOptions !ifndef ${_FILEFUNC_UN}GetOptions${_FILEFUNC_S}
!verbose push !verbose push
!verbose ${_FILEFUNC_VERBOSE} !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 $1
Exch Exch
Exch $0 Exch $0
@ -1490,6 +1471,7 @@ RefreshShellIcons
Push $5 Push $5
Push $6 Push $6
Push $7 Push $7
ClearErrors
StrCpy $2 $1 '' 1 StrCpy $2 $1 '' 1
StrCpy $1 $1 1 StrCpy $1 $1 1
@ -1503,44 +1485,44 @@ RefreshShellIcons
quote: quote:
IntOp $4 $4 + 1 IntOp $4 $4 + 1
StrCpy $5 $0 1 $4 StrCpy $5 $0 1 $4
StrCmp $5$7 '0' notfound StrCmp${_FILEFUNC_S} $5$7 '0' notfound
StrCmp $5 '' trimright StrCmp${_FILEFUNC_S} $5 '' trimright
StrCmp $5 '"' 0 +7 StrCmp${_FILEFUNC_S} $5 '"' 0 +7
StrCmp $6 '' 0 +3 StrCmp${_FILEFUNC_S} $6 '' 0 +3
StrCpy $6 '"' StrCpy $6 '"'
goto quote goto quote
StrCmp $6 '"' 0 +3 StrCmp${_FILEFUNC_S} $6 '"' 0 +3
StrCpy $6 '' StrCpy $6 ''
goto quote goto quote
StrCmp $5 `'` 0 +7 StrCmp${_FILEFUNC_S} $5 `'` 0 +7
StrCmp $6 `` 0 +3 StrCmp${_FILEFUNC_S} $6 `` 0 +3
StrCpy $6 `'` StrCpy $6 `'`
goto quote goto quote
StrCmp $6 `'` 0 +3 StrCmp${_FILEFUNC_S} $6 `'` 0 +3
StrCpy $6 `` StrCpy $6 ``
goto quote goto quote
StrCmp $5 '`' 0 +7 StrCmp${_FILEFUNC_S} $5 '`' 0 +7
StrCmp $6 '' 0 +3 StrCmp${_FILEFUNC_S} $6 '' 0 +3
StrCpy $6 '`' StrCpy $6 '`'
goto quote goto quote
StrCmp $6 '`' 0 +3 StrCmp${_FILEFUNC_S} $6 '`' 0 +3
StrCpy $6 '' StrCpy $6 ''
goto quote goto quote
StrCmp $6 '"' quote StrCmp${_FILEFUNC_S} $6 '"' quote
StrCmp $6 `'` quote StrCmp${_FILEFUNC_S} $6 `'` quote
StrCmp $6 '`' quote StrCmp${_FILEFUNC_S} $6 '`' quote
StrCmp $5 $1 0 quote StrCmp${_FILEFUNC_S} $5 $1 0 quote
StrCmp $7 0 trimleft trimright StrCmp${_FILEFUNC_S} $7 0 trimleft trimright
trimleft: trimleft:
IntOp $4 $4 + 1 IntOp $4 $4 + 1
StrCpy $5 $0 $3 $4 StrCpy $5 $0 $3 $4
StrCmp $5 '' notfound StrCmp${_FILEFUNC_S} $5 '' notfound
StrCmp $5 $2 0 quote StrCmp${_FILEFUNC_S} $5 $2 0 quote
IntOp $4 $4 + $3 IntOp $4 $4 + $3
StrCpy $0 $0 '' $4 StrCpy $0 $0 '' $4
StrCpy $4 $0 1 StrCpy $4 $0 1
StrCmp $4 ' ' 0 +3 StrCmp${_FILEFUNC_S} $4 ' ' 0 +3
StrCpy $0 $0 '' 1 StrCpy $0 $0 '' 1
goto -3 goto -3
StrCpy $7 1 StrCpy $7 1
@ -1549,19 +1531,20 @@ RefreshShellIcons
trimright: trimright:
StrCpy $0 $0 $4 StrCpy $0 $0 $4
StrCpy $4 $0 1 -1 StrCpy $4 $0 1 -1
StrCmp $4 ' ' 0 +3 StrCmp${_FILEFUNC_S} $4 ' ' 0 +3
StrCpy $0 $0 -1 StrCpy $0 $0 -1
goto -3 goto -3
StrCpy $3 $0 1 StrCpy $3 $0 1
StrCpy $4 $0 1 -1 StrCpy $4 $0 1 -1
StrCmp $3 $4 0 end StrCmp${_FILEFUNC_S} $3 $4 0 end
StrCmp $3 '"' +3 StrCmp${_FILEFUNC_S} $3 '"' +3
StrCmp $3 `'` +2 StrCmp${_FILEFUNC_S} $3 `'` +2
StrCmp $3 '`' 0 end StrCmp${_FILEFUNC_S} $3 '`' 0 end
StrCpy $0 $0 -1 1 StrCpy $0 $0 -1 1
goto end goto end
notfound: notfound:
SetErrors
StrCpy $0 '' StrCpy $0 ''
end: end:
@ -1575,8 +1558,6 @@ RefreshShellIcons
Exch $0 Exch $0
FunctionEnd FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -1628,8 +1609,6 @@ RefreshShellIcons
Exch $0 Exch $0
FunctionEnd FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -1662,8 +1641,6 @@ RefreshShellIcons
Exch $0 Exch $0
FunctionEnd FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -1698,8 +1675,6 @@ RefreshShellIcons
Exch $0 Exch $0
FunctionEnd FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -1747,8 +1722,6 @@ RefreshShellIcons
Exch $0 Exch $0
FunctionEnd FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -1787,8 +1760,6 @@ RefreshShellIcons
Exch $0 Exch $0
FunctionEnd FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -1882,8 +1853,6 @@ RefreshShellIcons
Exch $0 Exch $0
FunctionEnd FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -1918,8 +1887,6 @@ RefreshShellIcons
Exch $0 Exch $0
FunctionEnd FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -1934,12 +1901,13 @@ RefreshShellIcons
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)' System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
FunctionEnd FunctionEnd
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
# Uninstall. Case insensitive. #
!macro un.LocateCall _PATH _OPTIONS _FUNC !macro un.LocateCall _PATH _OPTIONS _FUNC
!verbose push !verbose push
!verbose ${_FILEFUNC_VERBOSE} !verbose ${_FILEFUNC_VERBOSE}
@ -2136,6 +2104,8 @@ RefreshShellIcons
!insertmacro Locate !insertmacro Locate
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -2149,6 +2119,8 @@ RefreshShellIcons
!insertmacro GetSize !insertmacro GetSize
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -2162,6 +2134,8 @@ RefreshShellIcons
!insertmacro DriveSpace !insertmacro DriveSpace
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -2175,6 +2149,8 @@ RefreshShellIcons
!insertmacro GetDrives !insertmacro GetDrives
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -2188,6 +2164,8 @@ RefreshShellIcons
!insertmacro GetTime !insertmacro GetTime
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -2201,6 +2179,8 @@ RefreshShellIcons
!insertmacro GetFileAttributes !insertmacro GetFileAttributes
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -2214,6 +2194,8 @@ RefreshShellIcons
!insertmacro GetFileVersion !insertmacro GetFileVersion
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -2227,6 +2209,8 @@ RefreshShellIcons
!insertmacro GetExeName !insertmacro GetExeName
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -2240,6 +2224,8 @@ RefreshShellIcons
!insertmacro GetExePath !insertmacro GetExePath
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -2253,6 +2239,8 @@ RefreshShellIcons
!insertmacro GetParameters !insertmacro GetParameters
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -2266,6 +2254,8 @@ RefreshShellIcons
!insertmacro GetOptions !insertmacro GetOptions
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -2279,6 +2269,8 @@ RefreshShellIcons
!insertmacro GetRoot !insertmacro GetRoot
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -2292,6 +2284,8 @@ RefreshShellIcons
!insertmacro GetParent !insertmacro GetParent
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -2305,6 +2299,8 @@ RefreshShellIcons
!insertmacro GetFileName !insertmacro GetFileName
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -2318,6 +2314,8 @@ RefreshShellIcons
!insertmacro GetBaseName !insertmacro GetBaseName
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -2331,6 +2329,8 @@ RefreshShellIcons
!insertmacro GetFileExt !insertmacro GetFileExt
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -2344,6 +2344,8 @@ RefreshShellIcons
!insertmacro BannerTrimPath !insertmacro BannerTrimPath
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -2357,6 +2359,8 @@ RefreshShellIcons
!insertmacro DirState !insertmacro DirState
!undef _FILEFUNC_UN
!define _FILEFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -2370,6 +2374,68 @@ RefreshShellIcons
!insertmacro 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 !verbose pop
!endif !endif
!macroend !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. See documentation for more information about the following functions.
@ -17,12 +17,13 @@ _____________________________________________________________________________
TextFunction=[LineFind|LineRead|FileReadFromEnd|LineSum|FileJoin| 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.TextFunction=[un.LineFind|un.LineRead|un.FileReadFromEnd|un.LineSum|
un.FileJoin|un.TextCompare|un.ConfigRead|un.ConfigWrite| un.FileJoin|un.TextCompare|un.TextCompareS|un.ConfigRead|
un.FileRecode|un.TrimNewLines] un.ConfigReadS|un.ConfigWrite|un.ConfigWriteS|un.FileRecode|
un.TrimNewLines]
_____________________________________________________________________________ _____________________________________________________________________________
@ -66,6 +67,7 @@ TrimNewLines
!verbose ${_TEXTFUNC_VERBOSE} !verbose ${_TEXTFUNC_VERBOSE}
!define TEXTFUNC_VERBOSE `!insertmacro TEXTFUNC_VERBOSE` !define TEXTFUNC_VERBOSE `!insertmacro TEXTFUNC_VERBOSE`
!define _TEXTFUNC_UN !define _TEXTFUNC_UN
!define _TEXTFUNC_S
!verbose pop !verbose pop
!macro TEXTFUNC_VERBOSE _VERBOSE !macro TEXTFUNC_VERBOSE _VERBOSE
@ -73,12 +75,12 @@ TrimNewLines
!verbose 3 !verbose 3
!undef _TEXTFUNC_VERBOSE !undef _TEXTFUNC_VERBOSE
!define _TEXTFUNC_VERBOSE ${_VERBOSE} !define _TEXTFUNC_VERBOSE ${_VERBOSE}
!verbose 4
!echo `"verbosity=${_VERBOSE}"`
!verbose pop !verbose pop
!macroend !macroend
# Install. Case insensitive. #
!macro LineFindCall _INPUT _OUTPUT _RANGE _FUNC !macro LineFindCall _INPUT _OUTPUT _RANGE _FUNC
!verbose push !verbose push
!verbose ${_TEXTFUNC_VERBOSE} !verbose ${_TEXTFUNC_VERBOSE}
@ -432,8 +434,6 @@ TrimNewLines
Pop $0 Pop $0
FunctionEnd FunctionEnd
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -493,8 +493,6 @@ TrimNewLines
Exch $0 Exch $0
FunctionEnd FunctionEnd
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -560,8 +558,6 @@ TrimNewLines
Pop $0 Pop $0
FunctionEnd FunctionEnd
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -600,8 +596,6 @@ TrimNewLines
Exch $0 Exch $0
FunctionEnd FunctionEnd
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -680,19 +674,17 @@ TrimNewLines
Pop $0 Pop $0
FunctionEnd FunctionEnd
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
!macro TextCompare !macro TextCompare
!ifndef ${_TEXTFUNC_UN}TextCompare !ifndef ${_TEXTFUNC_UN}TextCompare${_TEXTFUNC_S}
!verbose push !verbose push
!verbose ${_TEXTFUNC_VERBOSE} !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 $3
Exch Exch
Exch $2 Exch $2
@ -729,31 +721,31 @@ TrimNewLines
StrCpy $8 0 StrCpy $8 0
nextline: nextline:
StrCmp $4 '' fast StrCmp${_TEXTFUNC_S} $4 '' fast
IntOp $8 $8 + 1 IntOp $8 $8 + 1
FileRead $4 $9 FileRead $4 $9
IfErrors 0 +4 IfErrors 0 +4
FileClose $4 FileClose $4
StrCpy $4 '' StrCpy $4 ''
StrCmp $5 '' end StrCmp${_TEXTFUNC_S} $5 '' end
StrCmp $2 'FastDiff' fast StrCmp $2 'FastDiff' fast
StrCmp $2 'FastEqual' fast slow StrCmp $2 'FastEqual' fast slow
fast: fast:
StrCmp $5 '' call StrCmp${_TEXTFUNC_S} $5 '' call
IntOp $6 $6 + 1 IntOp $6 $6 + 1
FileRead $5 $7 FileRead $5 $7
IfErrors 0 +5 IfErrors 0 +5
FileClose $5 FileClose $5
StrCpy $5 '' StrCpy $5 ''
StrCmp $4 '' end StrCmp${_TEXTFUNC_S} $4 '' end
StrCmp $2 'FastDiff' call close StrCmp $2 'FastDiff' call close
StrCmp $2 'FastDiff' 0 +2 StrCmp $2 'FastDiff' 0 +2
StrCmp $7 $9 nextline call StrCmp${_TEXTFUNC_S} $7 $9 nextline call
StrCmp $7 $9 call nextline StrCmp${_TEXTFUNC_S} $7 $9 call nextline
slow: slow:
StrCmp $4 '' close StrCmp${_TEXTFUNC_S} $4 '' close
StrCpy $6 '' StrCpy $6 ''
DetailPrint '$8. $9' DetailPrint '$8. $9'
FileSeek $5 0 FileSeek $5 0
@ -763,9 +755,9 @@ TrimNewLines
IfErrors 0 +2 IfErrors 0 +2
StrCmp $2 'SlowDiff' call nextline StrCmp $2 'SlowDiff' call nextline
StrCmp $2 'SlowDiff' 0 +2 StrCmp $2 'SlowDiff' 0 +2
StrCmp $7 $9 nextline slownext StrCmp${_TEXTFUNC_S} $7 $9 nextline slownext
IntOp $6 $6 + 1 IntOp $6 $6 + 1
StrCmp $7 $9 0 slownext StrCmp${_TEXTFUNC_S} $7 $9 0 slownext
call: call:
Push $2 Push $2
@ -810,19 +802,17 @@ TrimNewLines
Pop $0 Pop $0
FunctionEnd FunctionEnd
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
!macro ConfigRead !macro ConfigRead
!ifndef ${_TEXTFUNC_UN}ConfigRead !ifndef ${_TEXTFUNC_UN}ConfigRead${_TEXTFUNC_S}
!verbose push !verbose push
!verbose ${_TEXTFUNC_VERBOSE} !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 $1
Exch Exch
Exch $0 Exch $0
@ -835,24 +825,22 @@ TrimNewLines
FileOpen $2 $0 r FileOpen $2 $0 r
IfErrors error IfErrors error
StrLen $0 $1 StrLen $0 $1
StrCmp $0 0 error StrCmp${_TEXTFUNC_S} $0 0 error
readnext: readnext:
FileRead $2 $3 FileRead $2 $3
IfErrors empty IfErrors error
StrCpy $4 $3 $0 StrCpy $4 $3 $0
StrCmp $4 $1 0 readnext StrCmp${_TEXTFUNC_S} $4 $1 0 readnext
StrCpy $0 $3 '' $0 StrCpy $0 $3 '' $0
StrCpy $4 $0 1 -1 StrCpy $4 $0 1 -1
StrCmp $4 '$\r' +2 StrCmp${_TEXTFUNC_S} $4 '$\r' +2
StrCmp $4 '$\n' 0 close StrCmp${_TEXTFUNC_S} $4 '$\n' 0 close
StrCpy $0 $0 -1 StrCpy $0 $0 -1
goto -4 goto -4
error: error:
SetErrors SetErrors
empty:
StrCpy $0 '' StrCpy $0 ''
close: close:
@ -865,19 +853,17 @@ TrimNewLines
Exch $0 Exch $0
FunctionEnd FunctionEnd
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
!macro ConfigWrite !macro ConfigWrite
!ifndef ${_TEXTFUNC_UN}ConfigWrite !ifndef ${_TEXTFUNC_UN}ConfigWrite${_TEXTFUNC_S}
!verbose push !verbose push
!verbose ${_TEXTFUNC_VERBOSE} !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 $2
Exch Exch
Exch $1 Exch $1
@ -896,7 +882,7 @@ TrimNewLines
IfErrors error IfErrors error
StrLen $0 $1 StrLen $0 $1
StrCmp $0 0 0 readnext StrCmp${_TEXTFUNC_S} $0 0 0 readnext
StrCpy $0 '' StrCpy $0 ''
goto close goto close
@ -904,20 +890,20 @@ TrimNewLines
FileRead $3 $4 FileRead $3 $4
IfErrors add IfErrors add
StrCpy $5 $4 $0 StrCpy $5 $4 $0
StrCmp $5 $1 0 readnext StrCmp${_TEXTFUNC_S} $5 $1 0 readnext
StrCpy $5 0 StrCpy $5 0
IntOp $5 $5 - 1 IntOp $5 $5 - 1
StrCpy $6 $4 1 $5 StrCpy $6 $4 1 $5
StrCmp $6 '$\r' -2 StrCmp${_TEXTFUNC_S} $6 '$\r' -2
StrCmp $6 '$\n' -3 StrCmp${_TEXTFUNC_S} $6 '$\n' -3
StrCpy $6 $4 StrCpy $6 $4
StrCmp $5 -1 +3 StrCmp${_TEXTFUNC_S} $5 -1 +3
IntOp $5 $5 + 1 IntOp $5 $5 + 1
StrCpy $6 $4 $5 StrCpy $6 $4 $5
StrCmp $2 '' change StrCmp${_TEXTFUNC_S} $2 '' change
StrCmp $6 '$1$2' 0 change StrCmp${_TEXTFUNC_S} $6 '$1$2' 0 change
StrCpy $0 SAME StrCpy $0 SAME
goto close goto close
@ -933,26 +919,26 @@ TrimNewLines
FileSeek $3 $5 SET FileSeek $3 $5 SET
System::Call 'kernel32::ReadFile(i r3, i r0, i $6, t.,)' System::Call 'kernel32::ReadFile(i r3, i r0, i $6, t.,)'
FileSeek $3 $4 SET FileSeek $3 $4 SET
StrCmp $2 '' +2 StrCmp${_TEXTFUNC_S} $2 '' +2
FileWrite $3 '$1$2$\r$\n' FileWrite $3 '$1$2$\r$\n'
System::Call 'kernel32::WriteFile(i r3, i r0, i $6, t.,)' System::Call 'kernel32::WriteFile(i r3, i r0, i $6, t.,)'
System::Call 'kernel32::SetEndOfFile(i r3)' System::Call 'kernel32::SetEndOfFile(i r3)'
System::Free $0 System::Free $0
StrCmp $2 '' +3 StrCmp${_TEXTFUNC_S} $2 '' +3
StrCpy $0 CHANGED StrCpy $0 CHANGED
goto close goto close
StrCpy $0 DELETED StrCpy $0 DELETED
goto close goto close
add: add:
StrCmp $2 '' 0 +3 StrCmp${_TEXTFUNC_S} $2 '' 0 +3
StrCpy $0 SAME StrCpy $0 SAME
goto close goto close
FileSeek $3 -1 END FileSeek $3 -1 END
FileRead $3 $4 FileRead $3 $4
IfErrors +4 IfErrors +4
StrCmp $4 '$\r' +3 StrCmp${_TEXTFUNC_S} $4 '$\r' +3
StrCmp $4 '$\n' +2 StrCmp${_TEXTFUNC_S} $4 '$\n' +2
FileWrite $3 '$\r$\n' FileWrite $3 '$\r$\n'
FileWrite $3 '$1$2$\r$\n' FileWrite $3 '$1$2$\r$\n'
StrCpy $0 ADDED StrCpy $0 ADDED
@ -975,8 +961,6 @@ TrimNewLines
Exch $0 Exch $0
FunctionEnd FunctionEnd
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -1026,8 +1010,6 @@ TrimNewLines
Pop $0 Pop $0
FunctionEnd FunctionEnd
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -1057,12 +1039,13 @@ TrimNewLines
Exch $0 Exch $0
FunctionEnd FunctionEnd
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
# Uninstall. Case insensitive. #
!macro un.LineFindCall _INPUT _OUTPUT _RANGE _FUNC !macro un.LineFindCall _INPUT _OUTPUT _RANGE _FUNC
!verbose push !verbose push
!verbose ${_TEXTFUNC_VERBOSE} !verbose ${_TEXTFUNC_VERBOSE}
@ -1180,6 +1163,8 @@ TrimNewLines
!insertmacro LineFind !insertmacro LineFind
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -1193,6 +1178,8 @@ TrimNewLines
!insertmacro LineRead !insertmacro LineRead
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -1206,6 +1193,8 @@ TrimNewLines
!insertmacro FileReadFromEnd !insertmacro FileReadFromEnd
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -1219,6 +1208,8 @@ TrimNewLines
!insertmacro LineSum !insertmacro LineSum
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -1232,6 +1223,8 @@ TrimNewLines
!insertmacro FileJoin !insertmacro FileJoin
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -1245,6 +1238,8 @@ TrimNewLines
!insertmacro TextCompare !insertmacro TextCompare
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -1258,6 +1253,8 @@ TrimNewLines
!insertmacro ConfigRead !insertmacro ConfigRead
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -1271,6 +1268,8 @@ TrimNewLines
!insertmacro ConfigWrite !insertmacro ConfigWrite
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -1284,6 +1283,8 @@ TrimNewLines
!insertmacro FileRecode !insertmacro FileRecode
!undef _TEXTFUNC_UN
!define _TEXTFUNC_UN
!verbose pop !verbose pop
!endif !endif
!macroend !macroend
@ -1297,6 +1298,186 @@ TrimNewLines
!insertmacro 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 !verbose pop
!endif !endif
!macroend !macroend

File diff suppressed because it is too large Load diff