NSIS - 检查进程是否存在(nsProcess不工作)

Str*_*uct 6 nsis process

对于我的NSIS卸载程序,我想检查进程是否正在运行.FindProcDLL在Windows 7 x64下无法运行,所以我尝试了nsProcess.

我从网站上下载了1.6版本:http://nsis.sourceforge.net/NsProcess_plugin

如果我在Example文件夹中启动nsProcessTest.nsi,我会收到以下错误:

Section: "Find process" ->(FindProcess)
!insertmacro: nsProcess::FindProcess
Invalid command: nsProcess::_FindProcess
Error in macro nsProcess::FindProcess on macroline 1
Error in script "C:\Users\Sebastian\Desktop\nsProcess_1_6\Example\nsProcessTest.nsi" on line 14 -- aborting creation process
Run Code Online (Sandbox Code Playgroud)

这是示例脚本的第14行:

${nsProcess::FindProcess} "Calc.exe" $R0
Run Code Online (Sandbox Code Playgroud)

有人知道出了什么问题吗?如何检查进程是否与NSIS一起运行?

idl*_*erg 10

NSIS找不到插件,因此请确保将其文件复制到正确的文件夹中.

NSIS 2.x:

NSIS/
??? Include/
?   ??? nsProcess.nsh
??? Plugins/
    ??? nsProcess.dll
Run Code Online (Sandbox Code Playgroud)

NSIS 3.x:

NSIS/
??? Include/
?   ??? nsProcess.nsh
??? Plugins/
    ??? x86-ansi/
    ?   ??? nsProcess.dll
    ??? x86-unicode/
        ??? nsProcess.dll
Run Code Online (Sandbox Code Playgroud)

里面的文件Plugins\x86-unicodensProcessW.dll重命名为nsProcess.dll(责怪作者过于复杂!)

更一般地,请参阅如何安装插件?在NSIS Wiki上.