Old 14th September 2010, 22:25   #1
jammusi
Member
 
Join Date: Dec 2009
Posts: 78
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
jammusi is offline   Reply With Quote
Old 14th September 2010, 23:32   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK is offline   Reply With Quote
Old 15th September 2010, 08:55   #3
jammusi
Member
 
Join Date: Dec 2009
Posts: 78
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
jammusi is offline   Reply With Quote
Old 15th September 2010, 09:15   #4
DrO
 
Join Date: Sep 2003
Posts: 27,873
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
DrO is offline   Reply With Quote
Old 15th September 2010, 09:35   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK is offline   Reply With Quote
Old 15th September 2010, 09:47   #6
DrO
 
Join Date: Sep 2003
Posts: 27,873
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
DrO is offline   Reply With Quote
Old 15th September 2010, 10:15   #7
jammusi
Member
 
Join Date: Dec 2009
Posts: 78
Cool tx

Is there any way to write NSIS plugins with c# or only C/ C++?
jammusi is offline   Reply With Quote
Old 15th September 2010, 10:34   #8
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
There is the CLR plug-in (search for it) but of course the destination machine must have .NET installed.

Stu
Afrow UK is offline   Reply With Quote
Old 15th September 2010, 11:12   #9
jammusi
Member
 
Join Date: Dec 2009
Posts: 78
tx

I'll look it later
jammusi is offline   Reply With Quote
Old 15th September 2010, 14:56   #10
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You are better off using the WMI plug-in as I have already suggested. WMI is not part of .NET.

Stu
Afrow UK is offline   Reply With Quote
Old 15th September 2010, 20:02   #11
jammusi
Member
 
Join Date: Dec 2009
Posts: 78
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:
Quote:
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
jammusi is offline   Reply With Quote
Old 15th September 2010, 20:31   #12
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK is offline   Reply With Quote
Old 15th September 2010, 20:37   #13
jammusi
Member
 
Join Date: Dec 2009
Posts: 78
yes - this is exactly what i am doing




tx
jammusi is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
processes plugin, windows server 2008, x64

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump