Sign in to follow this  
Followers 0
lyledg

Writing a custom uninstaller

2 posts in this topic

#1 ·  Posted (edited)

I am trying to enumerate a HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ and everything below this key, and the look for the uninstall strings of each app..

Problem with RegRead ( "keyname", "valuename" ), is that it needs a valuename, and since I am only looking for ALL Keyname's below the \Uninstall, I am not sure how to go about this?

Is this possible to do?

Thanks in advance..

B)

Edited by lyledg

Share this post


Link to post
Share on other sites



You'll want to take a look at RegEnumKey():

Local $I = 1
Local $Programs = ''

Local Const $REG_PATH = 'HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall'

While True
    Local $KeyName = RegEnumKey($REG_PATH, $I)
    If @Error Then ExitLoop
    Local $Name = RegRead($REG_PATH & '\' & $KeyName, 'DisplayName')
    If $Name <> '' Then $Programs &= $Name & @CRLF
    $I += 1
WEnd

MsgBox(0x40, 'Uninstallable Software', $Programs)

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