- NSIS Discussion
- Processes plugin used on Win server 2008 x64
Archive: Processes plugin used on Win server 2008 x64
jammusi
14th September 2010 23:25 UTC
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
Afrow UK
15th September 2010 00:32 UTC
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
jammusi
15th September 2010 09:55 UTC
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
DrO
15th September 2010 10:15 UTC
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
Afrow UK
15th September 2010 10:35 UTC
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
DrO
15th September 2010 10:47 UTC
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
jammusi
15th September 2010 11:15 UTC
Cool tx
Is there any way to write NSIS plugins with c# or only C/ C++?
Afrow UK
15th September 2010 11:34 UTC
There is the CLR plug-in (search for it) but of course the destination machine must have .NET installed.
Stu
jammusi
15th September 2010 12:12 UTC
tx
I'll look it later
Afrow UK
15th September 2010 15:56 UTC
You are better off using the WMI plug-in as I have already suggested. WMI is not part of .NET.
Stu
jammusi
15th September 2010 21:02 UTC
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
Afrow UK
15th September 2010 21:31 UTC
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
jammusi
15th September 2010 21:37 UTC
yes - this is exactly what i am doing
:up:
tx