Zinthose Posted August 7, 2008 Share Posted August 7, 2008 I through this together for searching for AddRemove Programs using the registry."Yo! U Code Noob! Just use WMI!!"I agree however, Windows XP x64 do not install the "WMI Windows Installer Provider" by default. Thus, WMI = No Work-ieexpandcollapse popup;#include <AddRemove.au3> Const $SearchFor_1 = "AutoIt v3" Const $SearchFor_2 = "Kings Quest 8" MsgBox(0, "Search Results", "Search for '" & $SearchFor_1 & "' AddRemove Programs entry result: " & @CRLF & _IsInstalled($SearchFor_1)) MsgBox(0, "Search Results", "Search for '" & $SearchFor_2 & "' AddRemove Programs entry result: " & @CRLF & _IsInstalled($SearchFor_2)) #Region #include <AddRemove.au3> #include-once Func _IsInstalled($DisplayName) Local $i = 1 If @AutoItX64 Then; Adjust for x64 process Local $RegPath = "\Microsoft\Windows\CurrentVersion\Uninstall" Local $RegRoot86 = "HKLM\SOFTWARE\Wow6432Node" Local $RegRoot64 = "HKLM64\SOFTWARE" Else; Adjust for x86 process Local $RegPath = "\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" Local $RegRoot86 = "HKLM" Local $RegRoot64 = "HKLM64" EndIf $IsSoftwareFound = __RegBranchSearch($RegRoot86 & $RegPath, 'DisplayName', $DisplayName); <== Search the 32 bit registry If $IsSoftwareFound Then Return True If @ProcessorArch = "X86" Then Return False; <== We are done if OS Arch is x86 ;## If we are here then the current OS Arch is 64 bit and the script is running as a 32 bit process. $IsSoftwareFound = __RegBranchSearch($RegRoot64 & $RegPath, 'DisplayName', $DisplayName); <== Search the 64 bit registry If $IsSoftwareFound Then Return True Return False EndFunc ;==>_IsInstalled #Region Internal Use Only Func __RegBranchSearch($RegPath, $RegName, $RegValue) Local $RegKey, $ThisRegValue Local $i = 1 Do $RegKey = RegEnumKey($RegPath, $i) If @error <> 0 Then ExitLoop $ThisRegValue = RegRead($RegPath & '\' & $RegKey, $RegName) If StringInStr($ThisRegValue, $RegValue) <> 0 Then Return True $i += 1 Until @error <> 0 Return False EndFunc #EndRegion Internal Use Only #EndRegion #include <AddRemove.au3>Enjoy --- TTFN Link to comment Share on other sites More sharing options...
monoceres Posted August 7, 2008 Share Posted August 7, 2008 Hi! I tested your function in my VM with WinXP Pro x64 and it worked, so now you know it supports x64 Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Zinthose Posted August 7, 2008 Author Share Posted August 7, 2008 Hi!I tested your function in my VM with WinXP Pro x64 and it worked, so now you know it supports x64 Wonderful! I think I'll have a cookie! --- TTFN Link to comment Share on other sites More sharing options...
jitendra Posted September 22, 2009 Share Posted September 22, 2009 I am looking for a script to select an application in Add/Remove programs and clicking uninstall!!! Any body please help me Link to comment Share on other sites More sharing options...
FireFox Posted September 23, 2009 Share Posted September 23, 2009 (edited) I am looking for a script to select an application in Add/Remove programs and clicking uninstall!!! Any body please help me Hi, search the right key in this path : HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\ Then you have just to read this value name : UninstallString (with RegRead func) and you have the uninstall program Edit : btw, post this kind of questions in the general help & support forum, thank you. Cheers, FireFox. Edited September 23, 2009 by FireFox Link to comment Share on other sites More sharing options...
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