Jump to content

How can I obtain a list of installed software


 Share

Recommended Posts

Hi everyone,

I'm currently trying to figure out how I can obtain a list of installed software on my computer and output to a text file.

Does anyone know where I could obtain this information?.

I'm thinking I may be able to create a script to obtain this from the registry?

thanks

regards,

Jon Bennett

Link to comment
Share on other sites

This is to get you start it:

_SoftwareList() return a two dimensional array with all installed software name and version.

_SoftwareList('Microsoft Office Professional Edition 2003') return a two dimensional array with the software name and version if Office 2003 is installed otherwise return NULL.

#include <Array.au3>

$oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")

$List = _SoftwareList()
_ArrayDisplay($List)

$List = _SoftwareList('Microsoft Office Professional Edition 200')
_ArrayDisplay($List)

Func _SoftwareList($sSoftwareName = '')
    Dim $aSoftwareList[1][2]
    $objInstaller = ObjCreate('WindowsInstaller.Installer')

    $Products = $objInstaller.Products
    For $Product In $Products
        If $sSoftwareName <> '' And $sSoftwareName <> $objInstaller.ProductInfo($Product, 'ProductName') Then ContinueLoop
        ReDim $aSoftwareList[UBound($aSoftwareList) + 1][2]
        $aSoftwareList[UBound($aSoftwareList) - 1][0] = $objInstaller.ProductInfo($Product, 'ProductName')
        $aSoftwareList[UBound($aSoftwareList) - 1][1] = $objInstaller.ProductInfo($Product, 'VersionString')
    Next
    $aSoftwareList[0][0] = UBound($aSoftwareList) - 1
    If $aSoftwareList[0][0] = 0 Then $aSoftwareList = ''
    Return ($aSoftwareList)
EndFunc  ;==>_SoftwareList

Func MyErrFunc()
    $HexNumber = Hex($oMyError.number, 8)
    ConsoleWrite("We intercepted a COM Error !" & @CRLF & _
            "Number is: " & $HexNumber & @CRLF & _
            "Windescription is: " & $oMyError.windescription)

    SetError(1); something to check for when this function returns
EndFunc  ;==>MyErrFunc
AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...