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

问题描述 投票:6回答:1

对于我的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

这是示例脚本的第14行:

${nsProcess::FindProcess} "Calc.exe" $R0

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

process nsis
1个回答
9
投票

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

NSIS 2.X:

NSIS/
├── Include/
│   └── nsProcess.nsh
└── Plugins/
    └── nsProcess.dll

NSIS 3.X;

NSIS/
├── Include/
│   └── nsProcess.nsh
└── Plugins/
    ├── x86-ansi/
    │   └── nsProcess.dll
    └── x86-unicode/
        └── nsProcess.dll

Plugins\x86-unicode中的文件是nsProcessW.dll重命名为nsProcess.dll(责怪作者过于复杂!)

更一般地,请参考NSIS Wiki上的How can I install a plugin?

© www.soinside.com 2019 - 2024. All rights reserved.