#198777 - 2010-06-06 04:49 AM
Enumerate Installed Software
|
Mark Pietersz
Getting the hang of it
Registered: 2001-09-30
Posts: 74
Loc: Melbourne, Australia
|
Hi Team
After trying select * from WIn32_Product and finding that it doesn't always return all installed software I am now looking at enumerating the reg key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
I've noticed that there's a variety of sub keys
Can someone please explain the use of key like {196E77C5-F524-4B50-BD1A-2C21EEE9B8F7} as opposed to Microsoft SQL Server 10
Sometimes it seems that some software has both a "{" type entry as well as plain English entry.
MS Office does not have plain english value at all and IE is tricky to pick up.
Finally, I suspect that many people have already done this - is there a UDF for it?
TIA
Mark
|
|
Top
|
|
|
|
#198782 - 2010-06-07 01:59 PM
Re: Enumerate Installed Software
[Re: Mark Pietersz]
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Search for "+software +inventory"
Here is an example: http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Board=1&Number=179390
The "gibberish" key names don't mean anything, they are just intended to be unique so sometimes developers use the product name and sometimes they don't. The idea is to avoid a clash if two different developers happen to use similar product names.
The reason you have the same product multiple times may be because the developers switched from a meaningful name to a non-meaningful between versions or for hotfixes.
|
|
Top
|
|
|
|
#198785 - 2010-06-07 03:44 PM
Re: Enumerate Installed Software
[Re: Richard H.]
|
eriqjaffe
Hey THIS is FUN
Registered: 2004-06-24
Posts: 214
Loc: Arlington Heights, IL USA
|
It's easier (and, generally, more meaningful) to just grab the "DisplayName" string from each subkey.
$ = SetOption("NoMacrosInStrings","ON")
$ = SetOption("NoVarsInStrings","ON")
$ = SetOption("WrapAtEOL","ON")
BREAK ON
$regkey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
$array = arrayenumkey($regkey)
for each $key in $array
$displayname = readvalue($regkey+"\"+$key,"DisplayName")
if $displayname <> ""
$displayname + @CRLF
endif
next
|
|
Top
|
|
|
|
#198792 - 2010-06-07 09:10 PM
Re: Enumerate Installed Software
[Re: NTDOC]
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
I always use uninstall key name + display name if present
|
|
Top
|
|
|
|
#198808 - 2010-06-09 12:54 AM
Re: Enumerate Installed Software
[Re: Mark Pietersz]
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11634
Loc: Space
|
hmmm... seems like maybe Mark has left the building, but anyways.
I'm not saying it's THE BEST but it is certainly one of the most complete software inventory scripts on the site. Download it and take a look at the code and modify, update, fix anything wrong or to make it do what you want it to do. Better than starting from scratch - or at least maybe give you an idea of how to do it if you do want to start from scratch.
My Computer Info for Helpdesk use Part 4
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 924 anonymous users online.
|
|
|