NSIS - check if process exists (nsProcess not working)

可紊 提交于 2020-02-21 11:06:42

问题


For my NSIS uninstaller, I want to check if a process is running. FindProcDLL is not working under Windows 7 x64, so I tried nsProcess.

I've downloaded the version 1.6 from the website: http://nsis.sourceforge.net/NsProcess_plugin

If I start the nsProcessTest.nsi in the Example folder, I get the following errors:

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

This is line 14 of the example script:

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

Do somebody know what is wrong? How can I check if a process is running with NSIS?


回答1:


NSIS does not find the plug-in, so make sure you copied its files to the correct folder.

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

The file inside Plugins\x86-unicode is nsProcessW.dll renamed to nsProcess.dll (blame the author for making it overly complicated!)

More generally, refer to How can I install a plugin? on the NSIS Wiki.



来源:https://stackoverflow.com/questions/36589736/nsis-check-if-process-exists-nsprocess-not-working

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!