Jump to content

Writing a custom uninstaller


Recommended Posts

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
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)
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...