|
|
One of the more common requests I receive regarding Windows Installer-based applications is about inventorying the applications and features installed on users' computers. If you have a software management infrastructure already in place, you should use the tools that it provides. Otherwise, Microsoft's TechNet Script Center (www.microsoft.com/technet/scriptcenter), which contains an awesome collection of useful scripts, has a few scripts that suit the purpose very well.
Listing 11-1 is a script that inventories the software installed on a computer. Listing 11-2 is a script that inventories the features for all software installed on a computer. These inventory only Windows Installer-based applications though. Using Notepad, type each script and save it as a text file with the .vbs extension. To run each script, double-click the file.
Listing 11-1: Inventory.vbs
Set objFSO = CreateObject("Scripting.FileSystemObject") Set objTextFile = objFSO.CreateTextFile("c:\scripts\software.tsv", True) strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colSoftware = objWMIService.ExecQuery _ ("Select * from Win32_Product") objTextFile.WriteLine "Caption" & vbtab & _ "Description" & vbtab & "Identifying Number" & vbtab & _ "Install Date" & vbtab & "Install Location" & vbtab & _ "Install State" & vbtab & "Name" & vbtab & _ "Package Cache" & vbtab & "SKU Number" & vbtab & "Vendor" & vbtab _ & "Version" For Each objSoftware in colSoftware objTextFile.WriteLine objSoftware.Caption & vbtab & _ objSoftware.Description & vbtab & _ objSoftware.IdentifyingNumber & vbtab & _ objSoftware.InstallDate2 & vbtab & _ objSoftware.InstallLocation & vbtab & _ objSoftware.InstallState & vbtab & _ objSoftware.Name & vbtab & _ objSoftware.PackageCache & vbtab & _ objSoftware.SKUNumber & vbtab & _ objSoftware.Vendor & vbtab & _ objSoftware.Version Next objTextFile.Close
Listing 11-2: Software.vbs
strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colFeatures = objWMIService.ExecQuery _ ("Select * from Win32_SoftwareFeature") For each objFeature in colfeatures Wscript.Echo "Accesses: " & objFeature.Accesses Wscript.Echo "Attributes: " & objFeature.Attributes Wscript.Echo "Caption: " & objFeature.Caption Wscript.Echo "Description: " & objFeature.Description Wscript.Echo "Identifying Number: " & objFeature.IdentifyingNumber Wscript.Echo "Install Date: " & objFeature.InstallDate Wscript.Echo "Install State: " & objFeature.InstallState Wscript.Echo "LastUse: " & objFeature.LastUse Wscript.Echo "Name: " & objFeature.Name Wscript.Echo "ProductName: " & objFeature.ProductName Wscript.Echo "Vendor: " & objFeature.Vendor Wscript.Echo "Version: " & objFeature.Version Next
After inventorying Windows Installer-based applications, the next most common request I receive is about updating an application's source list. When you deploy a Windows Installer-based application, you specify a list of alternative locations from which Windows Installer can install files. This supports multiple installation locations from a single set of configuration files. If you deployed an application with an incorrect source list or moved your administration installations, you must update the source lists on each client computer.
With earlier versions of Windows Installer, updating source lists was a difficult task. You had to deploy a registry hack. With the current versions, you can use Custom Maintenance Wizard to deploy an updated source list. This is a far more elegant solution than deploying a registry hack. Chapter 14, "Deploying Office XP Settings," tells you more about using Custom Maintenance Wizard.
|
|