By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,285 Members | 1,248 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,285 IT Pros & Developers. It's quick & easy.

Delete registry key on uninstall

P: n/a
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\Ni sh")

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?
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

Nov 21 '05 #2

P: n/a
mo************@egdsc.microsoft.com (Mohamoss) wrote in message news:<jt*************@cpmsftngxa06.phx.gbl>...
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?
Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.