From ff2ef0fd462d802aca664e519ebf2a63c181a10d Mon Sep 17 00:00:00 2001 From: Chris Kaczor Date: Mon, 2 Nov 2015 20:11:35 -0500 Subject: [PATCH] Update for "Set Program Access and Defaults" support --- Application/App.xaml.cs | 3 +- .../Options/GeneralOptionsPanel.xaml.cs | 4 +- Application/SystemConfiguration.cs | 3 +- Setup/Product.wxs | 332 ++++++++++-------- 4 files changed, 194 insertions(+), 148 deletions(-) diff --git a/Application/App.xaml.cs b/Application/App.xaml.cs index 2d54d6a..72e5216 100644 --- a/Application/App.xaml.cs +++ b/Application/App.xaml.cs @@ -87,7 +87,8 @@ namespace FeedCenter Current.SetStartWithWindows(Settings.Default.StartWithWindows); // Set whether we should be the default feed reader - SystemConfiguration.SetDefaultFeedReader(Settings.Default.RegisterAsDefaultFeedReader); + if (Settings.Default.RegisterAsDefaultFeedReader) + SystemConfiguration.SetDefaultFeedReader(); // Initialize the window mainWindow.Initialize(); diff --git a/Application/Options/GeneralOptionsPanel.xaml.cs b/Application/Options/GeneralOptionsPanel.xaml.cs index 2f60a79..b848c28 100644 --- a/Application/Options/GeneralOptionsPanel.xaml.cs +++ b/Application/Options/GeneralOptionsPanel.xaml.cs @@ -36,7 +36,9 @@ namespace FeedCenter.Options settings.RegisterAsDefaultFeedReader = registerAsDefaultFeedReaderCheckBox.IsChecked.Value; Application.Current.SetStartWithWindows(settings.StartWithWindows); - SystemConfiguration.SetDefaultFeedReader(settings.RegisterAsDefaultFeedReader); + + if (settings.RegisterAsDefaultFeedReader) + SystemConfiguration.SetDefaultFeedReader(); } public override string CategoryName diff --git a/Application/SystemConfiguration.cs b/Application/SystemConfiguration.cs index 8ca958e..1292a56 100644 --- a/Application/SystemConfiguration.cs +++ b/Application/SystemConfiguration.cs @@ -4,12 +4,13 @@ using System; using System.IO; using System.Reflection; using System.Windows; +using FeedCenter.Properties; namespace FeedCenter { public static class SystemConfiguration { - public static void SetDefaultFeedReader(bool value) + public static void SetDefaultFeedReader() { // Get the location of the assembly var assemblyLocation = Assembly.GetEntryAssembly().Location; diff --git a/Setup/Product.wxs b/Setup/Product.wxs index a0c2d5a..6032891 100644 --- a/Setup/Product.wxs +++ b/Setup/Product.wxs @@ -1,173 +1,215 @@ - - - + xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension" + xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"> + + + + + + + - - + - + - + - + + + + - - - - + + - - + + + - - - + + + + + + + + + + + + - - - - - - - - - - - - + + + - - - + - + + + + + + - - - - - - + + + - - - + - + + + + + + - - - - - - + + + - - - + + + + + + + - + - - - + + + - + + + - - - + - - + + + - - + + - - - + + - + + + - + - - - - + + + + + + \ No newline at end of file