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