Sign in to follow this  
Followers 0
sarita

Recognize softwares which installed on PC

3 posts in this topic

Hi,

Does anyone knows how can i recognize which softwares are installed on specific PC?

I would like to preset it to the user in GUI.

Thanks,

sarita

Share this post


Link to post
Share on other sites



$SoftwareList = _SoftwareInventory()
_ArrayDisplay($SoftwareList)

$SoftwareList = _SoftwareInventory('AutoIt v3.3.0.0')
If Not @error Then _ArrayDisplay($SoftwareList)

Func _SoftwareInventory($sFindSoftwareName = '', $sComputer = '')
    Local $iCount = 0

    If $sComputer <> '' Then $sComputer = '\\' & StringReplace($sComputer, '\', '') & '\'
    Local Const $sRegUnistallKey = $sComputer & 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'

    While 1
        $iCount += 1
        $sKey = RegEnumKey($sRegUnistallKey, $iCount)
        If @error <> 0 Then ExitLoop
        $sDisplayName = StringReplace(RegRead($sRegUnistallKey & '\' & $sKey, 'Displayname'), ' (remove only)', '')
        $iDisplayVersion = RegRead($sRegUnistallKey & '\' & $sKey, 'DisplayVersion')

        If $sDisplayName <> '' Then
            If $sFindSoftwareName <> '' And StringInStr($sDisplayName, $sFindSoftwareName) = 0 Then ContinueLoop
            If Not IsDeclared('aSoftwareList') Then Dim $aSoftwareList[1][2]
            ReDim $aSoftwareList[UBound($aSoftwareList) + 1][2]
            $aSoftwareList[UBound($aSoftwareList) - 1][0] = $sDisplayName 
            $aSoftwareList[UBound($aSoftwareList) - 1][1] = $iDisplayVersion
        EndIf      
    WEnd

    If Not IsDeclared('aSoftwareList') Or Not IsArray($aSoftwareList) Then
        Return (SetError(1, 0, ''))
    Else
        $aSoftwareList[0][0] = UBound($aSoftwareList) - 1
        Return (SetError(0, 0, $aSoftwareList))
    EndIf
EndFunc   ;==>_SoftwareInventory


AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

Share this post


Link to post
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
Sign in to follow this  
Followers 0