Remove WinForms references and start on installer

This commit is contained in:
2023-04-22 09:05:41 -04:00
parent d6a2fd5a46
commit 586a0497d6
14 changed files with 572 additions and 676 deletions

View File

@@ -106,9 +106,6 @@ public partial class App
if (!IsDebugBuild) if (!IsDebugBuild)
Current.SetStartWithWindows(Settings.Default.StartWithWindows); Current.SetStartWithWindows(Settings.Default.StartWithWindows);
// Initialize the window
mainWindow.Initialize();
// Run the app // Run the app
app.Run(mainWindow); app.Run(mainWindow);
} }

View File

@@ -1,192 +1,108 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net70-windows</TargetFramework> <TargetFramework>net70-windows</TargetFramework>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform> <OutputType>WinExe</OutputType>
<OutputType>WinExe</OutputType> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<IsWebBootstrapper>false</IsWebBootstrapper> <UseWindowsForms>false</UseWindowsForms>
<SccProjectName></SccProjectName> <UseWPF>true</UseWPF>
<SccLocalPath></SccLocalPath> <ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
<SccAuxPath></SccAuxPath> </PropertyGroup>
<SccProvider></SccProvider>
<PublishUrl>\\server\d\FeedCenter\</PublishUrl>
<Install>true</Install>
<InstallFrom>Unc</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ProductName>Feed Center</ProductName>
<PublisherName>Feed Center</PublisherName>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>Publish.html</WebPage>
<OpenBrowserOnPublish>false</OpenBrowserOnPublish>
<ApplicationRevision>215</ApplicationRevision>
<ApplicationVersion>0.1.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF>
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
</PropertyGroup>
<PropertyGroup>
<StartupObject></StartupObject>
</PropertyGroup>
<PropertyGroup> <PropertyGroup>
<EnableDefaultApplicationDefinition>false</EnableDefaultApplicationDefinition> <EnableDefaultApplicationDefinition>false</EnableDefaultApplicationDefinition>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<AssemblyOriginatorKeyFile></AssemblyOriginatorKeyFile> <GenerateManifests>false</GenerateManifests>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <ItemGroup>
<ApplicationIcon>Resources\Application.ico</ApplicationIcon> <None Remove="Resources\Application.ico" />
</PropertyGroup> <None Remove="Resources\Comments-edit.ico" />
<PropertyGroup> <None Remove="Resources\Compile.ico" />
<TargetZone>LocalIntranet</TargetZone> <None Remove="Resources\Left.ico" />
</PropertyGroup> <None Remove="Resources\News.ico" />
<PropertyGroup> <None Remove="Resources\Right.ico" />
<GenerateManifests>false</GenerateManifests> <None Remove="Resources\Rss-Download.ico" />
</PropertyGroup> <None Remove="Resources\Warning.ico" />
<PropertyGroup> </ItemGroup>
<ApplicationManifest>Properties\app.manifest</ApplicationManifest> <ItemGroup>
</PropertyGroup> <Content Include="Resources\Application.ico" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"> </ItemGroup>
<CodeAnalysisLogFile>bin\Debug\FeedCenter.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile> <ItemGroup>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <PackageReference Include="ChrisKaczor.ApplicationUpdate" Version="1.0.2" />
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories> <PackageReference Include="ChrisKaczor.GenericSettingsProvider" Version="1.0.3" />
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets> <PackageReference Include="ChrisKaczor.InstalledBrowsers" Version="1.0.3" />
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> <PackageReference Include="ChrisKaczor.Wpf.Application.SingleInstance" Version="1.0.4" />
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules> <PackageReference Include="ChrisKaczor.Wpf.Application.StartWithWindows" Version="1.0.2" />
<UseVSHostingProcess>true</UseVSHostingProcess> <PackageReference Include="ChrisKaczor.Wpf.Controls.HtmlTextBlock" Version="1.0.2" />
</PropertyGroup> <PackageReference Include="ChrisKaczor.Wpf.Controls.Link" Version="1.0.3" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'"> <PackageReference Include="ChrisKaczor.Wpf.Controls.Toolbar" Version="1.0.2" />
<CodeAnalysisLogFile>bin\Release\FeedCenter.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile> <PackageReference Include="ChrisKaczor.Wpf.Validation" Version="1.0.3" />
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <PackageReference Include="ChrisKaczor.Wpf.Windows.ControlBox" Version="1.0.2" />
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories> <PackageReference Include="ChrisKaczor.Wpf.Windows.SnappingWindow" Version="1.0.2" />
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> <PackageReference Include="Dapper" Version="2.0.123" />
</PropertyGroup> <PackageReference Include="DebounceThrottle" Version="2.0.0" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"> <PackageReference Include="H.NotifyIcon.Wpf" Version="2.0.108" />
<OutputPath>bin\x64\Debug\</OutputPath> <PackageReference Include="HtmlAgilityPack" Version="1.11.46" />
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <PackageReference Include="HtmlTextWriter" Version="2.1.1" />
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets> <PackageReference Include="MahApps.Metro" Version="2.4.9" />
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules> <PackageReference Include="Microsoft.SqlServer.Compact" Version="4.0.8876.1" GeneratePathProperty="true">
</PropertyGroup> <NoWarn>NU1701</NoWarn>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> </PackageReference>
<OutputPath>bin\x64\Release\</OutputPath> <PackageReference Include="Microsoft.Windows.Compatibility" Version="7.0.1" />
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <PackageReference Include="NameBasedGrid" Version="0.10.1">
</PropertyGroup> <NoWarn>NU1701</NoWarn>
<ItemGroup> </PackageReference>
<EntityDeploy Include="Model.edmx"> <PackageReference Include="Realm" Version="10.21.0" />
<Generator>EntityModelCodeGenerator</Generator> <PackageReference Include="Serilog" Version="2.12.0" />
<LastGenOutput>Model.Designer.cs</LastGenOutput> <PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" />
</EntityDeploy> <PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
<AppDesigner Include="Properties\" /> <PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
</ItemGroup> <PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<ItemGroup> </ItemGroup>
<Resource Include="Resources\Application.ico" /> <ItemGroup>
</ItemGroup> <Resource Include="Resources\Application.ico" />
<ItemGroup> <Resource Include="Resources\Comments-edit.ico" />
<BootstrapperPackage Include=".NETFramework,Version=v4.5"> <Resource Include="Resources\Compile.ico" />
<Visible>False</Visible> <Resource Include="Resources\Left.ico" />
<ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName> <Resource Include="Resources\News.ico" />
<Install>true</Install> <Resource Include="Resources\Right.ico" />
</BootstrapperPackage> <Resource Include="Resources\Rss-Download.ico" />
<BootstrapperPackage Include="Microsoft.Net.Client.3.5"> <Resource Include="Resources\Warning.ico" />
<Visible>False</Visible> </ItemGroup>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName> <ItemGroup>
<Install>false</Install> <Compile Update="Properties\Resources.Designer.cs">
</BootstrapperPackage> <DesignTime>True</DesignTime>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"> <AutoGen>True</AutoGen>
<Visible>False</Visible> <DependentUpon>Resources.resx</DependentUpon>
<ProductName>.NET Framework 3.5 SP1</ProductName> </Compile>
<Install>false</Install> <Compile Update="Properties\Settings.Designer.cs">
</BootstrapperPackage> <DesignTimeSharedInput>True</DesignTimeSharedInput>
<BootstrapperPackage Include="Microsoft.Windows.Installer.4.5"> <AutoGen>True</AutoGen>
<Visible>False</Visible> <DependentUpon>Settings.settings</DependentUpon>
<ProductName>Windows Installer 4.5</ProductName> </Compile>
<Install>true</Install> </ItemGroup>
</BootstrapperPackage> <ItemGroup>
</ItemGroup> <EmbeddedResource Update="Properties\Resources.resx">
<ItemGroup> <Generator>PublicResXFileCodeGenerator</Generator>
<Resource Include="Resources\Rss-Download.ico" /> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
<Resource Include="Resources\Comments-edit.ico" /> </EmbeddedResource>
<Resource Include="Resources\Warning.ico" /> </ItemGroup>
<Resource Include="Resources\News.ico" /> <ItemGroup>
<Resource Include="Resources\Compile.ico" /> <None Update="Properties\Settings.settings">
<Resource Include="Resources\Left.ico" /> <Generator>SettingsSingleFileGenerator</Generator>
<Resource Include="Resources\Right.ico" /> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
</ItemGroup> </None>
<ItemGroup> </ItemGroup>
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" /> <Target Name="AddSqlServerCompact_x86" AfterTargets="Publish" Condition="'$(RuntimeIdentifier)' == 'win-x86'">
</ItemGroup> <Exec Command="xcopy /s /y /i &quot;$(PkgMicrosoft_SqlServer_Compact)\NativeBinaries\x86\*.*&quot; &quot;$(PublishDir)x86&quot;" />
<ItemGroup> </Target>
<PackageReference Include="ChrisKaczor.ApplicationUpdate" Version="1.0.2" /> <Target Name="AddSqlServerCompact_x64" AfterTargets="Publish" Condition="'$(RuntimeIdentifier)' == 'win-x64'">
<PackageReference Include="ChrisKaczor.GenericSettingsProvider" Version="1.0.3" /> <Exec Command="xcopy /s /y /i &quot;$(PkgMicrosoft_SqlServer_Compact)\NativeBinaries\amd64\*.*&quot; &quot;$(PublishDir)amd64&quot;" />
<PackageReference Include="ChrisKaczor.InstalledBrowsers" Version="1.0.3" /> </Target>
<PackageReference Include="ChrisKaczor.Wpf.Application.SingleInstance" Version="1.0.4" /> <PropertyGroup>
<PackageReference Include="ChrisKaczor.Wpf.Application.StartWithWindows" Version="1.0.2" /> <PostBuildEvent>
<PackageReference Include="ChrisKaczor.Wpf.Controls.HtmlTextBlock" Version="1.0.2" /> xcopy /s /y /i "$(PkgMicrosoft_SqlServer_Compact)\NativeBinaries\x86\*.*" "$(TargetDir)x86"
<PackageReference Include="ChrisKaczor.Wpf.Controls.Link" Version="1.0.3" /> xcopy /s /y /i "$(PkgMicrosoft_SqlServer_Compact)\NativeBinaries\amd64\*.*" "$(TargetDir)amd64"
<PackageReference Include="ChrisKaczor.Wpf.Controls.Toolbar" Version="1.0.2" /> </PostBuildEvent>
<PackageReference Include="ChrisKaczor.Wpf.Validation" Version="1.0.3" /> <ApplicationIcon>Resources\Application.ico</ApplicationIcon>
<PackageReference Include="ChrisKaczor.Wpf.Windows.ControlBox" Version="1.0.2" /> </PropertyGroup>
<PackageReference Include="ChrisKaczor.Wpf.Windows.SnappingWindow" Version="1.0.2" />
<PackageReference Include="Dapper" Version="2.0.123" />
<PackageReference Include="DebounceThrottle" Version="2.0.0" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.46" />
<PackageReference Include="HtmlTextWriter" Version="2.1.1" />
<PackageReference Include="MahApps.Metro" Version="2.4.9" />
<PackageReference Include="Microsoft.SqlServer.Compact" Version="4.0.8876.1" GeneratePathProperty="true">
<NoWarn>NU1701</NoWarn>
</PackageReference>
<PackageReference Include="Microsoft.Windows.Compatibility" Version="7.0.1" />
<PackageReference Include="NameBasedGrid" Version="0.10.1">
<NoWarn>NU1701</NoWarn>
</PackageReference>
<PackageReference Include="Realm" Version="10.21.0" />
<PackageReference Include="Serilog" Version="2.12.0" />
<PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<Compile Remove="SqlSettingsProvider.cs" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<PropertyGroup>
<PostBuildEvent>
if not exist "$(TargetDir)x86" md "$(TargetDir)x86"
xcopy /s /y "$(PkgMicrosoft_SqlServer_Compact)\NativeBinaries\x86\*.*" "$(TargetDir)x86"
if not exist "$(TargetDir)amd64" md "$(TargetDir)amd64"
xcopy /s /y "$(PkgMicrosoft_SqlServer_Compact)\NativeBinaries\amd64\*.*" "$(TargetDir)amd64"
</PostBuildEvent>
</PropertyGroup>
</Project> </Project>

View File

@@ -86,7 +86,7 @@ public partial class MainWindow
_database.SaveChanges(() => _database.Feeds.Add(feed)); _database.SaveChanges(() => _database.Feeds.Add(feed));
// Show a tip // Show a tip
NotificationIcon.ShowBalloonTip(string.Format(Properties.Resources.FeedAddedNotification, feed.Name), System.Windows.Forms.ToolTipIcon.Info); NotificationIcon.ShowBalloonTip(string.Format(Properties.Resources.FeedAddedNotification, feed.Name), H.NotifyIcon.Core.NotificationIcon.Info);
_currentFeed = feed; _currentFeed = feed;
@@ -104,7 +104,7 @@ public partial class MainWindow
var dialogResult = feedForm.Display(feed, this); var dialogResult = feedForm.Display(feed, this);
// Display the new feed form // Display the new feed form
if (!dialogResult.HasValue || !dialogResult.Value) if (!dialogResult.HasValue || !dialogResult.Value)
return; return;
// Add the feed to the feed table // Add the feed to the feed table

View File

@@ -34,6 +34,14 @@ public partial class MainWindow : IDisposable
GC.SuppressFinalize(this); GC.SuppressFinalize(this);
} }
protected override void OnSourceInitialized(EventArgs e)
{
base.OnSourceInitialized(e);
// Initialize the window
Initialize();
}
protected override async void OnClosed(EventArgs e) protected override async void OnClosed(EventArgs e)
{ {
base.OnClosed(e); base.OnClosed(e);
@@ -207,9 +215,7 @@ public partial class MainWindow : IDisposable
private void InitializeDisplay() private void InitializeDisplay()
{ {
// Get the last category (defaulting to none) // Get the last category (defaulting to none)
_currentCategory = _currentCategory = _database.Categories.FirstOrDefault(category => category.Id.ToString() == Settings.Default.LastCategoryID);
_database.Categories.FirstOrDefault(category =>
category.Id.ToString() == Settings.Default.LastCategoryID);
DisplayCategory(); DisplayCategory();
// Get the current feed list to match the category // Get the current feed list to match the category

View File

@@ -1,6 +1,7 @@
using FeedCenter.Properties; using FeedCenter.Properties;
using System; using System;
using System.Windows.Forms; using System.Timers;
using System.Windows.Threading;
namespace FeedCenter; namespace FeedCenter;
@@ -9,11 +10,14 @@ public partial class MainWindow
private Timer _mainTimer; private Timer _mainTimer;
private DateTime _lastFeedRead; private DateTime _lastFeedRead;
private DateTime _lastFeedDisplay; private DateTime _lastFeedDisplay;
private Dispatcher _dispatcher;
private void InitializeTimer() private void InitializeTimer()
{ {
_dispatcher = Dispatcher.CurrentDispatcher;
_mainTimer = new Timer { Interval = 1000 }; _mainTimer = new Timer { Interval = 1000 };
_mainTimer.Tick += HandleMainTimerTick; _mainTimer.Elapsed += HandleMainTimerElapsed;
} }
private void TerminateTimer() private void TerminateTimer()
@@ -33,26 +37,29 @@ public partial class MainWindow
_mainTimer.Stop(); _mainTimer.Stop();
} }
private void HandleMainTimerTick(object sender, EventArgs e) private void HandleMainTimerElapsed(object sender, EventArgs e)
{ {
// If the background worker is busy then don't do anything _dispatcher.Invoke(() =>
if (_feedReadWorker.IsBusy) {
return; // If the background worker is busy then don't do anything
if (_feedReadWorker.IsBusy)
return;
// Stop the timer for now // Stop the timer for now
StopTimer(); StopTimer();
// Move to the next feed if the scroll interval has expired and the mouse isn't hovering // Move to the next feed if the scroll interval has expired and the mouse isn't hovering
if (LinkTextList.IsMouseOver) if (LinkTextList.IsMouseOver)
_lastFeedDisplay = DateTime.Now; _lastFeedDisplay = DateTime.Now;
else if (DateTime.Now - _lastFeedDisplay >= Settings.Default.FeedScrollInterval) else if (DateTime.Now - _lastFeedDisplay >= Settings.Default.FeedScrollInterval)
NextFeed(); NextFeed();
// Check to see if we should try to read the feeds // Check to see if we should try to read the feeds
if (DateTime.Now - _lastFeedRead >= Settings.Default.FeedCheckInterval) if (DateTime.Now - _lastFeedRead >= Settings.Default.FeedCheckInterval)
ReadFeeds(); ReadFeeds();
// Get the timer going again // Get the timer going again
StartTimer(); StartTimer();
});
} }
} }

View File

@@ -112,28 +112,28 @@ public partial class MainWindow
{ {
var windowInteropHelper = new WindowInteropHelper(this); var windowInteropHelper = new WindowInteropHelper(this);
var screen = System.Windows.Forms.Screen.FromHandle(windowInteropHelper.Handle); var screen = WpfScreenHelper.Screen.FromHandle(windowInteropHelper.Handle);
var rectangle = new System.Drawing.Rectangle var rectangle = new Rect
{ {
X = (int) Left, X = Left,
Y = (int) Top, Y = Top,
Width = (int) Width, Width = Width,
Height = (int) Height Height = Height
}; };
var borderThickness = new Thickness(); var borderThickness = new Thickness();
if (rectangle.Right != screen.WorkingArea.Right) if (!rectangle.Right.Equals(screen.WorkingArea.Right))
borderThickness.Right = 1; borderThickness.Right = 1;
if (rectangle.Left != screen.WorkingArea.Left) if (!rectangle.Left.Equals(screen.WorkingArea.Left))
borderThickness.Left = 1; borderThickness.Left = 1;
if (rectangle.Top != screen.WorkingArea.Top) if (!rectangle.Top.Equals(screen.WorkingArea.Top))
borderThickness.Top = 1; borderThickness.Top = 1;
if (rectangle.Bottom != screen.WorkingArea.Bottom) if (!rectangle.Bottom.Equals(screen.WorkingArea.Bottom))
borderThickness.Bottom = 1; borderThickness.Bottom = 1;
WindowBorder.BorderThickness = borderThickness; WindowBorder.BorderThickness = borderThickness;

View File

@@ -1,49 +1,61 @@
using FeedCenter.Properties; using FeedCenter.Properties;
using System.Windows.Forms; using H.NotifyIcon;
using System.Windows.Controls;
namespace FeedCenter; namespace FeedCenter;
internal static class NotificationIcon internal static class NotificationIcon
{ {
private static MainWindow _mainForm; private static MainWindow _mainWindow;
private static NotifyIcon _notificationIcon; private static TaskbarIcon _notificationIcon;
private static MenuItem _lockMenuItem;
public static void Initialize(MainWindow mainForm) public static void Initialize(MainWindow mainWindow)
{ {
// Store the main window // Store the main window
_mainForm = mainForm; _mainWindow = mainWindow;
// Create the notification icon // Create the notification icon
_notificationIcon = new NotifyIcon { Icon = Resources.Application }; _notificationIcon = new TaskbarIcon { Icon = Resources.Application };
_notificationIcon.DoubleClick += HandleNotificationIconDoubleClick; _notificationIcon.TrayMouseDoubleClick += HandleNotificationIconDoubleClick;
// Setup the menu // Setup the menu
var contextMenuStrip = new ContextMenuStrip(); var contextMenu = new ContextMenu();
var toolStripMenuItem = new ToolStripMenuItem(Resources.NotificationIconContextMenuLocked, null, HandleLockWindowClicked) { Checked = Settings.Default.WindowLocked }; _lockMenuItem = new MenuItem()
contextMenuStrip.Items.Add(toolStripMenuItem); {
Header = Resources.NotificationIconContextMenuLocked,
IsChecked = Settings.Default.WindowLocked
};
_lockMenuItem.Click += HandleLockWindowClicked;
contextMenu.Items.Add(_lockMenuItem);
contextMenuStrip.Items.Add(new ToolStripSeparator()); contextMenu.Items.Add(new Separator());
contextMenuStrip.Items.Add(Resources.NotificationIconContextMenuExit, null, HandleContextMenuExitClick); var menuItem = new MenuItem()
{
Header = Resources.NotificationIconContextMenuExit
};
menuItem.Click += HandleContextMenuExitClick;
contextMenu.Items.Add(menuItem);
// Set the menu into the icon // Set the menu into the icon
_notificationIcon.ContextMenuStrip = contextMenuStrip; _notificationIcon.ContextMenu = contextMenu;
// Show the icon // Show the icon
_notificationIcon.Visible = true; _notificationIcon.ForceCreate(false);
} }
private static void HandleNotificationIconDoubleClick(object sender, System.EventArgs e) private static void HandleNotificationIconDoubleClick(object sender, System.EventArgs e)
{ {
// Bring the main form to the front // Bring the main form to the front
_mainForm.Activate(); _mainWindow.Activate();
} }
private static void HandleContextMenuExitClick(object sender, System.EventArgs e) private static void HandleContextMenuExitClick(object sender, System.EventArgs e)
{ {
// Close the main form // Close the main form
_mainForm.Close(); _mainWindow.Close();
} }
private static void HandleLockWindowClicked(object sender, System.EventArgs e) private static void HandleLockWindowClicked(object sender, System.EventArgs e)
@@ -52,26 +64,20 @@ internal static class NotificationIcon
Settings.Default.WindowLocked = !Settings.Default.WindowLocked; Settings.Default.WindowLocked = !Settings.Default.WindowLocked;
// Refresh the menu choice // Refresh the menu choice
((ToolStripMenuItem) sender).Checked = Settings.Default.WindowLocked; _lockMenuItem.IsChecked = Settings.Default.WindowLocked;
} }
public static void Dispose() public static void Dispose()
{ {
// Get rid of the icon // Get rid of the icon
_notificationIcon.Visible = false;
_notificationIcon.Dispose(); _notificationIcon.Dispose();
_notificationIcon = null; _notificationIcon = null;
_mainForm = null; _mainWindow = null;
} }
public static void ShowBalloonTip(string text, ToolTipIcon icon) public static void ShowBalloonTip(string text, H.NotifyIcon.Core.NotificationIcon icon)
{ {
ShowBalloonTip(text, icon, Settings.Default.BalloonTipTimeout); _notificationIcon.ShowNotification(Resources.ApplicationDisplayName, text, icon);
}
private static void ShowBalloonTip(string text, ToolTipIcon icon, int timeout)
{
_notificationIcon.ShowBalloonTip(timeout, Resources.ApplicationDisplayName, text, icon);
} }
} }

View File

@@ -1,116 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using System.Windows.Forms;
using System.Collections.Specialized;
using Microsoft.Win32;
namespace FeedCenter
{
class RegistrySettingsProvider : SettingsProvider
{
public RegistrySettingsProvider()
{
}
public override string ApplicationName
{
get { return Application.ProductName; }
set { }
}
public override void Initialize(string name, NameValueCollection col)
{
base.Initialize(this.ApplicationName, col);
}
// SetPropertyValue is invoked when ApplicationSettingsBase.Save is called
// ASB makes sure to pass each provider only the values marked for that provider -
// though in this sample, since the entire settings class was marked with a SettingsProvider
// attribute, all settings in that class map to this provider
public override void SetPropertyValues(SettingsContext context, SettingsPropertyValueCollection propvals)
{
// Iterate through the settings to be stored
// Only IsDirty=true properties should be included in propvals
foreach (SettingsPropertyValue propval in propvals)
{
// NOTE: this provider allows setting to both user- and application-scoped
// settings. The default provider for ApplicationSettingsBase -
// LocalFileSettingsProvider - is read-only for application-scoped setting. This
// is an example of a policy that a provider may need to enforce for implementation,
// security or other reasons.
GetRegKey(propval.Property).SetValue(propval.Name, propval.SerializedValue);
}
}
public override SettingsPropertyValueCollection GetPropertyValues(SettingsContext context, SettingsPropertyCollection props)
{
// Create new collection of values
SettingsPropertyValueCollection values = new SettingsPropertyValueCollection();
// Iterate through the settings to be retrieved
foreach (SettingsProperty setting in props)
{
SettingsPropertyValue value = new SettingsPropertyValue(setting);
value.IsDirty = false;
value.SerializedValue = GetRegKey(setting).GetValue(setting.Name);
values.Add(value);
}
return values;
}
// Helper method: fetches correct registry subkey.
// HKLM is used for settings marked as application-scoped.
// HKLU is used for settings marked as user-scoped.
private RegistryKey GetRegKey(SettingsProperty prop)
{
RegistryKey regKey;
if (IsUserScoped(prop))
{
regKey = Registry.CurrentUser;
}
else
{
regKey = Registry.LocalMachine;
}
regKey = regKey.CreateSubKey(GetSubKeyPath());
return regKey;
}
// Helper method: walks the "attribute bag" for a given property
// to determine if it is user-scoped or not.
// Note that this provider does not enforce other rules, such as
// - unknown attributes
// - improper attribute combinations (e.g. both user and app - this implementation
// would say true for user-scoped regardless of existence of app-scoped)
private bool IsUserScoped(SettingsProperty prop)
{
foreach (DictionaryEntry d in prop.Attributes)
{
Attribute a = (Attribute) d.Value;
if (a.GetType() == typeof(UserScopedSettingAttribute))
return true;
}
return false;
}
// Builds a key path based on the CompanyName, ProductName, and ProductVersion attributes in
// the AssemblyInfo file (editable directly or within the Project Properties UI)
private string GetSubKeyPath()
{
return "Software\\" + Application.CompanyName + "\\" + Application.ProductName + "\\" + Application.ProductVersion;
}
}
}

View File

@@ -1,42 +1,16 @@
<?xml version="1.0" encoding="utf-8"?> <Project>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="Sdk.props" Sdk="WixToolset.Sdk" Version="4.0.0" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>3.9</ProductVersion> <ProductVersion>3.9</ProductVersion>
<ProjectGuid>5e5c13a5-635e-4310-a653-0f9760f46935</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>FeedCenterSetup</OutputName> <OutputName>FeedCenterSetup</OutputName>
<OutputType>Bundle</OutputType> <OutputType>Bundle</OutputType>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug</DefineConstants> <DefineConstants>Debug</DefineConstants>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Bundle.wxs" /> <PackageReference Include="WixToolset.Bal.wixext" Version="4.0.0" />
</ItemGroup>
<ItemGroup>
<WixExtension Include="WixBalExtensionExt">
<HintPath>..\packages\WixBalExtensionExt.1.0.0.49\lib\WixBalExtensionExt.dll</HintPath>
<Name>WixBalExtensionExt</Name>
</WixExtension>
<WixExtension Include="WixFileVersionExtension">
<HintPath>..\packages\WixFileVersionExtension.1.0.0.3\lib\WixFileVersionExtension.dll</HintPath>
<Name>WixFileVersionExtension</Name>
</WixExtension>
<WixExtension Include="WixNetFxExtension">
<HintPath>$(WixExtDir)\WixNetFxExtension.dll</HintPath>
<Name>WixNetFxExtension</Name>
</WixExtension>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Application\FeedCenter.csproj"> <ProjectReference Include="..\Application\FeedCenter.csproj">
@@ -56,19 +30,8 @@
<RefTargetDir>INSTALLFOLDER</RefTargetDir> <RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <Import Project="Sdk.targets" Sdk="WixToolset.Sdk" Version="4.0.0" />
<Content Include="packages.config" />
</ItemGroup>
<Import Project="$(WixTargetsPath)" />
<PropertyGroup> <PropertyGroup>
<PostBuildEvent /> <PostBuildEvent />
</PropertyGroup> </PropertyGroup>
<!--
To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Wix.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project> </Project>

View File

@@ -1,31 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
<?define ProductName="$(fileVersion.ProductName($(var.FeedCenter.TargetPath)))" ?> <?define ProductName="Feed Center" ?>
<?define CompanyName="$(fileVersion.CompanyName($(var.FeedCenter.TargetPath)))" ?> <?define CompanyName="Chris Kaczor" ?>
<?define ProductVersion="$(fileVersion.ProductVersion($(var.FeedCenter.TargetPath)))" ?> <?define ProductVersion="!(bind.packageVersion.FeedCenter)" ?>
<?define FileDescription="" ?>
<Bundle Name="$(var.ProductName)" <Bundle Name="$(var.ProductName)"
Version="$(var.ProductVersion)" Version="$(var.ProductVersion)"
Manufacturer="$(var.CompanyName)" Manufacturer="$(var.CompanyName)"
UpgradeCode="5e5c13a5-635e-4310-a653-0f9760f46935"> UpgradeCode="5e5c13a5-635e-4310-a653-0f9760f46935"
Compressed="no">
<BootstrapperApplicationRef Id="WixExtendedBootstrapperApplication.HyperlinkLicense"> <BootstrapperApplication Id="WixExtendedBootstrapperApplication.HyperlinkLicense">
<bal:WixExtendedBootstrapperApplication <!--<bal:WixStandardBootstrapperApplication LaunchPassive="yes" LaunchQuiet="yes" />-->
LicenseUrl="" <bal:WixStandardBootstrapperApplication LicenseUrl=""
SuppressOptionsUI="yes" SuppressOptionsUI="yes"
ShowVersion="yes" ShowVersion="yes"
LaunchPassive="yes" LaunchTarget="[LocalAppDataFolder]$(var.ProductName)\FeedCenter.exe"
LaunchQuiet="yes" Theme="hyperlinkLargeLicense" />
LaunchTarget="[LocalAppDataFolder]$(var.ProductName)\FeedCenter.exe" /> </BootstrapperApplication>
</BootstrapperApplicationRef>
<Chain> <Chain>
<PackageGroupRef Id="NetFx451Web" /> <ExePackage Id="runtime_desktop_x64"
DisplayName=".NET 7.0 Desktop Runtime (x64)"
InstallArguments="/install /quiet"
Permanent="yes"
InstallCondition='VersionNT64'>
<ArpEntry Id="runtime_desktop_x64_arp"
Version="7.0.5.32327"
Win64="yes" />
<ExePackagePayload Hash="8907aa0e934a31c63f0a840bf9e734c2f5ba109b766c1a775f8adbb169049753664790c0a15b216f02a942392819a3500e4a33918df10fb967341dc167f82d11"
DownloadUrl="https://download.visualstudio.microsoft.com/download/pr/dffb1939-cef1-4db3-a579-5475a3061cdd/578b208733c914c7b7357f6baa4ecfd6/windowsdesktop-runtime-7.0.5-win-x64.exe"
Name="windowsdesktop-runtime-7.0.5-win-x64.exe"
Size="57609944" />
</ExePackage>
<ExePackage Id="runtime_desktop_x32"
DisplayName=".NET 7.0 Desktop Runtime (x86)"
InstallArguments="/install /quiet"
Permanent="yes"
InstallCondition='NOT VersionNT64'>
<ArpEntry Id="runtime_desktop_x64_arp"
Version="7.0.5.32327"
Win64="no" />
<ExePackagePayload Hash="a2f776cfabcfbd4b9278198301d289ed1c56febd47259520c50b8b8d130a79d0ea99c857aec96865cc635ddf078fd575368c030ce11d61bb9991d296df87a4a7"
DownloadUrl="https://download.visualstudio.microsoft.com/download/pr/eb64dcd1-d277-4798-ada1-600805c9e2dc/fc73c843d66f3996e7ef22468f4902e6/windowsdesktop-runtime-7.0.5-win-x86.exe"
Name="windowsdesktop-runtime-7.0.5-win-x86.exe"
Size="52816632" />
</ExePackage>
<MsiPackage Id="FeedCenter" <MsiPackage Id="FeedCenter"
SourceFile="$(var.Setup.TargetPath)" /> SourceFile="$(var.Setup.TargetPath)"
Compressed="yes" />
</Chain> </Chain>
</Bundle> </Bundle>
</Wix> </Wix>

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="WixBalExtensionExt" version="1.0.0.49" />
<package id="WixFileVersionExtension" version="1.0.0.3" />
</packages>

View File

@@ -1,219 +1,359 @@
<?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<?define ProductName="$(fileVersion.ProductName($(var.FeedCenter.TargetPath)))" ?>
<?define CompanyName="$(fileVersion.CompanyName($(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" />
<util:CloseApplication Id="CloseApplication" <?define ProductName="Feed Center" ?>
Target="FeedCenter.exe" <?define CompanyName="Chris Kaczor" ?>
CloseMessage="yes" <?define ProductVersion="!(bind.fileVersion.FeedCenter.exe)" ?>
Timeout="5" /> <?define FileDescription="" ?>
<MajorUpgrade Schedule="afterInstallValidate" <Package Name="$(var.ProductName)"
AllowDowngrades="no" Language="1033"
AllowSameVersionUpgrades="no" Version="$(var.ProductVersion)"
DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> Manufacturer="$(var.CompanyName)"
UpgradeCode="47f30e4a-a861-47ac-b82d-35e4b886992a"
Scope="perUser">
<util:CloseApplication Id="CloseApplication"
Target="FeedCenter.exe"
CloseMessage="yes"
Timeout="5" />
<MediaTemplate /> <MajorUpgrade Schedule="afterInstallValidate"
AllowDowngrades="no"
AllowSameVersionUpgrades="no"
DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<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> </Package>
<Fragment> <Fragment>
<PropertyRef Id="NETFRAMEWORK45"/> <StandardDirectory Id="LocalAppDataFolder">
<Directory Id="INSTALLFOLDER"
Name="$(var.ProductName)">
<Directory Id="SqlServerCe_32"
Name="x86" />
<Directory Id="SqlServerCe_64"
Name="amd64" />
<Directory Name="runtimes">
<Directory Name="win-x32">
<Directory Id="Runtimes_Win_x32_Native"
Name="native" />
</Directory>
<Directory Name="win-x64">
<Directory Id="Runtimes_Win_x64_Native"
Name="native" />
</Directory>
</Directory>
</Directory>
</StandardDirectory>
<StandardDirectory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder"
Name="$(var.ProductName)" />
</StandardDirectory>
</Fragment>
<Condition Message="This application requires version 4.5 of the .NET Framework. Please install the .NET Framework then run this installer again."> <Fragment>
<![CDATA[Installed OR NETFRAMEWORK45]]> <ComponentGroup Id="ProductComponents">
</Condition> <Component Id="SqlServerCe_32"
Guid="{800607E9-65ED-489F-83A2-C73AA36A9D1D}"
Directory="SqlServerCe_32">
<RegistryValue Root="HKCU"
Key="Software\Feed Center\Setup"
Type="integer"
Name="SqlServerCe_32"
Value="1"
KeyPath="yes" />
<Directory Id="TARGETDIR" <File Id="sqlceca40_32"
Name="SourceDir"> Source="$(var.FeedCenter.TargetDir)\x86\sqlceca40.dll" />
<Directory Id="LocalAppDataFolder"> <File Id="sqlcecompact40_32"
<Directory Id="INSTALLFOLDER" Source="$(var.FeedCenter.TargetDir)\x86\sqlcecompact40.dll" />
Name="$(var.ProductName)"> <File Id="sqlceer40EN_32"
<Directory Id="SqlServerCe_32" Source="$(var.FeedCenter.TargetDir)\x86\sqlceer40EN.dll" />
Name="x86" /> <File Id="sqlceme40_32"
<Directory Id="SqlServerCe_64" Source="$(var.FeedCenter.TargetDir)\x86\sqlceme40.dll" />
Name="amd64" /> <File Id="sqlceqp40_32"
</Directory> Source="$(var.FeedCenter.TargetDir)\x86\sqlceqp40.dll" />
</Directory> <File Id="sqlcese40_32"
<Directory Id="ProgramMenuFolder"> Source="$(var.FeedCenter.TargetDir)\x86\sqlcese40.dll" />
<Directory Id="ApplicationProgramsFolder"
Name="$(var.ProductName)"/>
</Directory>
</Directory>
</Fragment>
<Fragment> <RemoveFolder Id="SqlServerCe_32"
<ComponentGroup Id="ProductComponents"> On="uninstall" />
<Component Id="SqlServerCe_32" </Component>
Guid="{800607E9-65ED-489F-83A2-C73AA36A9D1D}" <Component Id="SqlServerCe_64"
Directory="SqlServerCe_32"> Guid="{67DB1CF4-23F2-4252-896C-714438959C9A}"
Directory="SqlServerCe_64">
<RegistryValue Root="HKCU"
Key="Software\Feed Center\Setup"
Type="integer"
Name="SqlServerCe_64"
Value="1"
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_32' 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_32" <RemoveFolder Id="SqlServerCe_64"
Source="$(var.FeedCenter.TargetDir)\x86\sqlceca40.dll" /> On="uninstall" />
<File Id="sqlcecompact40_32" </Component>
Source="$(var.FeedCenter.TargetDir)\x86\sqlcecompact40.dll" /> <Component Id="Runtimes_Win_x32_Native"
<File Id="sqlceer40EN_32" Guid="{E07B7F53-9FA0-426D-8ADF-A9FFF4E1ED02}"
Source="$(var.FeedCenter.TargetDir)\x86\sqlceer40EN.dll" /> Directory="Runtimes_Win_x32_Native">
<File Id="sqlceme40_32" <RegistryValue Root="HKCU"
Source="$(var.FeedCenter.TargetDir)\x86\sqlceme40.dll" /> Key="Software\Feed Center\Setup"
<File Id="sqlceqp40_32" Type="integer"
Source="$(var.FeedCenter.TargetDir)\x86\sqlceqp40.dll" /> Name="Runtimes_Win_x32"
<File Id="sqlcese40_32" Value="1"
Source="$(var.FeedCenter.TargetDir)\x86\sqlcese40.dll" /> KeyPath="yes" />
<RemoveFolder Id='SqlServerCe_32' <File Id="realm_wrappers.dll_x32"
On='uninstall' /> Source="$(var.FeedCenter.TargetDir)\runtimes\win-x64\native\realm-wrappers.dll" />
</Component> <File Id="sni.dll_x32"
<Component Id="SqlServerCe_64" Source="$(var.FeedCenter.TargetDir)\runtimes\win-x64\native\sni.dll" />
Guid="{67DB1CF4-23F2-4252-896C-714438959C9A}" </Component>
Directory="SqlServerCe_64"> <Component Id="Runtimes_Win_x64_Native"
Guid="{566D640B-F34D-4400-9B86-10EFD669A8B7}"
Directory="Runtimes_Win_x64_Native">
<RegistryValue Root="HKCU"
Key="Software\Feed Center\Setup"
Type="integer"
Name="Runtimes_Win_x64"
Value="1"
KeyPath="yes" />
<RegistryValue Root='HKCU' <File Id="realm_wrappers.dll_x64"
Key='Software\Feed Center\Setup' Source="$(var.FeedCenter.TargetDir)\runtimes\win-x64\native\realm-wrappers.dll" />
Type='integer' <File Id="sni.dll_x64"
Name='SqlServerCe_64' Source="$(var.FeedCenter.TargetDir)\runtimes\win-x64\native\sni.dll" />
Value='1' </Component>
KeyPath='yes' /> <Component Id="FeedCenter"
Guid="{9B2B9C65-8E68-4F82-9AC5-16EBCAC34B9E}"
Directory="INSTALLFOLDER">
<RegistryValue Root="HKCU"
Key="Software\Feed Center\Setup"
Type="integer"
Name="FeedCenter"
Value="1"
KeyPath="yes" />
<File Id="sqlceca40_64" <!-- Capabilities keys for Vista/7 "Set Program Access and Defaults" -->
Source="$(var.FeedCenter.TargetDir)\amd64\sqlceca40.dll" /> <RegistryValue Root="HKCU"
<File Id="sqlcecompact40_64" Key="SOFTWARE\Feed Center\Capabilities"
Source="$(var.FeedCenter.TargetDir)\amd64\sqlcecompact40.dll" /> Name="ApplicationDescription"
<File Id="sqlceer40EN_64" Value="$(var.FileDescription)"
Source="$(var.FeedCenter.TargetDir)\amd64\sqlceer40EN.dll" /> Type="string" />
<File Id="sqlceme40_64" <RegistryValue Root="HKCU"
Source="$(var.FeedCenter.TargetDir)\amd64\sqlceme40.dll" /> Key="SOFTWARE\Feed Center\Capabilities"
<File Id="sqlceqp40_64" Name="ApplicationName"
Source="$(var.FeedCenter.TargetDir)\amd64\sqlceqp40.dll" /> Value="$(var.ProductName)"
<File Id="sqlcese40_64" Type="string" />
Source="$(var.FeedCenter.TargetDir)\amd64\sqlcese40.dll" /> <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" />
<RemoveFolder Id='SqlServerCe_64' <RegistryValue Root="HKCU"
On='uninstall' /> Key="SOFTWARE\RegisteredApplications"
</Component> Name="Feed Center"
<Component Id="FeedCenter" Value="SOFTWARE\Feed Center\Capabilities"
Guid="{9B2B9C65-8E68-4F82-9AC5-16EBCAC34B9E}" Type="string" />
Directory="INSTALLFOLDER">
<RegistryValue Root='HKCU' <RegistryValue Root="HKCU"
Key='Software\Feed Center\Setup' Key="Software\Classes\FeedCenter.URL.feed"
Type='integer' Value="URL:Feed Center Add RSS Feed"
Name='FeedCenter' Type="string" />
Value='1' <RegistryValue Root="HKCU"
KeyPath='yes' /> Key="Software\Classes\FeedCenter.URL.feed\DefaultIcon"
Value="[INSTALLFOLDER]FeedCenter.exe"
<!-- Capabilities keys for Vista/7 "Set Program Access and Defaults" --> Type="string" />
<RegistryValue Root="HKCU" <RegistryValue Root="HKCU"
Key="SOFTWARE\Feed Center\Capabilities" Key="Software\Classes\FeedCenter.URL.feed\shell\open\command"
Name="ApplicationDescription" Value="&quot;[INSTALLFOLDER]FeedCenter.exe&quot; %1"
Value="$(var.FileDescription)" Type="string" />
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" <File Id="ChrisKaczor.ApplicationUpdate.dll"
Key="SOFTWARE\RegisteredApplications" Source="$(var.FeedCenter.TargetDir)\ChrisKaczor.ApplicationUpdate.dll" />
Name="Feed Center" <File Id="ChrisKaczor.GenericSettingsProvider.dll"
Value="SOFTWARE\Feed Center\Capabilities" Source="$(var.FeedCenter.TargetDir)\ChrisKaczor.GenericSettingsProvider.dll" />
Type="string" /> <File Id="ChrisKaczor.InstalledBrowsers.dll"
Source="$(var.FeedCenter.TargetDir)\ChrisKaczor.InstalledBrowsers.dll" />
<File Id="ChrisKaczor.Wpf.Application.SingleInstance.dll"
Source="$(var.FeedCenter.TargetDir)\ChrisKaczor.Wpf.Application.SingleInstance.dll" />
<File Id="ChrisKaczor.Wpf.Application.StartWithWindows.dll"
Source="$(var.FeedCenter.TargetDir)\ChrisKaczor.Wpf.Application.StartWithWindows.dll" />
<File Id="ChrisKaczor.Wpf.Controls.HtmlTextBlock.dll"
Source="$(var.FeedCenter.TargetDir)\ChrisKaczor.Wpf.Controls.HtmlTextBlock.dll" />
<File Id="ChrisKaczor.Wpf.Controls.Link.dll"
Source="$(var.FeedCenter.TargetDir)\ChrisKaczor.Wpf.Controls.Link.dll" />
<File Id="ChrisKaczor.Wpf.Controls.Toolbar.dll"
Source="$(var.FeedCenter.TargetDir)\ChrisKaczor.Wpf.Controls.Toolbar.dll" />
<File Id="ChrisKaczor.Wpf.Validation.dll"
Source="$(var.FeedCenter.TargetDir)\ChrisKaczor.Wpf.Validation.dll" />
<File Id="ChrisKaczor.Wpf.Windows.ControlBox.dll"
Source="$(var.FeedCenter.TargetDir)\ChrisKaczor.Wpf.Windows.ControlBox.dll" />
<File Id="ChrisKaczor.Wpf.Windows.SnappingWindow.dll"
Source="$(var.FeedCenter.TargetDir)\ChrisKaczor.Wpf.Windows.SnappingWindow.dll" />
<File Id="ControlzEx.dll"
Source="$(var.FeedCenter.TargetDir)\ControlzEx.dll" />
<File Id="Dapper.dll"
Source="$(var.FeedCenter.TargetDir)\Dapper.dll" />
<File Id="DebounceThrottle.dll"
Source="$(var.FeedCenter.TargetDir)\DebounceThrottle.dll" />
<File Id="FeedCenter.deps.json"
Source="$(var.FeedCenter.TargetDir)\FeedCenter.deps.json" />
<File Id="FeedCenter.dll"
Source="$(var.FeedCenter.TargetDir)\FeedCenter.dll" />
<File Id="FeedCenter.dll.config"
Source="$(var.FeedCenter.TargetDir)\FeedCenter.dll.config" />
<File Id="FeedCenter.exe"
Source="$(var.FeedCenter.TargetDir)\FeedCenter.exe" />
<File Id="FeedCenter.runtimeconfig.json"
Source="$(var.FeedCenter.TargetDir)\FeedCenter.runtimeconfig.json" />
<File Id="H.Formatters.BinaryFormatter.dll"
Source="$(var.FeedCenter.TargetDir)\H.Formatters.BinaryFormatter.dll" />
<File Id="H.Formatters.dll"
Source="$(var.FeedCenter.TargetDir)\H.Formatters.dll" />
<File Id="H.GeneratedIcons.System.Drawing.dll"
Source="$(var.FeedCenter.TargetDir)\H.GeneratedIcons.System.Drawing.dll" />
<File Id="H.NotifyIcon.dll"
Source="$(var.FeedCenter.TargetDir)\H.NotifyIcon.dll" />
<File Id="H.NotifyIcon.Wpf.dll"
Source="$(var.FeedCenter.TargetDir)\H.NotifyIcon.Wpf.dll" />
<File Id="H.Pipes.dll"
Source="$(var.FeedCenter.TargetDir)\H.Pipes.dll" />
<File Id="HtmlAgilityPack.dll"
Source="$(var.FeedCenter.TargetDir)\HtmlAgilityPack.dll" />
<File Id="HtmlTextWriter.dll"
Source="$(var.FeedCenter.TargetDir)\HtmlTextWriter.dll" />
<File Id="JetBrains.Annotations.dll"
Source="$(var.FeedCenter.TargetDir)\JetBrains.Annotations.dll" />
<File Id="MahApps.Metro.dll"
Source="$(var.FeedCenter.TargetDir)\MahApps.Metro.dll" />
<File Id="Microsoft.Bcl.AsyncInterfaces.dll"
Source="$(var.FeedCenter.TargetDir)\Microsoft.Bcl.AsyncInterfaces.dll" />
<File Id="Microsoft.Extensions.ObjectPool.dll"
Source="$(var.FeedCenter.TargetDir)\Microsoft.Extensions.ObjectPool.dll" />
<File Id="Microsoft.Xaml.Behaviors.dll"
Source="$(var.FeedCenter.TargetDir)\Microsoft.Xaml.Behaviors.dll" />
<File Id="MongoDB.Bson.dll"
Source="$(var.FeedCenter.TargetDir)\MongoDB.Bson.dll" />
<File Id="NameBasedGrid.dll"
Source="$(var.FeedCenter.TargetDir)\NameBasedGrid.dll" />
<File Id="Newtonsoft.Json.dll"
Source="$(var.FeedCenter.TargetDir)\Newtonsoft.Json.dll" />
<File Id="Realm.dll"
Source="$(var.FeedCenter.TargetDir)\Realm.dll" />
<File Id="Remotion.Linq.dll"
Source="$(var.FeedCenter.TargetDir)\Remotion.Linq.dll" />
<File Id="Serilog.dll"
Source="$(var.FeedCenter.TargetDir)\Serilog.dll" />
<File Id="Serilog.Enrichers.Thread.dll"
Source="$(var.FeedCenter.TargetDir)\Serilog.Enrichers.Thread.dll" />
<File Id="Serilog.Sinks.Console.dll"
Source="$(var.FeedCenter.TargetDir)\Serilog.Sinks.Console.dll" />
<File Id="Serilog.Sinks.File.dll"
Source="$(var.FeedCenter.TargetDir)\Serilog.Sinks.File.dll" />
<File Id="System.ComponentModel.Composition.dll"
Source="$(var.FeedCenter.TargetDir)\System.ComponentModel.Composition.dll" />
<File Id="System.ComponentModel.Composition.Registration.dll"
Source="$(var.FeedCenter.TargetDir)\System.ComponentModel.Composition.Registration.dll" />
<File Id="System.Data.Odbc.dll"
Source="$(var.FeedCenter.TargetDir)\System.Data.Odbc.dll" />
<File Id="System.Data.OleDb.dll"
Source="$(var.FeedCenter.TargetDir)\System.Data.OleDb.dll" />
<File Id="System.Data.SqlClient.dll"
Source="$(var.FeedCenter.TargetDir)\System.Data.SqlClient.dll" />
<File Id="System.Data.SqlServerCe.dll"
Source="$(var.FeedCenter.TargetDir)\System.Data.SqlServerCe.dll" />
<File Id="System.DirectoryServices.AccountManagement.dll"
Source="$(var.FeedCenter.TargetDir)\System.DirectoryServices.AccountManagement.dll" />
<File Id="System.DirectoryServices.dll"
Source="$(var.FeedCenter.TargetDir)\System.DirectoryServices.dll" />
<File Id="System.DirectoryServices.Protocols.dll"
Source="$(var.FeedCenter.TargetDir)\System.DirectoryServices.Protocols.dll" />
<File Id="System.IO.Ports.dll"
Source="$(var.FeedCenter.TargetDir)\System.IO.Ports.dll" />
<File Id="System.Management.dll"
Source="$(var.FeedCenter.TargetDir)\System.Management.dll" />
<File Id="System.Private.ServiceModel.dll"
Source="$(var.FeedCenter.TargetDir)\System.Private.ServiceModel.dll" />
<File Id="System.Reflection.Context.dll"
Source="$(var.FeedCenter.TargetDir)\System.Reflection.Context.dll" />
<File Id="System.Runtime.Caching.dll"
Source="$(var.FeedCenter.TargetDir)\System.Runtime.Caching.dll" />
<File Id="System.Security.Cryptography.Pkcs.dll"
Source="$(var.FeedCenter.TargetDir)\System.Security.Cryptography.Pkcs.dll" />
<File Id="System.Security.Cryptography.ProtectedData.dll"
Source="$(var.FeedCenter.TargetDir)\System.Security.Cryptography.ProtectedData.dll" />
<File Id="System.Security.Cryptography.Xml.dll"
Source="$(var.FeedCenter.TargetDir)\System.Security.Cryptography.Xml.dll" />
<File Id="System.ServiceModel.dll"
Source="$(var.FeedCenter.TargetDir)\System.ServiceModel.dll" />
<File Id="System.ServiceModel.Duplex.dll"
Source="$(var.FeedCenter.TargetDir)\System.ServiceModel.Duplex.dll" />
<File Id="System.ServiceModel.Http.dll"
Source="$(var.FeedCenter.TargetDir)\System.ServiceModel.Http.dll" />
<File Id="System.ServiceModel.NetTcp.dll"
Source="$(var.FeedCenter.TargetDir)\System.ServiceModel.NetTcp.dll" />
<File Id="System.ServiceModel.Primitives.dll"
Source="$(var.FeedCenter.TargetDir)\System.ServiceModel.Primitives.dll" />
<File Id="System.ServiceModel.Security.dll"
Source="$(var.FeedCenter.TargetDir)\System.ServiceModel.Security.dll" />
<File Id="System.ServiceModel.Syndication.dll"
Source="$(var.FeedCenter.TargetDir)\System.ServiceModel.Syndication.dll" />
<File Id="System.ServiceProcess.ServiceController.dll"
Source="$(var.FeedCenter.TargetDir)\System.ServiceProcess.ServiceController.dll" />
<File Id="System.Speech.dll"
Source="$(var.FeedCenter.TargetDir)\System.Speech.dll" />
<File Id="System.Threading.AccessControl.dll"
Source="$(var.FeedCenter.TargetDir)\System.Threading.AccessControl.dll" />
<File Id="System.Web.Services.Description.dll"
Source="$(var.FeedCenter.TargetDir)\System.Web.Services.Description.dll" />
<File Id="WpfScreenHelper.dll"
Source="$(var.FeedCenter.TargetDir)\WpfScreenHelper.dll" />
<RegistryValue Root="HKCU" <RemoveFolder Id="INSTALLFOLDER"
Key="Software\Classes\FeedCenter.URL.feed" On="uninstall" />
Value="URL:Feed Center Add RSS Feed" </Component>
Type="string" /> <Component Id="ApplicationShortcut"
<RegistryValue Root="HKCU" Guid="{63CF0995-E117-4BB9-9077-76F570FDFAA9}"
Key="Software\Classes\FeedCenter.URL.feed\DefaultIcon" Directory="ApplicationProgramsFolder">
Value="[INSTALLFOLDER]FeedCenter.exe" <Shortcut Id="StartMenuShortcut"
Type="string" /> Directory="ApplicationProgramsFolder"
<RegistryValue Root="HKCU" Advertise="no"
Key="Software\Classes\FeedCenter.URL.feed\shell\open\command" Name="$(var.ProductName)"
Value="&quot;[INSTALLFOLDER]FeedCenter.exe&quot; %1" Target="[INSTALLFOLDER]\FeedCenter.exe"
Type="string" /> WorkingDirectory="INSTALLFOLDER" />
<File Source="$(var.Common.TargetPath)" /> <RemoveFolder Id="ApplicationProgramsFolder"
<File Source="$(var.Common.Native.TargetPath)" /> On="uninstall" />
<File Source="$(var.Common.Wpf.TargetPath)" />
<File Source="$(var.FeedCenter.TargetDir)\NameBasedGrid.dll" /> <RegistryValue Root="HKCU"
Key="Software\Feed Center\Setup"
<File Source="$(var.FeedCenter.TargetDir)\HtmlAgilityPack.dll" /> Name="Shortcut"
Type="integer"
<File Source="$(var.FeedCenter.TargetDir)\Newtonsoft.Json.dll" /> Value="1"
KeyPath="yes" />
<File Source="$(var.FeedCenter.TargetDir)\EntityFramework.dll" /> </Component>
<File Source="$(var.FeedCenter.TargetDir)\EntityFramework.SqlServer.dll" /> </ComponentGroup>
<File Source="$(var.FeedCenter.TargetDir)\EntityFramework.SqlServerCompact.dll" /> </Fragment>
<File Source="$(var.FeedCenter.TargetDir)\System.Data.SqlServerCe.dll" />
<File Source="$(var.FeedCenter.TargetDir)\System.Data.SqlServerCe.Entity.dll" />
<File Source="$(var.FeedCenter.TargetPath).config" />
<File Id="FeedCenter.exe"
Source="$(var.FeedCenter.TargetPath)" />
<RemoveFolder Id='INSTALLFOLDER'
On='uninstall' />
</Component>
<Component Id="ApplicationShortcut"
Guid="{63CF0995-E117-4BB9-9077-76F570FDFAA9}"
Directory="ApplicationProgramsFolder">
<Shortcut Id="StartMenuShortcut"
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>

View File

@@ -1,46 +1,19 @@
<?xml version="1.0" encoding="utf-8"?> <Project Sdk="WixToolset.Sdk/4.0.0">
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>3.9</ProductVersion> <ProductVersion>3.9</ProductVersion>
<ProjectGuid>dfb3fe30-18ea-4216-8d92-11df9c8d50f1</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>Setup</OutputName>
<OutputType>Package</OutputType>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug</DefineConstants> <DefineConstants>Debug</DefineConstants>
<SuppressIces>ICE91</SuppressIces> <SuppressIces>ICE91</SuppressIces>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<SuppressIces>ICE91</SuppressIces> <SuppressIces>ICE91</SuppressIces>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<SuppressValidation>true</SuppressValidation> <SuppressValidation>true</SuppressValidation>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Product.wxs" /> <PackageReference Include="WixToolset.Util.wixext" Version="4.0.0" />
</ItemGroup>
<ItemGroup>
<WixExtension Include="WixFileVersionExtension">
<HintPath>..\packages\WixFileVersionExtension.1.0.0.3\lib\WixFileVersionExtension.dll</HintPath>
<Name>WixFileVersionExtension</Name>
</WixExtension>
<WixExtension Include="WixUtilExtension">
<HintPath>$(WixExtDir)\WixUtilExtension.dll</HintPath>
<Name>WixUtilExtension</Name>
</WixExtension>
<WixExtension Include="WixNetFxExtension">
<HintPath>$(WixExtDir)\WixNetFxExtension.dll</HintPath>
<Name>WixNetFxExtension</Name>
</WixExtension>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Application\FeedCenter.csproj"> <ProjectReference Include="..\Application\FeedCenter.csproj">
@@ -52,16 +25,4 @@
<RefTargetDir>INSTALLFOLDER</RefTargetDir> <RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Include="packages.config" />
</ItemGroup>
<Import Project="$(WixTargetsPath)" />
<!--
To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Wix.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project> </Project>

View File

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="WixFileVersionExtension" version="1.0.0.3" />
</packages>