NSIS查找文本中是否包含某个字串
!include "textfunc.nsh"
!include "logiclib.nsh"
OutFile "find.exe"
#文本文件a.txt内其中一行包含字串kb234783
#编写 水晶石
#查找文本中是否包含某个字串
Var found
Section
StrCpy $found 0
${LineFind} "a.txt" "/NUL" "1:-1" "GrepFunc"
${if} $found = 1
MessageBox MB_OK "找到了"
${else}
MessageBox MB_OK "没找到"
${endIf}
SectionEnd
Function GrepFunc
${TrimNewLines} '$R9' $R9
System::Call "Shlwapi::StrStr(tR9, t`kb234783`)i .r0"
${if} $0 != 0
StrCpy $found 1
Push "StopLineFind"
${else}
Push 0
${endIf}
FunctionEnd
本文来自博客园,作者:水晶石,转载请注明原文链接:https://www.cnblogs.com/NSIS/p/16581126.html