|
|
@ -13,6 +13,7 @@ namespace MediaBrowser.Uninstaller.Execute
|
|
|
|
public partial class MainWindow : Window
|
|
|
|
public partial class MainWindow : Window
|
|
|
|
{
|
|
|
|
{
|
|
|
|
protected string Product = "Server";
|
|
|
|
protected string Product = "Server";
|
|
|
|
|
|
|
|
protected string RootSuffix = "-Server";
|
|
|
|
|
|
|
|
|
|
|
|
public MainWindow()
|
|
|
|
public MainWindow()
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -27,10 +28,12 @@ namespace MediaBrowser.Uninstaller.Execute
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case "server":
|
|
|
|
case "server":
|
|
|
|
Product = "Server";
|
|
|
|
Product = "Server";
|
|
|
|
|
|
|
|
RootSuffix = "-Server";
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case "mbt":
|
|
|
|
case "mbt":
|
|
|
|
Product = "Theater";
|
|
|
|
Product = "Theater";
|
|
|
|
|
|
|
|
RootSuffix = "-UI";
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
@ -93,10 +96,42 @@ namespace MediaBrowser.Uninstaller.Execute
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var rootPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "MediaBrowser" + RootSuffix);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (cbxRemoveAll.IsChecked == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// Just remove our whole directory
|
|
|
|
|
|
|
|
RemovePath(rootPath);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// First remove the system
|
|
|
|
|
|
|
|
lblHeading.Content = "Removing System Files...";
|
|
|
|
|
|
|
|
RemovePath(Path.Combine(rootPath, "System"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// And then the others specified
|
|
|
|
|
|
|
|
if (cbxRemoveCache.IsChecked == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
lblHeading.Content = "Removing Cache and Data Files...";
|
|
|
|
|
|
|
|
RemovePath(Path.Combine(rootPath, "cache"));
|
|
|
|
|
|
|
|
RemovePath(Path.Combine(rootPath, "data"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cbxRemoveConfig.IsChecked == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
lblHeading.Content = "Removing Config Files...";
|
|
|
|
|
|
|
|
RemovePath(Path.Combine(rootPath, "config"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cbxRemovePlugins.IsChecked == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
lblHeading.Content = "Removing Plugin Files...";
|
|
|
|
|
|
|
|
RemovePath(Path.Combine(rootPath, "plugins"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// and done
|
|
|
|
// and done
|
|
|
|
lblHeading.Content = string.Format("Media Browser {0} Uninstalled.", Product);
|
|
|
|
lblHeading.Content = string.Format("Media Browser {0} Uninstalled.", Product);
|
|
|
|
btnUninstall.Content = "Finish";
|
|
|
|
btnUninstall.Visibility = Visibility.Hidden;
|
|
|
|
|
|
|
|
btnFinished.Visibility = Visibility.Visible;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static void RemoveShortcut(string path)
|
|
|
|
private static void RemoveShortcut(string path)
|
|
|
@ -114,5 +149,26 @@ namespace MediaBrowser.Uninstaller.Execute
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static void RemovePath(string path)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Directory.Delete(path, true);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (DirectoryNotFoundException)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
MessageBox.Show(string.Format("Error attempting to remove progam folder {0}\n\n {1}", path, ex.Message), "Error");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void BtnFinished_OnClick(object sender, RoutedEventArgs e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Close();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|