NSIS - check if process exists (nsProcess not working)
Asked Answered
B

1

11

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?

Babin answered 13/4, 2016 at 5:55 Comment(1)
For the compilation error did you put nsProcess.nsh in include directory of NSIS installed folder? Same for nsProcess.dll file? I'm using nsProcess FindProcess and KIllProcess under Win7 x64 without any issues.Lyndel
I
20

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.

Imidazole answered 13/4, 2016 at 9:18 Comment(3)
Shouldn't it be Include, not Includes?Towhee
@Towhee Thanks, fixed my answerImidazole
thank you for the nsProcessW.dll renamed to nsProcess.dllQuadrille

© 2022 - 2024 — McMap. All rights reserved.