Listing installed applications on Vista 64-bit with WMI

Monday, 5 March 2007

There's a few sample scripts around to list the installed applications using WMI. The trap on 64-bit platforms is that the 32-bit and 64-bit installation information is stored in different places in the registry, and you need to be clever about telling WMI that you want the 32-bit data instead of the 64-bit.

Here's some VBScript that will list first the 32-bit and then 64-bit installed applications:

strComputer = "."
Const HKLM = &h80000002
Set objCtx = CreateObject("WbemScripting.SWbemNamedValueSet")
objCtx.Add "__ProviderArchitecture", 32
objCtx.Add "__RequiredArchitecture", TRUE
Set objLocator = CreateObject("Wbemscripting.SWbemLocator")
Set objServices = objLocator.ConnectServer("","root\default","","",,,,objCtx)
Set objStdRegProv = objServices.Get("StdRegProv")

WScript.Echo "32-bit Applications"
WScript.echo "-------------------"

Call GetApplications

objCtx.Add "__ProviderArchitecture", 64
objCtx.Add "__RequiredArchitecture", TRUE
Set objLocator = CreateObject("Wbemscripting.SWbemLocator")
Set objServices = objLocator.ConnectServer("","root\default","","",,,,objCtx)
Set objStdRegProv = objServices.Get("StdRegProv")

WScript.Echo "64-bit Applications"
WScript.echo "-------------------"

Call GetApplications

Sub GetApplications

' Use ExecMethod to call the GetStringValue method
Set Inparams = objStdRegProv.Methods_("EnumKey").Inparameters
Inparams.Hdefkey = HKLM
Inparams.Ssubkeyname = "Software\Microsoft\Windows\CurrentVersion\Uninstall\"

set Outparams = objStdRegProv.ExecMethod_("EnumKey", Inparams,,objCtx)

For Each strSubKey In Outparams.snames

Set Inparams = objStdRegProv.Methods_("GetStringValue").Inparameters
Inparams.Hdefkey = HKLM
Inparams.Ssubkeyname = "Software\Microsoft\Windows\CurrentVersion\Uninstall\" & strSubKey
Inparams.Svaluename = "DisplayName"
set Outparams = objStdRegProv.ExecMethod_("GetStringValue", Inparams,,objCtx)

if ("" & Outparams.sValue) = "" then
'wscript.echo strSubKey
Else
wscript.echo Outparams.SValue
End iF

'Inparams.Svaluename = "QuietDisplayName"
'set Outparams = objStdRegProv.ExecMethod_("GetStringValue", Inparams,,objCtx)
'wscript.echo Outparams.SValue

Next

End Sub

Oracle Databases on Windows Vista

Monday, 5 March 2007

Vista got released in November last year, and I've now come across the first "big" application that doesn't currently run on Vista.

Oracle will support Windows Vista but most likely not completely until the second half of 2007!

I would have thought a company the size of Oracle could dedicate a few resources to running their stuff on the beta releases of Vista, so that it wouldn't be such a big step to get it all working.

At least I don't do much Oracle stuff, but it does happen occasionally (like today), where it is a problem.

Windows Vista on ABC Adelaide Weekends

Monday, 5 March 2007

Who was that "David from Aberfoyle Park" who rang in last weekend to talk about his experiences using Windows Vista? 

How do I run FxCop during a post-build event?

Monday, 5 March 2007

Ha! Not only did my post to the FxCop forum turn out to reveal a bug in MsBuild, but David M. Kean referenced my fix in a posting to the The Visual Studio Code Analysis Team Blog

Visual Studio Code Name "Orcas" March 2007 CTP

Thursday, 1 March 2007

What was going to be the February CTP is now out, as the March CTP of the next version of Visual Studio.NET

This is the version that should have the latest working version of LINQ for SQL.