jul Posted December 1, 2006 Posted December 1, 2006 Hello, It is possible to detect if a program is installed ? for example: thunderbird Sorry for my bad English, I'm French. Thank you
MHz Posted December 1, 2006 Posted December 1, 2006 (edited) Sure, try this ; Enter Displayname as parameter $result = _UninstallEntry('AutoIt v3.2.0.1', 1) If Not @error Then MsgBox(0, '', $result) ;~ RunWait($result) EndIf 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 = '' EndSwitch 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 EndIf Next SetError(1) Return EndFunc Edited December 1, 2006 by MHz
xcal Posted December 1, 2006 Posted December 1, 2006 (edited) Not as thorough as the above, but... $find = 'Thunderbird' $i = 0 While 1 $i += 1 $var = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE", $i) If @error Then ExitLoop If StringInStr($var, $find) Then MsgBox(4096, 'Found', $find & ' is installed.') WEnd Edited December 1, 2006 by xcal How To Ask Questions The Smart Way
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now