diff options
| author | LukePulverenti <luke.pulverenti@gmail.com> | 2013-03-11 12:55:00 -0400 |
|---|---|---|
| committer | LukePulverenti <luke.pulverenti@gmail.com> | 2013-03-11 12:55:00 -0400 |
| commit | 61b5f66f20f1e62c09442c0758c55f6a630526db (patch) | |
| tree | a678c851c2a5b24582e52641092d11f5068bb233 /MediaBrowser.Uninstaller.Execute/MainWindow.xaml.cs | |
| parent | fe91772f18dada23d9f1b28d3816a30d0f21448b (diff) | |
| parent | f8261ebdb5be9ff6c69ee88a0303f4d09846b307 (diff) | |
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.Uninstaller.Execute/MainWindow.xaml.cs')
| -rw-r--r-- | MediaBrowser.Uninstaller.Execute/MainWindow.xaml.cs | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/MediaBrowser.Uninstaller.Execute/MainWindow.xaml.cs b/MediaBrowser.Uninstaller.Execute/MainWindow.xaml.cs index 4e2e80787..7b1983d53 100644 --- a/MediaBrowser.Uninstaller.Execute/MainWindow.xaml.cs +++ b/MediaBrowser.Uninstaller.Execute/MainWindow.xaml.cs @@ -1,7 +1,7 @@ using System; using System.Diagnostics; using System.Net; -using System.Reflection; +using Microsoft.Win32; using System.IO; using System.Threading; using System.Windows; @@ -195,13 +195,43 @@ namespace MediaBrowser.Uninstaller.Execute } } + // Remove reference to us + RemoveUninstall(); + // and done lblHeading.Content = string.Format("Media Browser {0} Uninstalled.", Product); btnUninstall.Visibility = Visibility.Hidden; btnFinished.Visibility = Visibility.Visible; } - private static void RemoveShortcut(string path) + private void RemoveUninstall() + { + + using (var parent = Registry.LocalMachine.OpenSubKey( + @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", true)) + { + if (parent == null) + { + MessageBox.Show("Uninstall registry key not found."); + return; + } + try + { + const string guidText = "{4E76DB4E-1BB9-4A7B-860C-7940779CF7A0}"; + parent.DeleteSubKey(guidText,false); + + } + catch (Exception ex) + { + throw new Exception( + "An error occurred removing uninstall information from the registry.", + ex); + } + } + } + + private static + void RemoveShortcut(string path) { try { |
