diff --git a/ZuneModCore/Mods/VideoSyncMod.cs b/ZuneModCore/Mods/VideoSyncMod.cs index 629df66..8b86c01 100644 --- a/ZuneModCore/Mods/VideoSyncMod.cs +++ b/ZuneModCore/Mods/VideoSyncMod.cs @@ -46,10 +46,17 @@ namespace ZuneModCore.Mods public override Task Reset() { - // Copy backup to application folder - File.Copy(Path.Combine(StorageDirectory, "WMVCORE.original.dll"), WMVCORE_PATH, true); + try + { + // Copy backup to application folder + File.Copy(Path.Combine(StorageDirectory, "WMVCORE.original.dll"), WMVCORE_PATH, true); - return Task.FromResult(null); + return Task.FromResult(null); + } + catch (Exception ex) + { + return Task.FromResult(ex.Message)!; + } } public override IReadOnlyList? DependentMods => null; diff --git a/ZuneModCore/Mods/WebservicesMod.cs b/ZuneModCore/Mods/WebservicesMod.cs index 521fab0..aec62ad 100644 --- a/ZuneModCore/Mods/WebservicesMod.cs +++ b/ZuneModCore/Mods/WebservicesMod.cs @@ -80,9 +80,9 @@ namespace ZuneModCore.Mods return Task.FromResult(null); } - catch (UnauthorizedAccessException) + catch (IOException) { - return Task.FromResult($"Failed to open '{zsDllInfo.FullName}'. Verify that the Zune software is not running and try again."); + return Task.FromResult($"Unable to replace '{zsDllInfo.FullName}'. Verify that the Zune software is not running and try again."); } catch (Exception ex) { @@ -92,21 +92,33 @@ namespace ZuneModCore.Mods public override Task Reset() { - // Copy backup to application folder - File.Copy(Path.Combine(StorageDirectory, "ZuneService.original.dll"), Path.Combine(ZuneInstallDir, "ZuneService.dll"), true); + string zsDllPath = Path.Combine(ZuneInstallDir, "ZuneService.dll"); + try + { + // Copy backup to application folder + File.Copy(Path.Combine(StorageDirectory, "ZuneService.original.dll"), zsDllPath, true); - // Disable all feature overrides affected by new servers - SetFeatureOverride("Apps", false); - SetFeatureOverride("Channels", false); - SetFeatureOverride("Games", false); - SetFeatureOverride("Marketplace", false); - SetFeatureOverride("Music", false); - SetFeatureOverride("MusicVideos", false); - SetFeatureOverride("Podcasts", false); - SetFeatureOverride("Social", false); - SetFeatureOverride("Videos", false); + // Disable all feature overrides affected by new servers + SetFeatureOverride("Apps", false); + SetFeatureOverride("Channels", false); + SetFeatureOverride("Games", false); + SetFeatureOverride("Marketplace", false); + SetFeatureOverride("Music", false); + SetFeatureOverride("MusicVideos", false); + SetFeatureOverride("Podcasts", false); + SetFeatureOverride("Social", false); + SetFeatureOverride("Videos", false); - return Task.FromResult(null); + return Task.FromResult(null); + } + catch (IOException) + { + return Task.FromResult($"Unable to replace '{zsDllPath}'. Verify that the Zune software is not running and try again."); + } + catch (Exception ex) + { + return Task.FromResult(ex.Message); + } } } } diff --git a/ZuneModCore/RegEdit.cs b/ZuneModCore/RegEdit.cs index cf2cb6a..11b9677 100644 --- a/ZuneModCore/RegEdit.cs +++ b/ZuneModCore/RegEdit.cs @@ -55,7 +55,7 @@ namespace ZuneModCore if (regKey == null) return; - regKey.DeleteValue(name); + regKey.DeleteValue(name, false); } } diff --git a/ZuneModdingHelper/MainWindow.xaml b/ZuneModdingHelper/MainWindow.xaml index 5d385fd..d864773 100644 --- a/ZuneModdingHelper/MainWindow.xaml +++ b/ZuneModdingHelper/MainWindow.xaml @@ -24,9 +24,18 @@ + + + + - + + +