1.03
- Added commands support for uninstall sections and functions - Fixed variables switch in "StrLoc" and "StrTok" after using these git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3493 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
92ebf81a32
commit
7b77fdcba5
2 changed files with 1011 additions and 756 deletions
|
@ -13,7 +13,7 @@ by Diego Pedroso (aka deguix)
|
|||
!define MUI_VERBOSE 3
|
||||
!endif
|
||||
|
||||
!echo "$\r$\n----------------------------------------------------------------------$\r$\nNSIS String Functions Header File 1.02 - © 2004 Diego Pedroso$\r$\n----------------------------------------------------------------------$\r$\n$\r$\n"
|
||||
!echo "$\r$\n----------------------------------------------------------------------$\r$\nNSIS String Functions Header File 1.03 - © 2004 Diego Pedroso$\r$\n----------------------------------------------------------------------$\r$\n$\r$\n"
|
||||
|
||||
!define StrClbGet "!insertmacro FUNCTION_STRING_StrClbGet"
|
||||
!define StrClbSet "!insertmacro FUNCTION_STRING_StrClbSet"
|
||||
|
@ -29,17 +29,22 @@ by Diego Pedroso (aka deguix)
|
|||
!define StrTrimNewLines "!insertmacro FUNCTION_STRING_StrTrimNewLines"
|
||||
!define StrUpperCase "!insertmacro FUNCTION_STRING_StrUpperCase"
|
||||
|
||||
!macro FUNCTION_STRING_StrStr
|
||||
!define UnStrFunc "!insertmacro FUNCTION_STRING_UninstSupport"
|
||||
|
||||
!ifndef FUNCTION_STRING_StrStr
|
||||
!macro FUNCTION_STRING_StrStr
|
||||
|
||||
!echo "$\r$\n----------------------------------------------------------------------$\r$\nSearch in String Function - 2002-2004 Ximon Eighteen\r$\n----------------------------------------------------------------------$\r$\n$\r$\n"
|
||||
|
||||
!define FUNCTION_STRING_StrStr
|
||||
!ifdef FUNCTION_STRING_UninstSupport
|
||||
!undef UnStrStr
|
||||
!define UnStrStr "!insertmacro FUNCTION_STRING_UnStrStr_Call"
|
||||
Function un.StrStr
|
||||
!else
|
||||
!undef StrStr
|
||||
!define StrStr "!insertmacro FUNCTION_STRING_StrStr_Call"
|
||||
|
||||
Function StrStr
|
||||
!endif
|
||||
|
||||
Exch $R1 ; st=haystack,old$R1, $R1=needle
|
||||
Exch ; st=old$R1,haystack
|
||||
Exch $R2 ; st=old$R1,old$R2, $R2=haystack
|
||||
|
@ -68,8 +73,6 @@ by Diego Pedroso (aka deguix)
|
|||
Exch $R1
|
||||
FunctionEnd
|
||||
|
||||
!endif
|
||||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrStr_Call ResultVar String StrToSearchFor
|
||||
|
@ -85,23 +88,38 @@ by Diego Pedroso (aka deguix)
|
|||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrLoc
|
||||
!macro FUNCTION_STRING_UnStrStr_Call ResultVar String StrToSearchFor
|
||||
|
||||
!ifndef FUNCTION_STRING_StrLoc
|
||||
!echo `$ {UnStrStr} "${ResultVar}" "${String}" "${StrToSearchFor}"$\r$\n`
|
||||
|
||||
Push `${String}`
|
||||
Push `${StrToSearchFor}`
|
||||
|
||||
Call un.StrStr
|
||||
|
||||
Pop `${ResultVar}`
|
||||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrLoc
|
||||
|
||||
!echo "$\r$\n----------------------------------------------------------------------$\r$\nLocalize in String Function - © 2004 Diego Pedroso\r$\n----------------------------------------------------------------------$\r$\n$\r$\n"
|
||||
|
||||
!define FUNCTION_STRING_StrLoc
|
||||
!ifdef FUNCTION_STRING_UninstSupport
|
||||
!undef UnStrLoc
|
||||
!define UnStrLoc "!insertmacro FUNCTION_STRING_UnStrLoc_Call"
|
||||
Function un.StrLoc
|
||||
!else
|
||||
!undef StrLoc
|
||||
!define StrLoc "!insertmacro FUNCTION_STRING_StrLoc_Call"
|
||||
|
||||
Function StrLoc
|
||||
!endif
|
||||
|
||||
Exch $R0
|
||||
Exch
|
||||
Exch $R1 ; st=haystack,old$R1, $R1=needle
|
||||
Exch 2 ; st=old$R1,haystack
|
||||
Exch $R2 ; st=old$R1,old$R2, $R2=haystack
|
||||
|
||||
Push $R3
|
||||
Push $R4
|
||||
Push $R5
|
||||
|
@ -131,12 +149,11 @@ by Diego Pedroso (aka deguix)
|
|||
Pop $R4
|
||||
Pop $R3
|
||||
Pop $R2
|
||||
Exch
|
||||
Pop $R1
|
||||
Exch $R0
|
||||
FunctionEnd
|
||||
|
||||
!endif
|
||||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrLoc_Call ResultVar String StrToSearchFor OffsetDirection
|
||||
|
@ -153,18 +170,33 @@ by Diego Pedroso (aka deguix)
|
|||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrStrAdv
|
||||
!macro FUNCTION_STRING_UnStrLoc_Call ResultVar String StrToSearchFor OffsetDirection
|
||||
|
||||
!ifndef FUNCTION_STRING_StrStrAdv
|
||||
!echo `$ {UnStrLoc} "${ResultVar}" "${String}" "${StrToSearchFor}" "${OffsetDirection}"$\r$\n`
|
||||
|
||||
Push `${String}`
|
||||
Push `${StrToSearchFor}`
|
||||
Push `${OffsetDirection}`
|
||||
|
||||
Call un.StrLoc
|
||||
|
||||
Pop `${ResultVar}`
|
||||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrStrAdv
|
||||
|
||||
!echo "$\r$\n----------------------------------------------------------------------$\r$\nAdvanced Search in String Function - © 2003-2004 Diego Pedroso$\r$\n----------------------------------------------------------------------$\r$\n$\r$\n"
|
||||
|
||||
!define FUNCTION_STRING_StrStrAdv
|
||||
!ifdef FUNCTION_STRING_UninstSupport
|
||||
!undef UnStrStrAdv
|
||||
!define UnStrStrAdv "!insertmacro FUNCTION_STRING_UnStrStrAdv_Call"
|
||||
Function un.AdvancedStrStr
|
||||
!else
|
||||
!undef StrStrAdv
|
||||
|
||||
!define StrStrAdv "!insertmacro FUNCTION_STRING_StrStrAdv_Call"
|
||||
|
||||
Function AdvancedStrStr
|
||||
!endif
|
||||
|
||||
# Preparing Variables
|
||||
|
||||
|
@ -390,8 +422,6 @@ by Diego Pedroso (aka deguix)
|
|||
|
||||
FunctionEnd
|
||||
|
||||
!endif
|
||||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrStrAdv_Call ResultVar String StrToSearchFor SearchDirection ResultStrDirection DisplayStrToSearch Loops
|
||||
|
@ -411,17 +441,37 @@ by Diego Pedroso (aka deguix)
|
|||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrTok
|
||||
!macro FUNCTION_STRING_UnStrStrAdv_Call ResultVar String StrToSearchFor SearchDirection ResultStrDirection DisplayStrToSearch Loops
|
||||
|
||||
!ifndef FUNCTION_STRING_StrTok
|
||||
!echo `$ {UnStrStrAdv} "${ResultVar}" "${String}" "${StrToSearchFor}" "${SearchDirection}" "${ResultStrDirection}" "${DisplayStrToSearch}" "${Loops}"$\r$\n`
|
||||
|
||||
Push `${String}`
|
||||
Push `${StrToSearchFor}`
|
||||
Push `${SearchDirection}`
|
||||
Push `${ResultStrDirection}`
|
||||
Push `${DisplayStrToSearch}`
|
||||
Push `${Loops}`
|
||||
|
||||
Call un.AdvancedStrStr
|
||||
|
||||
Pop `${ResultVar}`
|
||||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrTok
|
||||
|
||||
!echo "$\r$\n----------------------------------------------------------------------$\r$\nAdvanced Token String Function - © 2004 Diego Pedroso$\r$\n----------------------------------------------------------------------$\r$\n$\r$\n"
|
||||
|
||||
!define FUNCTION_STRING_StrTok
|
||||
!ifdef FUNCTION_STRING_UninstSupport
|
||||
!undef UnStrTok
|
||||
!define UnStrTok "!insertmacro FUNCTION_STRING_UnStrTok_Call"
|
||||
Function un.AdvancedStrTok
|
||||
!else
|
||||
!undef StrTok
|
||||
!define StrTok "!insertmacro FUNCTION_STRING_StrTok_Call"
|
||||
|
||||
Function AdvancedStrTok
|
||||
!endif
|
||||
|
||||
Exch $9
|
||||
Exch
|
||||
Exch $R0
|
||||
|
@ -517,13 +567,11 @@ by Diego Pedroso (aka deguix)
|
|||
Pop $R4
|
||||
Pop $R3
|
||||
Pop $R2
|
||||
Pop $R1
|
||||
Pop $9
|
||||
Pop $R0
|
||||
Exch $9
|
||||
Exch $R1
|
||||
FunctionEnd
|
||||
|
||||
!endif
|
||||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrTok_Call ResultVar StrToTokenize Separators ResultPart SkipEmptyParts
|
||||
|
@ -541,18 +589,35 @@ by Diego Pedroso (aka deguix)
|
|||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrClbSet
|
||||
!macro FUNCTION_STRING_UnStrTok_Call ResultVar StrToTokenize Separators ResultPart SkipEmptyParts
|
||||
|
||||
!ifndef FUNCTION_STRING_StrClbSet
|
||||
!echo `$ {UnStrTok} "${ResultVar}" "${StrToTokenize}" "${Separators}" "${ResultPart}" "${SkipEmptyParts}"$\r$\n`
|
||||
|
||||
Push `${StrToTokenize}`
|
||||
Push `${Separators}`
|
||||
Push `${ResultPart}`
|
||||
Push `${SkipEmptyParts}`
|
||||
|
||||
Call un.AdvancedStrTok
|
||||
|
||||
Pop `${ResultVar}`
|
||||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrClbSet
|
||||
|
||||
!echo "$\r$\n----------------------------------------------------------------------$\r$\nCopy To Clipboard - 2003-2004 Nik Medved$\r$\n----------------------------------------------------------------------$\r$\n$\r$\n"
|
||||
|
||||
!define FUNCTION_STRING_StrClbSet
|
||||
!ifdef FUNCTION_STRING_UninstSupport
|
||||
!undef UnStrClbSet
|
||||
!define UnStrClbSet "!insertmacro FUNCTION_STRING_UnStrClbSet_Call"
|
||||
Function un.CopyToClipboard
|
||||
!else
|
||||
!undef StrClbSet
|
||||
|
||||
!define StrClbSet "!insertmacro FUNCTION_STRING_StrClb_Set"
|
||||
|
||||
!define StrClbSet "!insertmacro FUNCTION_STRING_StrClbSet_Call"
|
||||
Function CopyToClipboard
|
||||
!endif
|
||||
|
||||
Exch $0 ;input string
|
||||
Push $1
|
||||
Push $2
|
||||
|
@ -571,20 +636,21 @@ by Diego Pedroso (aka deguix)
|
|||
Pop $0
|
||||
FunctionEnd
|
||||
|
||||
!endif
|
||||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrClbGet
|
||||
|
||||
!ifndef FUNCTION_STRING_StrClbGet
|
||||
|
||||
!echo "$\r$\n----------------------------------------------------------------------$\r$\nCopy From Clipboard Function - 2003-2004 Nik Medved - changed by Diego Pedroso$\r$\n----------------------------------------------------------------------$\r$\n$\r$\n"
|
||||
|
||||
!define FUNCTION_STRING_StrClbGet
|
||||
!ifdef FUNCTION_STRING_UninstSupport
|
||||
!undef UnStrClbGet
|
||||
!define UnStrClbGet "!insertmacro FUNCTION_STRING_UnStrClbGet_Call"
|
||||
Function un.CopyFromClipboard
|
||||
!else
|
||||
!undef StrClbGet
|
||||
|
||||
!define StrClbGet "!insertmacro FUNCTION_STRING_StrClb_Get"
|
||||
!define StrClbGet "!insertmacro FUNCTION_STRING_StrClbGet_Call"
|
||||
Function CopyFromClipboard
|
||||
!endif
|
||||
|
||||
Function CopyFromClipboard
|
||||
Push $0
|
||||
|
@ -594,8 +660,6 @@ by Diego Pedroso (aka deguix)
|
|||
Exch $0
|
||||
FunctionEnd
|
||||
|
||||
!endif
|
||||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrClb_Set String
|
||||
|
@ -608,6 +672,16 @@ by Diego Pedroso (aka deguix)
|
|||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_UnStrClb_Set String
|
||||
|
||||
!echo `$ {UnStrClbSet} "${String}"$\r$\n`
|
||||
|
||||
Push `${String}`
|
||||
|
||||
Call un.CopyToClipboard
|
||||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrClb_Get ResultVar
|
||||
|
||||
!echo `$ {StrClbGet} "${ResultVar}"$\r$\n`
|
||||
|
@ -618,17 +692,30 @@ by Diego Pedroso (aka deguix)
|
|||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrUpperCase
|
||||
!macro FUNCTION_STRING_UnStrClb_Get ResultVar
|
||||
|
||||
!ifndef FUNCTION_STRING_StrUpperCase
|
||||
!echo `$ {UnStrClbGet} "${ResultVar}"$\r$\n`
|
||||
|
||||
Call un.CopyFromClipboard
|
||||
|
||||
Pop `${ResultVar}`
|
||||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrUpperCase
|
||||
|
||||
!echo "$\r$\n----------------------------------------------------------------------$\r$\nUppercase String Function - 2002-2004 Dave Laundon $\r$\n----------------------------------------------------------------------$\r$\n$\r$\n"
|
||||
|
||||
!define FUNCTION_STRING_StrUpperCase
|
||||
!ifdef FUNCTION_STRING_UninstSupport
|
||||
!undef UnStrUpperCase
|
||||
!define UnStrUpperCase "!insertmacro FUNCTION_STRING_UnStrUpperCase_Call"
|
||||
Function un.StrUpper
|
||||
!else
|
||||
!undef StrUpperCase
|
||||
!define StrUpperCase "!insertmacro FUNCTION_STRING_StrUpperCase_Call"
|
||||
|
||||
Function StrUpper
|
||||
!endif
|
||||
|
||||
Exch $0 ; Original string
|
||||
Push $1 ; Final string
|
||||
Push $2 ; Current character
|
||||
|
@ -659,8 +746,6 @@ by Diego Pedroso (aka deguix)
|
|||
Exch $0
|
||||
FunctionEnd
|
||||
|
||||
!endif
|
||||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrUpperCase_Call ResultVar String
|
||||
|
@ -675,17 +760,32 @@ by Diego Pedroso (aka deguix)
|
|||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrLowerCase
|
||||
!macro FUNCTION_STRING_UnStrUpperCase_Call ResultVar String
|
||||
|
||||
!ifndef FUNCTION_STRING_StrLowerCase
|
||||
!echo `$ {UnStrUpperCase} "${ResultVar}" "${String}"$\r$\n`
|
||||
|
||||
Push `${String}`
|
||||
|
||||
Call un.StrUpper
|
||||
|
||||
Pop `${ResultVar}`
|
||||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrLowerCase
|
||||
|
||||
!echo "$\r$\n----------------------------------------------------------------------$\r$\nLowercase String Function - changed from Uppercase String Function 2002-2004 Dave Laundon$\r$\n----------------------------------------------------------------------$\r$\n$\r$\n"
|
||||
|
||||
!define FUNCTION_STRING_StrLowerCase
|
||||
!ifdef FUNCTION_STRING_UninstSupport
|
||||
!undef UnStrLowerCase
|
||||
!define UnStrLowerCase "!insertmacro FUNCTION_STRING_UnStrLowerCase_Call"
|
||||
Function un.StrLower
|
||||
!else
|
||||
!undef StrLowerCase
|
||||
!define StrLowerCase "!insertmacro FUNCTION_STRING_StrLowerCase_Call"
|
||||
|
||||
Function StrLower
|
||||
!endif
|
||||
|
||||
Exch $0 ; Original string
|
||||
Push $1 ; Final string
|
||||
Push $2 ; Current character
|
||||
|
@ -716,8 +816,6 @@ by Diego Pedroso (aka deguix)
|
|||
Exch $0
|
||||
FunctionEnd
|
||||
|
||||
!endif
|
||||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrLowerCase_Call ResultVar String
|
||||
|
@ -732,17 +830,32 @@ by Diego Pedroso (aka deguix)
|
|||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrRep
|
||||
!macro FUNCTION_STRING_UnStrLowerCase_Call ResultVar String
|
||||
|
||||
!ifndef FUNCTION_STRING_StrRep
|
||||
!echo `$ {UnStrLowerCase} "${ResultVar}" "${String}"$\r$\n`
|
||||
|
||||
Push `${String}`
|
||||
|
||||
Call un.StrLower
|
||||
|
||||
Pop `${ResultVar}`
|
||||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrRep
|
||||
|
||||
!echo "$\r$\n----------------------------------------------------------------------$\r$\nReplace String Function - 2002-2004 Hendri Adriaens$\r$\n----------------------------------------------------------------------$\r$\n$\r$\n"
|
||||
|
||||
!define FUNCTION_STRING_StrRep
|
||||
!ifdef FUNCTION_STRING_UninstSupport
|
||||
!undef UnStrRep
|
||||
!define UnStrRep "!insertmacro FUNCTION_STRING_UnStrRep_Call"
|
||||
Function un.StrReplace
|
||||
!else
|
||||
!undef StrRep
|
||||
!define StrRep "!insertmacro FUNCTION_STRING_StrRep_Call"
|
||||
|
||||
Function StrReplace
|
||||
!endif
|
||||
|
||||
Exch $0 ;this will replace wrong characters
|
||||
Exch
|
||||
Exch $1 ;needs to be replaced
|
||||
|
@ -789,8 +902,6 @@ by Diego Pedroso (aka deguix)
|
|||
Exch $0
|
||||
FunctionEnd
|
||||
|
||||
!endif
|
||||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrRep_Call ResultVar String StringToReplace ReplacementString
|
||||
|
@ -807,17 +918,33 @@ by Diego Pedroso (aka deguix)
|
|||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrSort
|
||||
!macro FUNCTION_STRING_UnStrRep_Call ResultVar String StringToReplace ReplacementString
|
||||
|
||||
!ifndef FUNCTION_STRING_StrSort
|
||||
!echo `$ {UnStrRep} "${ResultVar}" "${String}" "${StringToReplace}" "${ReplacementString}"$\r$\n`
|
||||
|
||||
Push `${String}`
|
||||
Push `${StringToReplace}`
|
||||
Push `${ReplacementString}`
|
||||
|
||||
Call un.StrReplace
|
||||
|
||||
Pop `${ResultVar}`
|
||||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrSort
|
||||
|
||||
!echo "$\r$\n----------------------------------------------------------------------$\r$\nAdvanced String Sort Function - © 2004 Diego Pedroso$\r$\n----------------------------------------------------------------------$\r$\n$\r$\n"
|
||||
|
||||
!define FUNCTION_STRING_StrSort
|
||||
!ifdef FUNCTION_STRING_UninstSupport
|
||||
!undef UnStrSort
|
||||
!define UnStrSort "!insertmacro FUNCTION_STRING_UnStrSort_Call"
|
||||
Function un.AdvStrSort
|
||||
!else
|
||||
!undef StrSort
|
||||
!define StrSort "!insertmacro FUNCTION_STRING_StrSort_Call"
|
||||
|
||||
Function AdvStrSort
|
||||
!endif
|
||||
|
||||
# Prepare Variables
|
||||
|
||||
|
@ -945,8 +1072,6 @@ by Diego Pedroso (aka deguix)
|
|||
|
||||
FunctionEnd
|
||||
|
||||
!endif
|
||||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrSort_Call ResultVar String CenterStr LeftStr RightStr IncludeLeftRightStr IncludeCenterStr
|
||||
|
@ -966,17 +1091,37 @@ by Diego Pedroso (aka deguix)
|
|||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrTrimNewLines
|
||||
!macro FUNCTION_STRING_UnStrSort_Call ResultVar String CenterStr LeftStr RightStr IncludeLeftRightStr IncludeCenterStr
|
||||
|
||||
!ifndef FUNCTION_STRING_StrTrimNewLines
|
||||
!echo `$ {UnStrSort} "${ResultVar}" "${String}" "${CenterStr}" "${LeftStr}" "${RightStr}" "${IncludeLeftRightStr}" "${IncludeCenterStr}"$\r$\n`
|
||||
|
||||
Push `${String}`
|
||||
Push `${CenterStr}`
|
||||
Push `${LeftStr}`
|
||||
Push `${RightStr}`
|
||||
Push `${IncludeLeftRightStr}`
|
||||
Push `${IncludeCenterStr}`
|
||||
|
||||
Call un.AdvStrSort
|
||||
|
||||
Pop `${ResultVar}`
|
||||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrTrimNewLines
|
||||
|
||||
!echo "$\r$\n----------------------------------------------------------------------$\r$\nTrim New Lines Function - 2003-2004 Ximon Eighteen$\r$\n----------------------------------------------------------------------$\r$\n$\r$\n"
|
||||
|
||||
!define FUNCTION_STRING_StrTrimNewLines
|
||||
!ifdef FUNCTION_STRING_UninstSupport
|
||||
!undef UnStrTrimNewLines
|
||||
!define UnStrTrimNewLines "!insertmacro FUNCTION_STRING_UnStrTrimNewLines_Call"
|
||||
Function un.TrimNewlines
|
||||
!else
|
||||
!undef StrTrimNewLines
|
||||
!define StrTrimNewLines "!insertmacro FUNCTION_STRING_StrTrimNewLines_Call"
|
||||
|
||||
Function TrimNewlines
|
||||
!endif
|
||||
|
||||
Exch $R0
|
||||
Push $R1
|
||||
Push $R2
|
||||
|
@ -998,8 +1143,6 @@ by Diego Pedroso (aka deguix)
|
|||
Exch $R0
|
||||
FunctionEnd
|
||||
|
||||
!endif
|
||||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrTrimNewLines_Call ResultVar String
|
||||
|
@ -1014,17 +1157,32 @@ by Diego Pedroso (aka deguix)
|
|||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrNSISToIO
|
||||
!macro FUNCTION_STRING_UnStrTrimNewLines_Call ResultVar String
|
||||
|
||||
!ifndef FUNCTION_STRING_StrNSISToIO
|
||||
!echo `$ {UnStrTrimNewLines} "${ResultVar}" "${String}"$\r$\n`
|
||||
|
||||
Push `${String}`
|
||||
|
||||
Call un.TrimNewLines
|
||||
|
||||
Pop `${ResultVar}`
|
||||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrNSISToIO
|
||||
|
||||
!echo "$\r$\n----------------------------------------------------------------------$\r$\nNSIS -> Install Options String Convertion Function - 2003-2004 Amir Szekely, Joost Verburg and Dave Laundon$\r$\n----------------------------------------------------------------------$\r$\n$\r$\n"
|
||||
|
||||
!define FUNCTION_STRING_StrNSISToIO
|
||||
!ifdef FUNCTION_STRING_UninstSupport
|
||||
!undef UnStrNSISToIO
|
||||
!define UnStrNSISToIO "!insertmacro FUNCTION_STRING_UnStrNSISToIO_Call"
|
||||
Function un.Nsis2Io
|
||||
!else
|
||||
!undef StrNSISToIO
|
||||
!define StrNSISToIO "!insertmacro FUNCTION_STRING_StrNSISToIO_Call"
|
||||
|
||||
Function Nsis2Io
|
||||
!endif
|
||||
|
||||
Exch $0 ; The source
|
||||
Push $1 ; The output
|
||||
Push $2 ; Temporary char
|
||||
|
@ -1054,8 +1212,6 @@ by Diego Pedroso (aka deguix)
|
|||
Exch $0
|
||||
FunctionEnd
|
||||
|
||||
!endif
|
||||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrNSISToIO_Call ResultVar String
|
||||
|
@ -1070,17 +1226,32 @@ by Diego Pedroso (aka deguix)
|
|||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrIOToNSIS
|
||||
!macro FUNCTION_STRING_UnStrNSISToIO_Call ResultVar String
|
||||
|
||||
!ifndef FUNCTION_STRING_StrIOToNSIS
|
||||
!echo `$ {UnStrNSISToIO} "${ResultVar}" "${String}"$\r$\n`
|
||||
|
||||
Push `${String}`
|
||||
|
||||
Call un.NSIS2IO
|
||||
|
||||
Pop `${ResultVar}`
|
||||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrIOToNSIS
|
||||
|
||||
!echo "$\r$\n----------------------------------------------------------------------$\r$\nInstall Options -> NSIS String Convertion Function - 2003-2004 Amir Szekely, Joost Verburg and Dave Laundon$\r$\n----------------------------------------------------------------------$\r$\n$\r$\n"
|
||||
|
||||
!define FUNCTION_STRING_StrIOToNSIS
|
||||
!ifdef FUNCTION_STRING_UninstSupport
|
||||
!undef UnStrIOToNSIS
|
||||
!define UnStrIOToNSIS "!insertmacro FUNCTION_STRING_UnStrIOToNSIS_Call"
|
||||
Function un.Io2Nsis
|
||||
!else
|
||||
!undef StrIOToNSIS
|
||||
!define StrIOToNSIS "!insertmacro FUNCTION_STRING_StrIOToNSIS_Call"
|
||||
|
||||
Function Io2Nsis
|
||||
!endif
|
||||
|
||||
Exch $0 ; The source
|
||||
Push $1 ; The output
|
||||
Push $2 ; Temporary char
|
||||
|
@ -1115,8 +1286,6 @@ by Diego Pedroso (aka deguix)
|
|||
Exch $0
|
||||
FunctionEnd
|
||||
|
||||
!endif
|
||||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_StrIOToNSIS_Call ResultVar String
|
||||
|
@ -1131,6 +1300,38 @@ by Diego Pedroso (aka deguix)
|
|||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_UnStrIOToNSIS_Call ResultVar String
|
||||
|
||||
!echo `$ {UnStrIOToNSIS} "${ResultVar}" "${String}"$\r$\n`
|
||||
|
||||
Push `${String}`
|
||||
|
||||
Call un.IO2NSIS
|
||||
|
||||
Pop `${ResultVar}`
|
||||
|
||||
!macroend
|
||||
|
||||
!macro FUNCTION_STRING_UninstSupport
|
||||
|
||||
!define FUNCTION_STRING_UninstSupport
|
||||
|
||||
!define UnStrClbGet "!insertmacro FUNCTION_STRING_StrClbGet"
|
||||
!define UnStrClbSet "!insertmacro FUNCTION_STRING_StrClbSet"
|
||||
!define UnStrIOToNSIS "!insertmacro FUNCTION_STRING_StrIOToNSIS"
|
||||
!define UnStrLoc "!insertmacro FUNCTION_STRING_StrLoc"
|
||||
!define UnStrLowerCase "!insertmacro FUNCTION_STRING_StrLowerCase"
|
||||
!define UnStrNSISToIO "!insertmacro FUNCTION_STRING_StrNSISToIO"
|
||||
!define UnStrRep "!insertmacro FUNCTION_STRING_StrRep"
|
||||
!define UnStrSort "!insertmacro FUNCTION_STRING_StrSort"
|
||||
!define UnStrStr "!insertmacro FUNCTION_STRING_StrStr"
|
||||
!define UnStrStrAdv "!insertmacro FUNCTION_STRING_StrStrAdv"
|
||||
!define UnStrTok "!insertmacro FUNCTION_STRING_StrTok"
|
||||
!define UnStrTrimNewLines "!insertmacro FUNCTION_STRING_StrTrimNewLines"
|
||||
!define UnStrUpperCase "!insertmacro FUNCTION_STRING_StrUpperCase"
|
||||
|
||||
!macroend
|
||||
|
||||
!ifndef MUI_VERBOSE
|
||||
!define MUI_VERBOSE 4
|
||||
!endif
|
||||
|
|
|
@ -37,8 +37,14 @@ How to use
|
|||
2. Commands
|
||||
-----------
|
||||
|
||||
IMPORTANT: Every command in this header file have to be called first
|
||||
before, out of sections and functions and without parameters. Example:
|
||||
2.1 How To Use Commands In Install Sections and Functions
|
||||
---------------------------------------------------------
|
||||
|
||||
Every command used in install sections and functions have to be called
|
||||
first before and out any sections and functions, and without parameters.
|
||||
|
||||
Example:
|
||||
--------
|
||||
|
||||
!include "StrFunc.nsh"
|
||||
|
||||
|
@ -50,6 +56,49 @@ How to use
|
|||
|
||||
SectionEnd
|
||||
|
||||
2.2 How To Use Commands In Uninstall Sections and Functions
|
||||
-----------------------------------------------------------
|
||||
|
||||
Commands with Uninstall Sections and Functions support have "Un" before
|
||||
the words inside brackets "{}".
|
||||
|
||||
Example:
|
||||
--------
|
||||
|
||||
${UnStrStr}
|
||||
|
||||
Every command used in uninstall sections and functions have to be called
|
||||
first before and out any sections and functions, without parameters, and
|
||||
after the header command "${UnStrFunc}" to activate the Uninstall sections
|
||||
and functions support for the commands following.
|
||||
|
||||
Example:
|
||||
--------
|
||||
|
||||
!include "StrFunc.nsh"
|
||||
|
||||
${StrStr} # Supportable for Install Sections and Functions
|
||||
|
||||
${UnStrFunc} # Command to separate commands supportable for
|
||||
# Install/Uninstall sections and functions
|
||||
|
||||
${UnStrStr} # Supportable for Uninstall Sections and Functions
|
||||
|
||||
Section
|
||||
|
||||
${StrStr} $0 "OK! Now what?" "wh"
|
||||
|
||||
SectionEnd
|
||||
|
||||
Section Uninstall
|
||||
|
||||
${UnStrStr} $0 "OK! Now what?" "wh"
|
||||
|
||||
SectionEnd
|
||||
|
||||
2.3 Commands
|
||||
------------
|
||||
|
||||
=========================================================================
|
||||
***** ${StrStr} ResultVar String StrToSearchFor
|
||||
=========================================================================
|
||||
|
@ -541,6 +590,11 @@ Trim Function
|
|||
Version History
|
||||
---------------
|
||||
|
||||
1.03 - 02/12/2004
|
||||
|
||||
- Added commands support for uninstall sections and functions.
|
||||
- Fixed variables switch in "StrLoc" and "StrTok" after using these.
|
||||
|
||||
1.02 - 02/07/2004
|
||||
|
||||
- Fixed StrLoc.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue