Update for "Set Program Access and Defaults" support

This commit is contained in:
2015-11-02 20:11:35 -05:00
parent f7dddff14d
commit ff2ef0fd46
4 changed files with 194 additions and 148 deletions

View File

@@ -87,7 +87,8 @@ namespace FeedCenter
Current.SetStartWithWindows(Settings.Default.StartWithWindows); Current.SetStartWithWindows(Settings.Default.StartWithWindows);
// Set whether we should be the default feed reader // Set whether we should be the default feed reader
SystemConfiguration.SetDefaultFeedReader(Settings.Default.RegisterAsDefaultFeedReader); if (Settings.Default.RegisterAsDefaultFeedReader)
SystemConfiguration.SetDefaultFeedReader();
// Initialize the window // Initialize the window
mainWindow.Initialize(); mainWindow.Initialize();

View File

@@ -36,7 +36,9 @@ namespace FeedCenter.Options
settings.RegisterAsDefaultFeedReader = registerAsDefaultFeedReaderCheckBox.IsChecked.Value; settings.RegisterAsDefaultFeedReader = registerAsDefaultFeedReaderCheckBox.IsChecked.Value;
Application.Current.SetStartWithWindows(settings.StartWithWindows); Application.Current.SetStartWithWindows(settings.StartWithWindows);
SystemConfiguration.SetDefaultFeedReader(settings.RegisterAsDefaultFeedReader);
if (settings.RegisterAsDefaultFeedReader)
SystemConfiguration.SetDefaultFeedReader();
} }
public override string CategoryName public override string CategoryName

View File

@@ -4,12 +4,13 @@ using System;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
using System.Windows; using System.Windows;
using FeedCenter.Properties;
namespace FeedCenter namespace FeedCenter
{ {
public static class SystemConfiguration public static class SystemConfiguration
{ {
public static void SetDefaultFeedReader(bool value) public static void SetDefaultFeedReader()
{ {
// Get the location of the assembly // Get the location of the assembly
var assemblyLocation = Assembly.GetEntryAssembly().Location; var assemblyLocation = Assembly.GetEntryAssembly().Location;

View File

@@ -1,173 +1,215 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"> xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<?define ProductName="$(fileVersion.ProductName($(var.FeedCenter.TargetPath)))" ?> <?define ProductName="$(fileVersion.ProductName($(var.FeedCenter.TargetPath)))" ?>
<?define CompanyName="$(fileVersion.CompanyName($(var.FeedCenter.TargetPath)))" ?> <?define CompanyName="$(fileVersion.CompanyName($(var.FeedCenter.TargetPath)))" ?>
<?define ProductVersion="$(fileVersion.ProductVersion($(var.FeedCenter.TargetPath)))" ?> <?define ProductVersion="$(fileVersion.ProductVersion($(var.FeedCenter.TargetPath)))" ?>
<?define FileDescription="$(fileVersion.FileDescription($(var.FeedCenter.TargetPath)))" ?>
<Product Id="*" <Product Id="*"
Name="$(var.ProductName)" Name="$(var.ProductName)"
Language="1033" Language="1033"
Version="$(var.ProductVersion)" Version="$(var.ProductVersion)"
Manufacturer="$(var.CompanyName)" Manufacturer="$(var.CompanyName)"
UpgradeCode="47f30e4a-a861-47ac-b82d-35e4b886992a"> UpgradeCode="47f30e4a-a861-47ac-b82d-35e4b886992a">
<Package InstallerVersion="405" <Package InstallerVersion="405"
Compressed="yes" Compressed="yes"
InstallScope="perUser" /> InstallScope="perUser" />
<util:CloseApplication Id="CloseApplication" <util:CloseApplication Id="CloseApplication"
Target="FeedCenter.exe" Target="FeedCenter.exe"
CloseMessage="yes" CloseMessage="yes"
Timeout="5" /> Timeout="5" />
<MajorUpgrade Schedule="afterInstallValidate" <MajorUpgrade Schedule="afterInstallValidate"
AllowDowngrades="no" AllowDowngrades="no"
AllowSameVersionUpgrades="no" AllowSameVersionUpgrades="no"
DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate /> <MediaTemplate />
<Feature Id="ProductFeature" <Feature Id="ProductFeature"
Title="$(var.ProductName)" Title="$(var.ProductName)"
Level="1"> Level="1">
<ComponentGroupRef Id="ProductComponents" /> <ComponentGroupRef Id="ProductComponents" />
</Feature> </Feature>
</Product> </Product>
<Fragment> <Fragment>
<PropertyRef Id="NETFRAMEWORK45"/> <PropertyRef Id="NETFRAMEWORK45"/>
<Condition Message="This application requires version 4.5 of the .NET Framework. Please install the .NET Framework then run this installer again."> <Condition Message="This application requires version 4.5 of the .NET Framework. Please install the .NET Framework then run this installer again.">
<![CDATA[Installed OR NETFRAMEWORK45]]> <![CDATA[Installed OR NETFRAMEWORK45]]>
</Condition> </Condition>
<Directory Id="TARGETDIR" <Directory Id="TARGETDIR"
Name="SourceDir"> Name="SourceDir">
<Directory Id="LocalAppDataFolder"> <Directory Id="LocalAppDataFolder">
<Directory Id="INSTALLFOLDER" <Directory Id="INSTALLFOLDER"
Name="$(var.ProductName)"> Name="$(var.ProductName)">
<Directory Id="SqlServerCe_32" <Directory Id="SqlServerCe_32"
Name="x86" /> Name="x86" />
<Directory Id="SqlServerCe_64" <Directory Id="SqlServerCe_64"
Name="amd64" /> Name="amd64" />
</Directory> </Directory>
</Directory> </Directory>
<Directory Id="ProgramMenuFolder"> <Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" <Directory Id="ApplicationProgramsFolder"
Name="$(var.ProductName)"/> Name="$(var.ProductName)"/>
</Directory> </Directory>
</Directory> </Directory>
</Fragment> </Fragment>
<Fragment> <Fragment>
<ComponentGroup Id="ProductComponents"> <ComponentGroup Id="ProductComponents">
<Component Id="SqlServerCe_32" <Component Id="SqlServerCe_32"
Guid="{800607E9-65ED-489F-83A2-C73AA36A9D1D}" Guid="{800607E9-65ED-489F-83A2-C73AA36A9D1D}"
Directory="SqlServerCe_32"> Directory="SqlServerCe_32">
<RegistryValue Root='HKCU' <RegistryValue Root='HKCU'
Key='Software\Feed Center\Setup' Key='Software\Feed Center\Setup'
Type='integer' Type='integer'
Name='SqlServerCe_32' Name='SqlServerCe_32'
Value='1' Value='1'
KeyPath='yes' /> KeyPath='yes' />
<File Id="sqlceca40_32" <File Id="sqlceca40_32"
Source="$(var.FeedCenter.TargetDir)\x86\sqlceca40.dll" /> Source="$(var.FeedCenter.TargetDir)\x86\sqlceca40.dll" />
<File Id="sqlcecompact40_32" <File Id="sqlcecompact40_32"
Source="$(var.FeedCenter.TargetDir)\x86\sqlcecompact40.dll" /> Source="$(var.FeedCenter.TargetDir)\x86\sqlcecompact40.dll" />
<File Id="sqlceer40EN_32" <File Id="sqlceer40EN_32"
Source="$(var.FeedCenter.TargetDir)\x86\sqlceer40EN.dll" /> Source="$(var.FeedCenter.TargetDir)\x86\sqlceer40EN.dll" />
<File Id="sqlceme40_32" <File Id="sqlceme40_32"
Source="$(var.FeedCenter.TargetDir)\x86\sqlceme40.dll" /> Source="$(var.FeedCenter.TargetDir)\x86\sqlceme40.dll" />
<File Id="sqlceqp40_32" <File Id="sqlceqp40_32"
Source="$(var.FeedCenter.TargetDir)\x86\sqlceqp40.dll" /> Source="$(var.FeedCenter.TargetDir)\x86\sqlceqp40.dll" />
<File Id="sqlcese40_32" <File Id="sqlcese40_32"
Source="$(var.FeedCenter.TargetDir)\x86\sqlcese40.dll" /> Source="$(var.FeedCenter.TargetDir)\x86\sqlcese40.dll" />
<RemoveFolder Id='SqlServerCe_32' <RemoveFolder Id='SqlServerCe_32'
On='uninstall' /> On='uninstall' />
</Component> </Component>
<Component Id="SqlServerCe_64" <Component Id="SqlServerCe_64"
Guid="{67DB1CF4-23F2-4252-896C-714438959C9A}" Guid="{67DB1CF4-23F2-4252-896C-714438959C9A}"
Directory="SqlServerCe_64"> Directory="SqlServerCe_64">
<RegistryValue Root='HKCU' <RegistryValue Root='HKCU'
Key='Software\Feed Center\Setup' Key='Software\Feed Center\Setup'
Type='integer' Type='integer'
Name='SqlServerCe_64' Name='SqlServerCe_64'
Value='1' Value='1'
KeyPath='yes' /> KeyPath='yes' />
<File Id="sqlceca40_64" <File Id="sqlceca40_64"
Source="$(var.FeedCenter.TargetDir)\amd64\sqlceca40.dll" /> Source="$(var.FeedCenter.TargetDir)\amd64\sqlceca40.dll" />
<File Id="sqlcecompact40_64" <File Id="sqlcecompact40_64"
Source="$(var.FeedCenter.TargetDir)\amd64\sqlcecompact40.dll" /> Source="$(var.FeedCenter.TargetDir)\amd64\sqlcecompact40.dll" />
<File Id="sqlceer40EN_64" <File Id="sqlceer40EN_64"
Source="$(var.FeedCenter.TargetDir)\amd64\sqlceer40EN.dll" /> Source="$(var.FeedCenter.TargetDir)\amd64\sqlceer40EN.dll" />
<File Id="sqlceme40_64" <File Id="sqlceme40_64"
Source="$(var.FeedCenter.TargetDir)\amd64\sqlceme40.dll" /> Source="$(var.FeedCenter.TargetDir)\amd64\sqlceme40.dll" />
<File Id="sqlceqp40_64" <File Id="sqlceqp40_64"
Source="$(var.FeedCenter.TargetDir)\amd64\sqlceqp40.dll" /> Source="$(var.FeedCenter.TargetDir)\amd64\sqlceqp40.dll" />
<File Id="sqlcese40_64" <File Id="sqlcese40_64"
Source="$(var.FeedCenter.TargetDir)\amd64\sqlcese40.dll" /> Source="$(var.FeedCenter.TargetDir)\amd64\sqlcese40.dll" />
<RemoveFolder Id='SqlServerCe_64' <RemoveFolder Id='SqlServerCe_64'
On='uninstall' /> On='uninstall' />
</Component> </Component>
<Component Id="FeedCenter" <Component Id="FeedCenter"
Guid="{9B2B9C65-8E68-4F82-9AC5-16EBCAC34B9E}" Guid="{9B2B9C65-8E68-4F82-9AC5-16EBCAC34B9E}"
Directory="INSTALLFOLDER"> Directory="INSTALLFOLDER">
<RegistryValue Root='HKCU' <RegistryValue Root='HKCU'
Key='Software\Feed Center\Setup' Key='Software\Feed Center\Setup'
Type='integer' Type='integer'
Name='FeedCenter' Name='FeedCenter'
Value='1' Value='1'
KeyPath='yes' /> KeyPath='yes' />
<File Source="$(var.Common.TargetPath)" /> <!-- Capabilities keys for Vista/7 "Set Program Access and Defaults" -->
<File Source="$(var.Common.Native.TargetPath)" /> <RegistryValue Root="HKCU"
<File Source="$(var.Common.Wpf.TargetPath)" /> Key="SOFTWARE\Feed Center\Capabilities"
Name="ApplicationDescription"
Value="$(var.FileDescription)"
Type="string" />
<RegistryValue Root="HKCU"
Key="SOFTWARE\Feed Center\Capabilities"
Name="ApplicationName"
Value="$(var.ProductName)"
Type="string" />
<RegistryValue Root="HKCU"
Key="SOFTWARE\Feed Center\Capabilities\URLAssociations"
Name="feed"
Value="FeedCenter.URL.feed"
Type="string" />
<RegistryValue Root="HKCU"
Key="SOFTWARE\Feed Center\Capabilities\URLAssociations"
Name="feeds"
Value="FeedCenter.URL.feed"
Type="string" />
<File Source="$(var.FeedCenter.TargetDir)\Common.Wpf.MarkupExtensions.dll" /> <RegistryValue Root="HKCU"
Key="SOFTWARE\RegisteredApplications"
Name="Feed Center"
Value="SOFTWARE\Feed Center\Capabilities"
Type="string" />
<File Source="$(var.FeedCenter.TargetDir)\EntityFramework.dll" /> <RegistryValue Root="HKCU"
<File Source="$(var.FeedCenter.TargetDir)\EntityFramework.SqlServer.dll" /> Key="Software\Classes\FeedCenter.URL.feed"
<File Source="$(var.FeedCenter.TargetDir)\EntityFramework.SqlServerCompact.dll" /> Value="URL:Feed Center Add RSS Feed"
Type="string" />
<RegistryValue Root="HKCU"
Key="Software\Classes\FeedCenter.URL.feed\DefaultIcon"
Value="[INSTALLFOLDER]FeedCenter.exe"
Type="string" />
<RegistryValue Root="HKCU"
Key="Software\Classes\FeedCenter.URL.feed\shell\open\command"
Value="&quot;[INSTALLFOLDER]FeedCenter.exe&quot; %1"
Type="string" />
<File Source="$(var.FeedCenter.TargetDir)\System.Data.SqlServerCe.dll" /> <File Source="$(var.Common.TargetPath)" />
<File Source="$(var.FeedCenter.TargetDir)\System.Data.SqlServerCe.Entity.dll" /> <File Source="$(var.Common.Native.TargetPath)" />
<File Source="$(var.Common.Wpf.TargetPath)" />
<File Source="$(var.FeedCenter.TargetPath).config" /> <File Source="$(var.FeedCenter.TargetDir)\Common.Wpf.MarkupExtensions.dll" />
<File Id="FeedCenter.exe"
Source="$(var.FeedCenter.TargetPath)" />
<RemoveFolder Id='INSTALLFOLDER' <File Source="$(var.FeedCenter.TargetDir)\EntityFramework.dll" />
On='uninstall' /> <File Source="$(var.FeedCenter.TargetDir)\EntityFramework.SqlServer.dll" />
</Component> <File Source="$(var.FeedCenter.TargetDir)\EntityFramework.SqlServerCompact.dll" />
<Component Id="ApplicationShortcut"
Guid="{63CF0995-E117-4BB9-9077-76F570FDFAA9}"
Directory="ApplicationProgramsFolder">
<Shortcut Id="StartMenuShortcut" <File Source="$(var.FeedCenter.TargetDir)\System.Data.SqlServerCe.dll" />
Directory="ApplicationProgramsFolder" <File Source="$(var.FeedCenter.TargetDir)\System.Data.SqlServerCe.Entity.dll" />
Advertise="no"
Name="$(var.ProductName)"
Target="[INSTALLFOLDER]\$(var.FeedCenter.TargetName)"
WorkingDirectory="INSTALLFOLDER" />
<RemoveFolder Id="ApplicationProgramsFolder" <File Source="$(var.FeedCenter.TargetPath).config" />
On="uninstall"/> <File Id="FeedCenter.exe"
Source="$(var.FeedCenter.TargetPath)" />
<RegistryValue Root="HKCU" <RemoveFolder Id='INSTALLFOLDER'
Key="Software\Feed Center\Setup" On='uninstall' />
Name="Shortcut" </Component>
Type="integer" <Component Id="ApplicationShortcut"
Value="1" Guid="{63CF0995-E117-4BB9-9077-76F570FDFAA9}"
KeyPath="yes"/> Directory="ApplicationProgramsFolder">
</Component>
</ComponentGroup> <Shortcut Id="StartMenuShortcut"
</Fragment> Directory="ApplicationProgramsFolder"
Advertise="no"
Name="$(var.ProductName)"
Target="[INSTALLFOLDER]\$(var.FeedCenter.TargetName)"
WorkingDirectory="INSTALLFOLDER" />
<RemoveFolder Id="ApplicationProgramsFolder"
On="uninstall"/>
<RegistryValue Root="HKCU"
Key="Software\Feed Center\Setup"
Name="Shortcut"
Type="integer"
Value="1"
KeyPath="yes"/>
</Component>
</ComponentGroup>
</Fragment>
</Wix> </Wix>