Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSIS - check if process exists (nsProcess not working)

Tags:

process

nsis

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?

like image 270
Struct Avatar asked Apr 13 '16 05:04

Struct


1 Answers

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.

like image 134
idleberg Avatar answered Oct 23 '22 01:10

idleberg