Delete registry key on uninstall

G

gillcleeren

Hi,

I need to make a setup program for a project.
The project itself creates some registry values. The setup project
however should delete these values. Therefore I wrote a little
executable which I run as Custom Action on the uninstall node.

The code for this "uninstaller-exe" is the following:

<STAThread()> _
Shared Sub Main()


RemoveWeatherRegistryKeys()

End Sub

Shared Sub RemoveWeatherRegistryKeys()

Dim regKey As RegistryKey

Try

Registry.CurrentUser.DeleteSubKeyTree("Software\Nish")

Catch ex As Exception

MessageBox.Show("error: " & ex.Message, "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error)

End Try

End Sub


However, after uninstalling, the values remain in the registry...
Am I doing something wrong here? Or is there a far better way of doing
this?
 
G

gillcleeren

Hi
Did you try your code outside of the installer to check if works? Here
you are a sample application with source code that deletes registry keys
sub nodes hope it helps
http://www.codeproject.com/vb/net/registry_with_vb.asp

Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Yes, I tried that. Then the code works fine :(. But when in the
installer, it doesn't seem to run.

Is there any other way I can test if the MSI installer actually
executes the code?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top