nsi脚本如何使用第三方dll
通过AddPluginDir 引入第三方dll库目录 ,目kill进程一般会有两种选择,通过killprocess.dll的方式或者nsprocess.dll的调用方式
https://nsis.sourceforge.io/FindProcDLL_plug-in 使用查看链接
!AddPluginDir "./Plugins"
SetCompressor /SOLID lzma
!include "Logiclib.nsh"
OutFile "KillProcDLL1.exe"
Section "永恒心锁"
FindProcDLL::FindProc "$1"
Pop $R0
KillProcDLL::KillProc "notepad.exe"
MessageBox MB_OK "$R0:you are"
ExecShell open "notepad.exe"
Sleep 200
KillProcDLL::KillProc "notepad.exe"
Pop $R0
${If} $R0 == 0
MessageBox MB_OK "$R0:you are"
${EndIf}
SectionEnd
nsprocess.dll
StrCpy $1 "YOURAPP.exe"
nsProcess::_FindProcess "$1"
Pop $R0
${If} $R0 = 0
nsProcess::_KillProcess "$1"
Pop $R0
Sleep 500
${EndIf}