Page 1 of 1 1
Topic Options
#198777 - 2010-06-06 04:49 AM Enumerate Installed Software
Mark Pietersz Offline
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 Offline
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 Offline
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.

 Code:
$ = 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
#198789 - 2010-06-07 07:03 PM Re: Enumerate Installed Software [Re: Richard H.]
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
 Originally Posted By: Richard H.

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.


Actually, it does mean: GUID \:D

http://en.wikipedia.org/wiki/GUID

HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#198791 - 2010-06-07 08:48 PM Re: Enumerate Installed Software [Re: eriqjaffe]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
If you only look for "DisplayName" then you're going to miss a lot of installed software as many installations don't have that populated.

But I suppose if one doesn't want to get back everything as in minor plugins etc then just "DisplayName" might be all you want.

Top
#198792 - 2010-06-07 09:10 PM Re: Enumerate Installed Software [Re: NTDOC]
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
I always use uninstall key name + display name if present
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#198796 - 2010-06-08 10:46 AM Re: Enumerate Installed Software [Re: Kdyer]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
 Originally Posted By: Kdyer
 Originally Posted By: Richard H.

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.


Actually, it does mean: GUID \:D

http://en.wikipedia.org/wiki/GUID

HTH,

Kent


See, now that's a challenge and I've got to up-pedant your pedancy ;\)

Actually it quite deliberately *doesn't* mean anything. The point being that the key should be abstract and not risk a namespace clash. You can't look at a GUID and infer anything from it. If it was created with meaning then there is a risk that someone else who wanted a key with the same meaning would cause a clash.

GUID is what it is, not what it means.

Thanks for the link though, I was too lazy to go and find one.

Top
#198808 - 2010-06-09 12:54 AM Re: Enumerate Installed Software [Re: Mark Pietersz]
NTDOC Administrator Offline
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
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1067 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.058 seconds in which 0.025 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org