Jump to content
Sign in to follow this  

Detection of program

Recommended Posts


It is possible to detect if a program is installed ?

for example: thunderbird

Sorry for my bad English, I'm French.

Thank you

Share this post

Link to post
Share on other sites

Sure, try this

; Enter Displayname as parameter
$result = _UninstallEntry('AutoIt v3.2.0.1', 1)
If Not @error Then
    MsgBox(0, '', $result)
;~  RunWait($result)

Func _UninstallEntry($displayname, $value = 0)
    Local $key_main = 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'
    Local $i, $key_main, $key_result, $key_sub, $version, $size = StringLen($displayname)
    Switch $value
        Case 1
            $value = 'UninstallString'
        Case 2
            $value = 'QuietUninstallString'
        Case 3
            $value = 'DisplayVersion'
        Case Else
            $value = ''
    For $i = 1 To 1000
        $key_sub = RegEnumKey($key_main, $i)
        If @error Then ExitLoop
        If StringLeft(RegRead($key_main & '\' & $key_sub, 'DisplayName'), $size) = $displayname Then
            $data = RegRead($key_main & '\' & $key_sub, $value)
            If $value = '' Then Return 'Installed'
            If $data = '' Or @error Then ContinueLoop
            Return $data


Edited by MHz

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...