aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Installer/MainWindow.xaml.cs
diff options
context:
space:
mode:
authorEric Reed <ebr@mediabrowser3.com>2013-04-06 12:40:04 -0400
committerEric Reed <ebr@mediabrowser3.com>2013-04-06 12:40:04 -0400
commitd05f4d71d2c250d9c9df23aa1e4a1294e1d76a8a (patch)
tree27b2bb187d42df4dafc4774103d5b21a158061c6 /MediaBrowser.Installer/MainWindow.xaml.cs
parent2a9e59e6232b7e04cf984c80547beaf130562c0b (diff)
Attempt to create Uninstall reg key if not there
Diffstat (limited to 'MediaBrowser.Installer/MainWindow.xaml.cs')
-rw-r--r--MediaBrowser.Installer/MainWindow.xaml.cs19
1 files changed, 14 insertions, 5 deletions
diff --git a/MediaBrowser.Installer/MainWindow.xaml.cs b/MediaBrowser.Installer/MainWindow.xaml.cs
index a7f6f5b34..0a30cc6a2 100644
--- a/MediaBrowser.Installer/MainWindow.xaml.cs
+++ b/MediaBrowser.Installer/MainWindow.xaml.cs
@@ -475,13 +475,22 @@ namespace MediaBrowser.Installer
/// <param name="targetExe"></param>
private void CreateUninstaller(string uninstallPath, string targetExe)
{
- using (var parent = Registry.CurrentUser.OpenSubKey(
- @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", true))
+ var parent = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", true);
{
if (parent == null)
{
- MessageBox.Show("Uninstall registry key not found.");
- return;
+ var rootParent = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion", true);
+ {
+ if (rootParent != null)
+ {
+ parent = rootParent.CreateSubKey("Uninstall");
+ if (parent == null)
+ {
+ MessageBox.Show("Unable to create Uninstall registry key. Program is still installed sucessfully.");
+ return;
+ }
+ }
+ }
}
try
{
@@ -495,7 +504,7 @@ namespace MediaBrowser.Installer
if (key == null)
{
- MessageBox.Show(String.Format("Unable to create uninstaller entry'{0}\\{1}'", @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", guidText));
+ MessageBox.Show(String.Format("Unable to create uninstaller entry'{0}\\{1}'. Program is still installed successfully.", @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", guidText));
return;
}