mtmartis Posted July 23, 2010 Share Posted July 23, 2010 I need to search for a particular uninstall value in HKLM\Software\Microsoft\Windows\Currentversion\Uninstall since the subkey under \Uninstall are mainly GUIDs. I can't just unin I guess I would have to run a loop to enumerate all Keys under \Uninstall then for each of those, run another loop to enumerate all the values , then search all the values for the program I am looking for, once it's found it, it would report back the value I needed. I have attached an image to better explain my goal. So in starting, I figured I would try enumerating all subkeys, then all values in the subkeys... For $a= 1 to 10 $MainKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CurrentVersion\Uninstall\" $var1 = RegEnumKey($MainKey, $a) If @error <> 0 then ExitLoop MsgBox(4096, "SubKey #" & $a & " under HKLM\Software\Test: ", $var1) For $b= 1 to 10 $var2 = RegEnumVal($MainKey & "\" & $a, $b) If @error <> 0 then ExitLoop MsgBox(4096, "Value #" & $b & " under" & $var1, $var2) Next Next The first loop runs, but the second does not. I am not sure if I need to read the values into an array first? Or perhaps I for each subkey the first loop goes through, do a String in String? Anyone able to point me in the right direction of which command I should use? Yes, I do know your question if I am a newb was rhetorical Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 23, 2010 Moderators Share Posted July 23, 2010 mtmartis,As you apparently did not notice the sign above which says:This is not a general support forum! I have asked for this to be transferred. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Pottery Posted July 23, 2010 Share Posted July 23, 2010 For $a= 1 to 10 $MainKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CurrentVersion\Uninstall\" $var1 = RegEnumKey($MainKey, $a) If @error <> 0 then ExitLoop MsgBox(4096, "SubKey #" & $a & " under HKLM\Software\Test: ", $var1) $b = 10 Do $var2 = RegEnumVal($MainKey & "\" & $a, $b) If @error <> 0 then ExitLoop MsgBox(4096, "Value #" & $b & " under" & $var1, $var2) $b += 1 Until $b = 10 Next Link to comment Share on other sites More sharing options...
SKlocke Posted July 26, 2010 Share Posted July 26, 2010 Do the key names really change with each installation of the program? I was thinking that these GUIDs are fixed for a given program (InstallShield calculating some hash value..? But then, what about the next patch of that program, still same GUID?) If they were fixed, you could read the key, and compare DisplayName against the program name you expect there to be. 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