|
|
|
|
#1 |
|
Junior Member
Join Date: Oct 2007
Posts: 24
|
WMI plug-in
Attached plugin supports wmi request from MS API call.
I have included script sample. For now it can retrieve : * OS Name * OS Version * AntiVirus Name * FireWall Name * CPU Name * Desktop resolution * Any information if you provide correct parameters Any suggestion are welcomed. More info could be found at the NSIS Wiki plugin page http://nsis.sourceforge.net/WmiInspector_plug-in Last edited by l0k1; 30th April 2008 at 15:40. |
|
|
|
|
|
#2 |
|
Junior Member
Join Date: Oct 2007
Posts: 24
|
I've just added
* SQL Version |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Oct 2007
Posts: 24
|
Forgot to join file
|
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Oct 2007
Posts: 24
|
Added :
*UserName *ShortUserName *UserSID to retrieve user name and SID from registry. |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Apr 2009
Posts: 23
|
I'm very much a newbie to NSIS. I have two questions regarding this plugin:-
1 I can't get the examples to work I get an error:- "WmiInspector::Request" I am guessing that it is something to do with where I place the plugin files which I assume are WmiInspector.vcproj, WmiInspector.cpp and WmiInspector.sln? Can anyone advise? 2 The WMI call I want to replicate in NSIS is contained in the following:- code: I am unsure how to go about this and would be grateful for some pointers. Charlie |
|
|
|
|
|
#6 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Those files you mention are for the source code. You just need to put the DLL file in the NSIS\Plugins folder
Stu |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Apr 2009
Posts: 23
|
Thanks for the speedy response. I open the zip at http://nsis.sourceforge.net/WmiInspector_plug-in and the only files there are:-
TestWmiInspector.exe TestWmiInspector..nsi WmiInspector.cpp WmiInspector.vcproj WmiInspector.sln No DLL. Same for the files attached to this message. Charlie |
|
|
|
|
|
#8 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Looks like l0k1 forgot to put the actual plugin in the Zip!
Stu |
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Apr 2009
Posts: 23
|
So I'm not going mad after all then
|
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Apr 2009
Posts: 23
|
Is there a way of tracking it down?
|
|
|
|
|
|
#11 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
You will need to build the plugin yourself using Visual Studio. If you are using Windows XP or 2000 you can build with Visual Studio Express Editions C++ 2008 and the Windows Server 2003 PSDK.
http://www.microsoft.com/Express/ http://www.microsoft.com/downloads/d...displaylang=en I cannot build for you as I am running Windows Vista (I can only install the Windows Server 2008 PSDK). Stu |
|
|
|
|
|
#12 |
|
Junior Member
Join Date: Apr 2009
Posts: 23
|
Hmm uncharted territory for me but I'll give it a go. The blurb on http://www.microsoft.com/Express/ tells me I also need the Microsoft MSDN Express Library. Presumably that's correct. Could you give me pointers what I do when I have these all installed?
Charlie |
|
|
|
|
|
#13 |
|
Member
Join Date: Mar 2007
Location: Italy
Posts: 99
|
Hello,
the .zip file CONTAINS the .dll Please double check that you don't have it. Regards Stefano |
|
|
|
|
|
#14 |
|
Junior Member
Join Date: Apr 2009
Posts: 23
|
Nope when I click on any of the zips I just get the five files listed:-
TestWmiInspector.exe TestWmiInspector..nsi WmiInspector.cpp WmiInspector.vcproj WmiInspector.sln What URL are you using? |
|
|
|
|
|
#15 |
|
Junior Member
Join Date: Apr 2009
Posts: 23
|
Hang on I have just cleared my cache and the second link on this thread does indeed now show the DLL Grrrrrrrrrrrrrrrrrrrr.
|
|
|
|
|
|
#16 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
The file on the Wiki does not contain the dll.
Stu |
|
|
|
|
|
#17 |
|
Junior Member
Join Date: Apr 2009
Posts: 23
|
That would fit with the cache problem I hit as it was the first one I opened.
|
|
|
|
|
|
#18 | ||
|
Junior Member
Join Date: Apr 2009
Posts: 23
|
I am trying to capture the domain or the computer using:-
Quote:
Quote:
Also how do I recover a boolean value - in particular the WMI value "PartOfDomain" Can anyone give me some pointers? Charlie |
||
|
|
|
|
|
#19 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Domain and PartOfDomain are not in Win32_OperatingSystem; they are in Win32_ComputerSystem.
Stu |
|
|
|
|
|
#20 |
|
Junior Member
Join Date: Apr 2009
Posts: 23
|
Aha so often the answer to something that has bugged me for days proves to be frustatingly simple. Thanks for the help on all of this.
|
|
|
|
|
|
#21 |
|
Junior Member
Join Date: Jan 2007
Posts: 11
|
wmi calls returning arrays
Hey l0k1, I noticed the plugin doesn't support any WMI calls that return an array of ints...
WmiInspector::Request "CIMV2" "Win32_SystemEnclosure" "ChassisTypes" ; see http://msdn.microsoft.com/en-us/library/aa394474(VS.85).aspx Internally, I need to handle the case where var.vt is VT_ARRAY|VT_I4, but I haven't figured that out yet. Have you? |
|
|
|
|
|
#22 |
|
Junior Member
Join Date: Jan 2010
Posts: 1
|
how can i read all values (not just one) from request? How can i add loop to walk throw all values?
--- And there is problem with Unicode NSIS. i compiled with ANSI NSIS and its ok, Unicode NSIS gives me request return in chinese ot smth |
|
|
|
|
|
#23 |
|
Junior Member
Join Date: May 2009
Posts: 16
|
Wmi
Im not sure if its possible to read through all results using this plug in but i created a macro based on the wmic command that reads through all results.
Download WMI.nsh attached to this post and see the following file as an example: code: Usage ${GetWMI} namespace classes property callback_Function In the callback function results are $R0 = result number, $R1 = total results, $R2 = Result name. Theres a WMI code creator tool which is useful for finding out the namespaces, classes , and properties which can be downloaded here http://www.microsoft.com/downloads/e...displaylang=en |
|
|
|
|
|
#24 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Please make a Wiki page. Also I would recommend wrapping your header in:
!ifndef __WMI_Included__ !define __WMI_Included__ ... !endif Stu |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|