Archive: Processes plugin used on Win server 2008 x64


Processes plugin used on Win server 2008 x64
Hi,

I am using the Processes pluin in order to find when does the explorer process finished its loading after system reboot.
It works perfect for Windows 7 (x86) and xp

When running on Windows server x2008 x64 machine it does not discover the explorer process.

I saw this plugin has another version for vista OS x64 platform

1. Does this support any x64 platform (for instance Windows server 2008) ?
2. Does it also support a x86 machines?
That is: Can I use this version of the plugin to compile the setup script on x86 machine as well as to be executed there?

Tx

Oren


You cannot query a 64-bit process name (GetModuleBaseName) from a 32-bit process. You have to use something like WMI instead (there is a plug-in for this).

Stu


Hi,

I am not sure I understand what you mean. Are you talking about NSIS or is it a general limitation?

I wrote a simple c# application compiled for x86 machine on a x86 machine.

The application list all processes on the machine it runs on.

I have executed this on the x64 machine and it showed everything (including the explorer process)

tx

Oren


C# works differently as most C# assemblies contain what's needed to allow them to run as x86 or x64 as needed. with the NSIS processes plug-in, as it's a x86 only plug-in (and with NSIS being a x86 only program) it's not able to access certain x64 specific features (is just how it works).

-daz


Also the .NET System.Diagnostics.Process class uses WMI to get its processes (which is why I said to use WMI) so it doesn't matter whether it's running as x86 or x64.

Stu


ah didn't know that's what it uses, thanks for that stu (shows i'm still a right noob when it comes to C# though i've only done a month of using it actively so far, heh).

-daz


Cool tx

Is there any way to write NSIS plugins with c# or only C/ C++?


There is the CLR plug-in (search for it) but of course the destination machine must have .NET installed.

Stu


tx

I'll look it later


You are better off using the WMI plug-in as I have already suggested. WMI is not part of .NET.

Stu


Hi Stu,

1. The Installer I am handling already have a .NET class performing many other tasks.
This interface between the NSIS installer and the class is already "live a kicking" for a long time ans adding the FindProcess functionality was smooth.
The .NET limitation is not an issue as the installed product nneds .NET runtime and it is pre-requisite for the setup any how.


2. Before using this type of implementation - I briefly looked at the WMI plugin and didn't find processes related functionality. Adding the fact you said before:

You have to use something like WMI instead (there is a plug-in for this).
I assumed that this plugin does not support that.

Am I wrong?

Tx

Oren

WMI (Windows Management Instrumentation) allows you to programmatically query the OS using WQL (a lot like SQL). The System.Management namespace in .NET provides WMI methods. For querying processes with WMI you'd use the Win32_Process WMI class. Just had a look at the WmiInspector plug-in and it does look very limited. The only option the plug-in gives is limited (WmiInspector::Request which may not be enough for what you are after). If .NET is a prerequisite then you might as well use that (and use the Process class).

Stu


yes - this is exactly what i am doing


:up:

tx