diff --git a/.gitmodules b/.gitmodules
index 1faa47f..153f48f 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -4,6 +4,3 @@
[submodule "Service/openhardwaremonitor"]
path = Service/openhardwaremonitor
url = https://github.com/openhardwaremonitor/openhardwaremonitor.git
-[submodule "Window/FloatingStatusWindow"]
- path = Window/FloatingStatusWindow
- url = https://github.com/ckaczor/FloatingStatusWindow.git
diff --git a/Service/Common b/Service/Common
index 81ef8f4..686f339 160000
--- a/Service/Common
+++ b/Service/Common
@@ -1 +1 @@
-Subproject commit 81ef8f451c5ceada2ed704ecaaa789e623a7352d
+Subproject commit 686f33982df1414d062892e408318b81c0fcf0bf
diff --git a/Service/SystemTemperatureService.csproj b/Service/SystemTemperatureService.csproj
index 0e37c45..ec73d9e 100644
--- a/Service/SystemTemperatureService.csproj
+++ b/Service/SystemTemperatureService.csproj
@@ -77,7 +77,7 @@
- 2.7.2
+ 2.8.1
diff --git a/SystemTemperatureStatusWindow.sln b/SystemTemperatureStatusWindow.sln
index e2315dd..7a3d7ba 100644
--- a/SystemTemperatureStatusWindow.sln
+++ b/SystemTemperatureStatusWindow.sln
@@ -11,12 +11,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "Service\Common\Co
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenHardwareMonitorLib", "Service\openhardwaremonitor\OpenHardwareMonitorLib.csproj", "{B0397530-545A-471D-BB74-027AE456DF1A}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Native", "Window\FloatingStatusWindow\Library\Common.Wpf\Common.Native\Common.Native.csproj", "{ED1C07A1-54F5-4796-8B06-2A0BB1960D84}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Wpf", "Window\FloatingStatusWindow\Library\Common.Wpf\Common.Wpf.csproj", "{0074C983-550E-4094-9E8C-F566FB669297}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FloatingStatusWindow", "Window\FloatingStatusWindow\Library\FloatingStatusWindow.csproj", "{F023A16C-2F13-4A87-A8B7-22C43C4A58A4}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution", "Solution", "{DB32E0C0-3FEF-41DD-A898-016972B75CAF}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
@@ -74,42 +68,6 @@ Global
{B0397530-545A-471D-BB74-027AE456DF1A}.Release|x64.Build.0 = Release|Any CPU
{B0397530-545A-471D-BB74-027AE456DF1A}.Release|x86.ActiveCfg = Release|Any CPU
{B0397530-545A-471D-BB74-027AE456DF1A}.Release|x86.Build.0 = Release|Any CPU
- {ED1C07A1-54F5-4796-8B06-2A0BB1960D84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {ED1C07A1-54F5-4796-8B06-2A0BB1960D84}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {ED1C07A1-54F5-4796-8B06-2A0BB1960D84}.Debug|x64.ActiveCfg = Debug|x64
- {ED1C07A1-54F5-4796-8B06-2A0BB1960D84}.Debug|x64.Build.0 = Debug|x64
- {ED1C07A1-54F5-4796-8B06-2A0BB1960D84}.Debug|x86.ActiveCfg = Debug|x86
- {ED1C07A1-54F5-4796-8B06-2A0BB1960D84}.Debug|x86.Build.0 = Debug|x86
- {ED1C07A1-54F5-4796-8B06-2A0BB1960D84}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {ED1C07A1-54F5-4796-8B06-2A0BB1960D84}.Release|Any CPU.Build.0 = Release|Any CPU
- {ED1C07A1-54F5-4796-8B06-2A0BB1960D84}.Release|x64.ActiveCfg = Release|x64
- {ED1C07A1-54F5-4796-8B06-2A0BB1960D84}.Release|x64.Build.0 = Release|x64
- {ED1C07A1-54F5-4796-8B06-2A0BB1960D84}.Release|x86.ActiveCfg = Release|x86
- {ED1C07A1-54F5-4796-8B06-2A0BB1960D84}.Release|x86.Build.0 = Release|x86
- {0074C983-550E-4094-9E8C-F566FB669297}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0074C983-550E-4094-9E8C-F566FB669297}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0074C983-550E-4094-9E8C-F566FB669297}.Debug|x64.ActiveCfg = Debug|x64
- {0074C983-550E-4094-9E8C-F566FB669297}.Debug|x64.Build.0 = Debug|x64
- {0074C983-550E-4094-9E8C-F566FB669297}.Debug|x86.ActiveCfg = Debug|x86
- {0074C983-550E-4094-9E8C-F566FB669297}.Debug|x86.Build.0 = Debug|x86
- {0074C983-550E-4094-9E8C-F566FB669297}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0074C983-550E-4094-9E8C-F566FB669297}.Release|Any CPU.Build.0 = Release|Any CPU
- {0074C983-550E-4094-9E8C-F566FB669297}.Release|x64.ActiveCfg = Release|x64
- {0074C983-550E-4094-9E8C-F566FB669297}.Release|x64.Build.0 = Release|x64
- {0074C983-550E-4094-9E8C-F566FB669297}.Release|x86.ActiveCfg = Release|x86
- {0074C983-550E-4094-9E8C-F566FB669297}.Release|x86.Build.0 = Release|x86
- {F023A16C-2F13-4A87-A8B7-22C43C4A58A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F023A16C-2F13-4A87-A8B7-22C43C4A58A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F023A16C-2F13-4A87-A8B7-22C43C4A58A4}.Debug|x64.ActiveCfg = Debug|Any CPU
- {F023A16C-2F13-4A87-A8B7-22C43C4A58A4}.Debug|x64.Build.0 = Debug|Any CPU
- {F023A16C-2F13-4A87-A8B7-22C43C4A58A4}.Debug|x86.ActiveCfg = Debug|Any CPU
- {F023A16C-2F13-4A87-A8B7-22C43C4A58A4}.Debug|x86.Build.0 = Debug|Any CPU
- {F023A16C-2F13-4A87-A8B7-22C43C4A58A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F023A16C-2F13-4A87-A8B7-22C43C4A58A4}.Release|Any CPU.Build.0 = Release|Any CPU
- {F023A16C-2F13-4A87-A8B7-22C43C4A58A4}.Release|x64.ActiveCfg = Release|Any CPU
- {F023A16C-2F13-4A87-A8B7-22C43C4A58A4}.Release|x64.Build.0 = Release|Any CPU
- {F023A16C-2F13-4A87-A8B7-22C43C4A58A4}.Release|x86.ActiveCfg = Release|Any CPU
- {F023A16C-2F13-4A87-A8B7-22C43C4A58A4}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/Window/App.xaml.cs b/Window/App.xaml.cs
index 8f4c505..e55ba73 100644
--- a/Window/App.xaml.cs
+++ b/Window/App.xaml.cs
@@ -1,4 +1,6 @@
using FloatingStatusWindowLibrary;
+using Squirrel;
+using System;
using System.Diagnostics;
using System.Windows;
using SystemTemperatureStatusWindow.Properties;
@@ -8,6 +10,18 @@ namespace SystemTemperatureStatusWindow
public partial class App
{
private WindowSource _windowSource;
+
+ public static string UpdateUrl = "https://github.com/ckaczor/SystemTemperatureStatusWindow";
+
+ [STAThread]
+ public static void Main(string[] args)
+ {
+ SquirrelAwareApp.HandleEvents(onAppUpdate: version => Common.Settings.Extensions.RestoreSettings());
+
+ var application = new App();
+ application.InitializeComponent();
+ application.Run();
+ }
protected override void OnStartup(StartupEventArgs e)
{
@@ -15,11 +29,11 @@ namespace SystemTemperatureStatusWindow
StartManager.ManageAutoStart = true;
StartManager.AutoStartEnabled = !Debugger.IsAttached && Settings.Default.AutoStart;
- StartManager.AutoStartChanged += (value =>
+ StartManager.AutoStartChanged += value =>
{
Settings.Default.AutoStart = value;
Settings.Default.Save();
- });
+ };
_windowSource = new WindowSource();
}
diff --git a/Window/FloatingStatusWindow b/Window/FloatingStatusWindow
deleted file mode 160000
index 12ac49c..0000000
--- a/Window/FloatingStatusWindow
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 12ac49c192843bb47f35dcf986e700e049b4f97d
diff --git a/Window/Options/AboutOptionsPanel.xaml b/Window/Options/AboutOptionsPanel.xaml
new file mode 100644
index 0000000..e595aa6
--- /dev/null
+++ b/Window/Options/AboutOptionsPanel.xaml
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Window/Options/AboutOptionsPanel.xaml.cs b/Window/Options/AboutOptionsPanel.xaml.cs
new file mode 100644
index 0000000..65cf197
--- /dev/null
+++ b/Window/Options/AboutOptionsPanel.xaml.cs
@@ -0,0 +1,41 @@
+using System.Reflection;
+using System.Windows;
+
+namespace SystemTemperatureStatusWindow.Options
+{
+ public partial class AboutOptionsPanel
+ {
+ public AboutOptionsPanel()
+ {
+ InitializeComponent();
+ }
+
+ public override void LoadPanel(object data)
+ {
+ base.LoadPanel(data);
+
+ ApplicationNameLabel.Text = Properties.Resources.ApplicationName;
+
+ var version = UpdateCheck.LocalVersion.ToString();
+ VersionLabel.Text = string.Format(Properties.Resources.About_Version, version);
+
+ CompanyLabel.Text = ((AssemblyCompanyAttribute)Assembly.GetEntryAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false)[0]).Company;
+ }
+
+ public override bool ValidatePanel()
+ {
+ return true;
+ }
+
+ public override void SavePanel()
+ {
+ }
+
+ public override string CategoryName => Properties.Resources.OptionCategory_About;
+
+ private async void HandleCheckForUpdateButtonClick(object sender, RoutedEventArgs e)
+ {
+ await UpdateCheck.CheckUpdate((status, message) => UpdateMessage.Content = message);
+ }
+ }
+}
diff --git a/Window/Options/GeneralOptionsPanel.xaml b/Window/Options/GeneralOptionsPanel.xaml
new file mode 100644
index 0000000..c31949e
--- /dev/null
+++ b/Window/Options/GeneralOptionsPanel.xaml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Window/Options/GeneralOptionsPanel.xaml.cs b/Window/Options/GeneralOptionsPanel.xaml.cs
new file mode 100644
index 0000000..499873f
--- /dev/null
+++ b/Window/Options/GeneralOptionsPanel.xaml.cs
@@ -0,0 +1,39 @@
+using Common.Wpf.Extensions;
+using System.Windows;
+
+namespace SystemTemperatureStatusWindow.Options
+{
+ public partial class GeneralOptionsPanel
+ {
+ public GeneralOptionsPanel()
+ {
+ InitializeComponent();
+ }
+
+ public override void LoadPanel(object data)
+ {
+ base.LoadPanel(data);
+
+ var settings = Properties.Settings.Default;
+
+ StartWithWindows.IsChecked = settings.AutoStart;
+ }
+
+ public override bool ValidatePanel()
+ {
+ return true;
+ }
+
+ public override void SavePanel()
+ {
+ var settings = Properties.Settings.Default;
+
+ if (StartWithWindows.IsChecked.HasValue && settings.AutoStart != StartWithWindows.IsChecked.Value)
+ settings.AutoStart = StartWithWindows.IsChecked.Value;
+
+ Application.Current.SetStartWithWindows(settings.AutoStart);
+ }
+
+ public override string CategoryName => Properties.Resources.OptionCategory_General;
+ }
+}
diff --git a/Window/Properties/AssemblyInfo.cs b/Window/Properties/AssemblyInfo.cs
index 3678f36..126e9f1 100644
--- a/Window/Properties/AssemblyInfo.cs
+++ b/Window/Properties/AssemblyInfo.cs
@@ -1,55 +1,21 @@
using System.Reflection;
-using System.Resources;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
[assembly: AssemblyTitle("SystemTemperatureStatusWindow")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
+[assembly: AssemblyCompany("Chris Kaczor")]
[assembly: AssemblyProduct("SystemTemperatureStatusWindow")]
-[assembly: AssemblyCopyright("Copyright © 2014")]
+[assembly: AssemblyCopyright("Copyright © Chris Kaczor 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
-//In order to begin building localizable applications, set
-//CultureYouAreCodingWith in your .csproj file
-//inside a . For example, if you are using US english
-//in your source files, set the to en-US. Then uncomment
-//the NeutralResourceLanguage attribute below. Update the "en-US" in
-//the line below to match the UICulture setting in the project file.
+[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
-//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
-
-[assembly: ThemeInfo(
- ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
- //(used if a resource is not found in the page,
- // or application resource dictionaries)
- ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
- //(used if a resource is not found in the page,
- // app, or any theme specific resource dictionaries)
-)]
-
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
+
+[assembly: AssemblyMetadata("SquirrelAwareVersion", "1")]
\ No newline at end of file
diff --git a/Window/Properties/Resources.Designer.cs b/Window/Properties/Resources.Designer.cs
index 47c1d7d..46192f1 100644
--- a/Window/Properties/Resources.Designer.cs
+++ b/Window/Properties/Resources.Designer.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
-// Runtime Version:4.0.30319.34014
+// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -19,10 +19,10 @@ namespace SystemTemperatureStatusWindow.Properties {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources {
+ public class Resources {
private static global::System.Resources.ResourceManager resourceMan;
@@ -36,7 +36,7 @@ namespace SystemTemperatureStatusWindow.Properties {
/// Returns the cached ResourceManager instance used by this class.
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
+ public static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SystemTemperatureStatusWindow.Properties.Resources", typeof(Resources).Assembly);
@@ -51,7 +51,7 @@ namespace SystemTemperatureStatusWindow.Properties {
/// resource lookups using this strongly typed resource class.
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
+ public static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
@@ -60,20 +60,56 @@ namespace SystemTemperatureStatusWindow.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Version: {0}.
+ ///
+ public static string About_Version {
+ get {
+ return ResourceManager.GetString("About_Version", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
///
- internal static System.Drawing.Icon ApplicationIcon {
+ public static System.Drawing.Icon ApplicationIcon {
get {
object obj = ResourceManager.GetObject("ApplicationIcon", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
+ ///
+ /// Looks up a localized string similar to System Temperature Status Window.
+ ///
+ public static string ApplicationName {
+ get {
+ return ResourceManager.GetString("ApplicationName", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Checking for update....
+ ///
+ public static string CheckingForUpdate {
+ get {
+ return ResourceManager.GetString("CheckingForUpdate", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to _Check for Update.
+ ///
+ public static string CheckUpdate {
+ get {
+ return ResourceManager.GetString("CheckUpdate", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to CPU.
///
- internal static string CPU {
+ public static string CPU {
get {
return ResourceManager.GetString("CPU", resourceCulture);
}
@@ -82,16 +118,25 @@ namespace SystemTemperatureStatusWindow.Properties {
///
/// Looks up a localized string similar to {0}: <font color='{2}'>{1:f1}{3}</font>.
///
- internal static string DisplayLineTemplate {
+ public static string DisplayLineTemplate {
get {
return ResourceManager.GetString("DisplayLineTemplate", resourceCulture);
}
}
+ ///
+ /// Looks up a localized string similar to Downloading update....
+ ///
+ public static string DownloadingUpdate {
+ get {
+ return ResourceManager.GetString("DownloadingUpdate", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to GPU.
///
- internal static string GPU {
+ public static string GPU {
get {
return ResourceManager.GetString("GPU", resourceCulture);
}
@@ -100,25 +145,116 @@ namespace SystemTemperatureStatusWindow.Properties {
///
/// Looks up a localized string similar to HD{0}.
///
- internal static string HD {
+ public static string HD {
get {
return ResourceManager.GetString("HD", resourceCulture);
}
}
+ ///
+ /// Looks up a localized string similar to Installing update....
+ ///
+ public static string InstallingUpdate {
+ get {
+ return ResourceManager.GetString("InstallingUpdate", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Loading....
///
- internal static string Loading {
+ public static string Loading {
get {
return ResourceManager.GetString("Loading", resourceCulture);
}
}
+ ///
+ /// Looks up a localized string similar to No update found.
+ ///
+ public static string NoUpdate {
+ get {
+ return ResourceManager.GetString("NoUpdate", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to About.
+ ///
+ public static string OptionCategory_About {
+ get {
+ return ResourceManager.GetString("OptionCategory_About", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to General.
+ ///
+ public static string OptionCategory_General {
+ get {
+ return ResourceManager.GetString("OptionCategory_General", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Cancel.
+ ///
+ public static string OptionsWindow_CancelButton {
+ get {
+ return ResourceManager.GetString("OptionsWindow_CancelButton", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ public static System.Drawing.Icon OptionsWindow_Icon {
+ get {
+ object obj = ResourceManager.GetObject("OptionsWindow_Icon", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to OK.
+ ///
+ public static string OptionsWindow_OkayButton {
+ get {
+ return ResourceManager.GetString("OptionsWindow_OkayButton", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Options.
+ ///
+ public static string OptionsWindow_Title {
+ get {
+ return ResourceManager.GetString("OptionsWindow_Title", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Restarting application....
+ ///
+ public static string RestartingAfterUpdate {
+ get {
+ return ResourceManager.GetString("RestartingAfterUpdate", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to _Start when Windows starts.
+ ///
+ public static string StartWithWindows {
+ get {
+ return ResourceManager.GetString("StartWithWindows", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to °C.
///
- internal static string SuffixC {
+ public static string SuffixC {
get {
return ResourceManager.GetString("SuffixC", resourceCulture);
}
@@ -127,10 +263,19 @@ namespace SystemTemperatureStatusWindow.Properties {
///
/// Looks up a localized string similar to °F.
///
- internal static string SuffixF {
+ public static string SuffixF {
get {
return ResourceManager.GetString("SuffixF", resourceCulture);
}
}
+
+ ///
+ /// Looks up a localized string similar to Updating application....
+ ///
+ public static string Updating {
+ get {
+ return ResourceManager.GetString("Updating", resourceCulture);
+ }
+ }
}
}
diff --git a/Window/Properties/Resources.resx b/Window/Properties/Resources.resx
index 3776afa..f030313 100644
--- a/Window/Properties/Resources.resx
+++ b/Window/Properties/Resources.resx
@@ -142,4 +142,52 @@
°F
+
+ Checking for update...
+
+
+ _Check for Update
+
+
+ Downloading update...
+
+
+ No update found
+
+
+ Updating application...
+
+
+ Restarting application...
+
+
+ Installing update...
+
+
+ System Temperature Status Window
+
+
+ _Start when Windows starts
+
+
+ About
+
+
+ General
+
+
+ Version: {0}
+
+
+ Cancel
+
+
+ ..\Resources\ApplicationIcon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ OK
+
+
+ Options
+
\ No newline at end of file
diff --git a/Window/SystemTemperatureStatusWindow.csproj b/Window/SystemTemperatureStatusWindow.csproj
index a9b6ea0..0fd08bf 100644
--- a/Window/SystemTemperatureStatusWindow.csproj
+++ b/Window/SystemTemperatureStatusWindow.csproj
@@ -35,6 +35,52 @@
+
+ ..\packages\FloatingStatusWindow.1.0.0.9\lib\net45\Common.Native.dll
+
+
+ ..\packages\FloatingStatusWindow.1.0.0.9\lib\net45\Common.Wpf.dll
+
+
+ ..\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.dll
+
+
+ ..\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.MsDelta.dll
+
+
+ ..\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.PatchApi.dll
+
+
+ ..\packages\FloatingStatusWindow.1.0.0.9\lib\net45\FloatingStatusWindowLibrary.dll
+
+
+
+ ..\packages\TaskScheduler.2.8.1\lib\net40\Microsoft.Win32.TaskScheduler.dll
+
+
+ ..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.dll
+
+
+ ..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Mdb.dll
+
+
+ ..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Pdb.dll
+
+
+ ..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Rocks.dll
+
+
+ ..\packages\squirrel.windows.1.8.0\lib\Net45\NuGet.Squirrel.dll
+
+
+ ..\packages\SharpCompress.0.17.1\lib\net45\SharpCompress.dll
+
+
+ ..\packages\Splat.1.6.2\lib\Net45\Splat.dll
+
+
+ ..\packages\squirrel.windows.1.8.0\lib\Net45\Squirrel.dll
+
@@ -49,20 +95,35 @@
-
+
MSBuild:Compile
Designer
-
+
App.xaml
Code
+
+ AboutOptionsPanel.xaml
+
+
+ GeneralOptionsPanel.xaml
+
True
True
Reference.svcmap
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
@@ -79,9 +140,12 @@
True
- ResXFileCodeGenerator
+ PublicResXFileCodeGenerator
Resources.Designer.cs
+ Designer
+
+
SettingsSingleFileGenerator
Settings.Designer.cs
@@ -100,6 +164,7 @@
Reference.svcmap
+
@@ -129,9 +194,9 @@
-
- {f023a16c-2f13-4a87-a8b7-22c43c4a58a4}
- FloatingStatusWindow
+
+ {17864d82-457d-4a0a-bc10-1d07f2b3a5d6}
+ Common
diff --git a/Window/SystemTemperatureStatusWindow.nuspec b/Window/SystemTemperatureStatusWindow.nuspec
new file mode 100644
index 0000000..997e5f8
--- /dev/null
+++ b/Window/SystemTemperatureStatusWindow.nuspec
@@ -0,0 +1,16 @@
+
+
+
+ SystemTemperatureStatusWindow
+ System Temperature Status Window
+ $version$
+ Chris Kaczor
+ A "floating" status window that shows CPU, GPU, and HDD temperature.
+ https://github.com/ckaczor/SystemTemperatureStatusWindow
+ https://raw.githubusercontent.com/ckaczor/SystemTemperatureStatusWindow/master/LICENSE.md
+ cpu
+
+
+
+
+
diff --git a/Window/UpdateCheck.cs b/Window/UpdateCheck.cs
new file mode 100644
index 0000000..985022d
--- /dev/null
+++ b/Window/UpdateCheck.cs
@@ -0,0 +1,71 @@
+using Squirrel;
+using System;
+using System.Linq;
+using System.Net;
+using System.Reflection;
+using System.Threading.Tasks;
+
+namespace SystemTemperatureStatusWindow
+{
+ public static class UpdateCheck
+ {
+ public enum UpdateStatus
+ {
+ Checking,
+ None,
+ Downloading,
+ Installing,
+ Restarting
+ }
+
+ public delegate void UpdateStatusDelegate(UpdateStatus updateStatus, string message);
+
+ public static Version LocalVersion => Assembly.GetEntryAssembly().GetName().Version;
+
+ public static async Task CheckUpdate(UpdateStatusDelegate onUpdateStatus)
+ {
+ try
+ {
+ onUpdateStatus.Invoke(UpdateStatus.Checking, Properties.Resources.CheckingForUpdate);
+
+ ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
+
+ using (var updateManager = await UpdateManager.GitHubUpdateManager(App.UpdateUrl))
+ {
+ var updates = await updateManager.CheckForUpdate();
+
+ var lastVersion = updates?.ReleasesToApply?.OrderBy(releaseEntry => releaseEntry.Version).LastOrDefault();
+
+ if (lastVersion == null)
+ {
+ onUpdateStatus.Invoke(UpdateStatus.None, Properties.Resources.NoUpdate);
+ return false;
+ }
+
+ onUpdateStatus.Invoke(UpdateStatus.Downloading, Properties.Resources.DownloadingUpdate);
+
+ Common.Settings.Extensions.BackupSettings();
+
+ await updateManager.DownloadReleases(new[] { lastVersion });
+
+ onUpdateStatus.Invoke(UpdateStatus.Installing, Properties.Resources.InstallingUpdate);
+
+ await updateManager.ApplyReleases(updates);
+ await updateManager.UpdateApp();
+ }
+
+ onUpdateStatus.Invoke(UpdateStatus.Restarting, Properties.Resources.RestartingAfterUpdate);
+
+ UpdateManager.RestartApp();
+
+ return true;
+ }
+ catch (Exception exception)
+ {
+ Console.WriteLine(exception);
+
+ return false;
+ }
+ }
+ }
+}
diff --git a/Window/WindowSource.cs b/Window/WindowSource.cs
index 38e18bb..e5ab3e8 100644
--- a/Window/WindowSource.cs
+++ b/Window/WindowSource.cs
@@ -1,29 +1,91 @@
using FloatingStatusWindowLibrary;
+using Microsoft.Win32.TaskScheduler;
using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Reflection;
using System.Text;
+using System.Threading.Tasks;
using System.Timers;
using System.Windows.Threading;
+using SystemTemperatureStatusWindow.Options;
using SystemTemperatureStatusWindow.Properties;
using SystemTemperatureStatusWindow.SystemTemperatureService;
+using Common.Wpf.Windows;
+using Task = Microsoft.Win32.TaskScheduler.Task;
namespace SystemTemperatureStatusWindow
{
public class WindowSource : IWindowSource, IDisposable
{
+ private const string ScheduledTaskName = "SystemTemperatureService";
+
private readonly FloatingStatusWindow _floatingStatusWindow;
private readonly Timer _refreshTimer;
private readonly Dispatcher _dispatcher;
+ private CategoryWindow _optionsWindow;
+
internal WindowSource()
{
_dispatcher = Dispatcher.CurrentDispatcher;
+ try
+ {
+ using (var taskService = new TaskService())
+ {
+ var existingTask = taskService.FindTask(ScheduledTaskName);
+
+ if (existingTask == null)
+ {
+ var assembly = Assembly.GetExecutingAssembly();
+
+ var path = Path.GetDirectoryName(assembly.Location);
+
+ if (path != null)
+ {
+ var fileName = Path.Combine(path, "SystemTemperatureService.exe");
+
+ Process.Start(fileName, "-install");
+ }
+ }
+ }
+ }
+ catch (Exception)
+ {
+ // Ignored
+ }
+
_floatingStatusWindow = new FloatingStatusWindow(this);
_floatingStatusWindow.SetText(Resources.Loading);
_refreshTimer = new Timer(Settings.Default.UpdateInterval) { AutoReset = false };
_refreshTimer.Elapsed += HandleTimerElapsed;
- _refreshTimer.Start();
+
+
+ System.Threading.Tasks.Task.Factory.StartNew(UpdateApp).ContinueWith(task => StartUpdate(task.Result.Result));
+ }
+
+ private void StartUpdate(bool updateRequired)
+ {
+ if (updateRequired)
+ return;
+
+ System.Threading.Tasks.Task.Factory.StartNew(() => _refreshTimer.Start());
+ }
+
+ private async Task UpdateApp()
+ {
+ return await UpdateCheck.CheckUpdate(HandleUpdateStatus);
+ }
+
+ private void HandleUpdateStatus(UpdateCheck.UpdateStatus status, string message)
+ {
+ if (status == UpdateCheck.UpdateStatus.None)
+ message = Resources.Loading;
+
+ _dispatcher.Invoke(() => _floatingStatusWindow.SetText(message));
}
private void HandleTimerElapsed(object sender, ElapsedEventArgs e)
@@ -119,12 +181,36 @@ namespace SystemTemperatureStatusWindow
_refreshTimer.Start();
}
+ public void ShowAbout()
+ {
+ }
+
public string Name => "System Temperature";
public System.Drawing.Icon Icon => Resources.ApplicationIcon;
public void ShowSettings()
{
+ var panels = new List
+ {
+ new GeneralOptionsPanel(),
+ new AboutOptionsPanel()
+ };
+
+ if (_optionsWindow == null)
+ {
+ _optionsWindow = new CategoryWindow(null, panels, Resources.ResourceManager, "OptionsWindow");
+ _optionsWindow.Closed += (o, args) => { _optionsWindow = null; };
+ }
+
+ var dialogResult = _optionsWindow.ShowDialog();
+
+ if (dialogResult.HasValue && dialogResult.Value)
+ {
+ Settings.Default.Save();
+
+ Refresh();
+ }
}
public void Refresh()
@@ -132,8 +218,9 @@ namespace SystemTemperatureStatusWindow
Update();
}
- public bool HasSettingsMenu => false;
+ public bool HasSettingsMenu => true;
public bool HasRefreshMenu => true;
+ public bool HasAboutMenu => false;
public string WindowSettings
{
diff --git a/Window/appveyor.yml b/Window/appveyor.yml
new file mode 100644
index 0000000..feb9b80
--- /dev/null
+++ b/Window/appveyor.yml
@@ -0,0 +1,31 @@
+version: 1.0.{build}
+pull_requests:
+ do_not_increment_build_number: true
+skip_tags: true
+image: Visual Studio 2017
+configuration: Release
+assembly_info:
+ patch: true
+ file: 'Properties\AssemblyInfo.cs'
+ assembly_version: '{version}'
+ assembly_file_version: '{version}'
+build:
+ project: SystemTemperatureStatusWindow.sln
+ verbosity: minimal
+after_build:
+- ps: >-
+ nuget pack SystemTemperatureStatusWindow.nuspec -Version $env:APPVEYOR_BUILD_VERSION -Properties Configuration=Release -OutputDirectory bin\Release\
+
+ $squirrel = "..\packages\squirrel.windows.*\tools\Squirrel.exe"
+
+ .$squirrel -releasify ".\bin\$env:CONFIGURATION\SystemTemperatureStatusWindow.$env:APPVEYOR_BUILD_VERSION.nupkg" | Write-Output
+artifacts:
+- path: Releases\*
+ name: Releases
+deploy:
+- provider: Environment
+ name: GitHub
+install:
+- cmd: git submodule update --init --recursive
+before_build:
+- cmd: nuget restore
\ No newline at end of file
diff --git a/Window/packages.config b/Window/packages.config
new file mode 100644
index 0000000..c071638
--- /dev/null
+++ b/Window/packages.config
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file