Skip to content
⌘ NSIS Forum Archive

Can't get nsProcess and Processes plugins to work in Win 7 x64

5 posts

juliarg#

Can't get nsProcess and Processes plugins to work in Win 7 x64

Hi,
I need to detect a running firefox before installation in Win 7 x64. I tried both nsProcess and Processes plugins, but failed to get an expected return value.

The code I tried was the following ($5 contains the process name):

${nsProcess::FindProcess} "firefox.exe" $R0
StrCmp $R0 0 0 notdetected

After this, R0 contained rubbish.

Processes::FindProcess "firefox"
StrCmp $R0 1 0 notdetected

After this, R0 was empty.

Anything I could do next?
jpderuiter#
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.
juliarg#
Thanks for the link! It turns out I have to use WMI. Is there already a NSIS macro for detecting a process via WMI without killing it?
Afrow UK#
Probably not. You can write the code yourself using the System plug-in or write a DLL. MSDN has lots of samples of querying WMI in C.

Stu
razvar#
try issproc, google it. It was made for Inno Setup but works for nsis too... no wmi required :-)