Initial commit

This commit is contained in:
Holger Boerchers
2018-03-21 20:07:40 +01:00
commit d383f0ef1c
77 changed files with 7050 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
using System;
using System.IO;
using System.Net;
using System.Threading.Tasks;
namespace Katteker.Gui
{
internal static class ChangelogHelper
{
private static string GenerateHtmlifyChangelog(string text, string extension)
{
string result;
switch (extension)
{
case ".txt":
var plainText = WebUtility.HtmlEncode(text);
result = plainText.Replace(Environment.NewLine, "<br />");
break;
case ".md":
result = CommonMark.CommonMarkConverter.Convert(text);
break;
default:
result = text;
break;
}
return result;
}
internal static async Task<string> LoadChangelogAsync(string filename, string path)
{
if (!string.IsNullOrEmpty(filename) || !string.IsNullOrEmpty(path))
{
if (!path.EndsWith("/", StringComparison.Ordinal))
path += "/";
var webReq = WebRequest.Create(path + filename);
try
{
using (var response = await webReq.GetResponseAsync().ConfigureAwait(false))
using (var sr = new StreamReader(response.GetResponseStream()))
{
return GenerateHtmlifyChangelog(await sr.ReadToEndAsync().ConfigureAwait(false),
Path.GetExtension(filename));
}
}
catch (WebException)
{
var changelogFilename = Path.GetFileName(filename);
if (changelogFilename == null) return GenerateHtmlifyChangelog("Changelog not found", ".txt");
var currentChangelogPath = Path.Combine(Environment.CurrentDirectory, changelogFilename);
if (File.Exists(currentChangelogPath))
{
return GenerateHtmlifyChangelog(File.ReadAllText(currentChangelogPath), Path.GetExtension(filename));
}
}
}
return GenerateHtmlifyChangelog("Changelog not found", ".txt");
}
}
}

View File

@@ -0,0 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{07E2DE31-80A0-43DA-B307-1CA47CD930A1}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Katteker.Gui</RootNamespace>
<AssemblyName>Katteker.Gui</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\Katteker.Gui.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Katteker.Gui.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="CommonMark, Version=0.1.0.0, Culture=neutral, PublicKeyToken=001ef8810438905d, processorArchitecture=MSIL">
<HintPath>..\packages\CommonMark.NET.0.15.1\lib\net45\CommonMark.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ChangelogHelper.cs" />
<Compile Include="Wrapper.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="UpdateWindow.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UpdateWindow.Designer.cs">
<DependentUpon>UpdateWindow.cs</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="UpdateWindow.resx">
<DependentUpon>UpdateWindow.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Katteker\Katteker.csproj">
<Project>{a45e1c59-ba9e-452c-a5e2-50de49d53e92}</Project>
<Name>Katteker</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<package >
<metadata>
<id>$id$</id>
<version>$version$</version>
<title>$id$</title>
<authors>$author$</authors>
<owners>$author$</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>$description$</description>
<copyright>Copyright 2017</copyright>
<dependencies>
<dependency id="squirrel.windows" version="[1.7.9]" />
</dependencies>
</metadata>
<files>
</files>
</package>

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.InteropServices;
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die mit einer Assembly verknüpft sind.
[assembly: AssemblyTitle("Katteker.Gui")]
[assembly: AssemblyDescription("Helps Applications to integrate Katteker")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("WRD GmbH")]
[assembly: AssemblyProduct("Katteker.Gui")]
[assembly: AssemblyCopyright("Copyright © Enercon GmbH 2015-2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.
[assembly: ComVisible(false)]
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[assembly: Guid("4877208f-00bf-42b7-a56b-bf8bf4a0d3c8")]
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
// Hauptversion
// Nebenversion
// Buildnummer
// Revision
//
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]

View File

@@ -0,0 +1,144 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Katteker.Gui.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// 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", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Katteker.Gui.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to Installed new Version! Would you like to restart the Application?.
/// </summary>
internal static string Installed_new_Version {
get {
return ResourceManager.GetString("Installed_new_Version", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to New Version.
/// </summary>
internal static string New_Version {
get {
return ResourceManager.GetString("New_Version", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to No update available..
/// </summary>
internal static string No_update_available {
get {
return ResourceManager.GetString("No_update_available", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Can&apos;t find configuration File. Ask your local distributor..
/// </summary>
internal static string SquirrelWrapper_CheckForUpdate {
get {
return ResourceManager.GetString("SquirrelWrapper_CheckForUpdate", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Ask your local distributor..
/// </summary>
internal static string SquirrelWrapper_CheckForUpdate_AskYourLocalDistributor {
get {
return ResourceManager.GetString("SquirrelWrapper_CheckForUpdate_AskYourLocalDistributor", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Error with Configuration-File.
/// </summary>
internal static string SquirrelWrapper_CheckForUpdate_Error {
get {
return ResourceManager.GetString("SquirrelWrapper_CheckForUpdate_Error", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Error with Update.
/// </summary>
internal static string SquirrelWrapper_CheckForUpdate_ErrorWithUpdate {
get {
return ResourceManager.GetString("SquirrelWrapper_CheckForUpdate_ErrorWithUpdate", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to You can update to Version: .
/// </summary>
internal static string You_can_update_to_Version {
get {
return ResourceManager.GetString("You_can_update_to_Version", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to You&apos;re up to date..
/// </summary>
internal static string You_re_up_to_date {
get {
return ResourceManager.GetString("You_re_up_to_date", resourceCulture);
}
}
}
}

View File

@@ -0,0 +1,147 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Installed_new_Version" xml:space="preserve">
<value>Installed new Version! Would you like to restart the Application?</value>
</data>
<data name="New_Version" xml:space="preserve">
<value>New Version</value>
</data>
<data name="You_re_up_to_date" xml:space="preserve">
<value>You're up to date.</value>
</data>
<data name="You_can_update_to_Version" xml:space="preserve">
<value>You can update to Version: </value>
</data>
<data name="No_update_available" xml:space="preserve">
<value>No update available.</value>
</data>
<data name="SquirrelWrapper_CheckForUpdate" xml:space="preserve">
<value>Can't find configuration File. Ask your local distributor.</value>
</data>
<data name="SquirrelWrapper_CheckForUpdate_Error" xml:space="preserve">
<value>Error with Configuration-File</value>
</data>
<data name="SquirrelWrapper_CheckForUpdate_ErrorWithUpdate" xml:space="preserve">
<value>Error with Update</value>
</data>
<data name="SquirrelWrapper_CheckForUpdate_AskYourLocalDistributor" xml:space="preserve">
<value> Ask your local distributor.</value>
</data>
</root>

314
Katteker.Gui/UpdateWindow.Designer.cs generated Normal file
View File

@@ -0,0 +1,314 @@
using System;
namespace Katteker.Gui
{
/// <summary>
/// Shows the Update Window.
/// </summary>
sealed partial class UpdateWindow
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
[STAThread]
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UpdateWindow));
this.mainSplitContainer = new System.Windows.Forms.SplitContainer();
this.titleLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
this.closeWindowBtn = new System.Windows.Forms.Button();
this.maximizeBtn = new System.Windows.Forms.Button();
this.titlebar = new System.Windows.Forms.Label();
this.minimizeBtn = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.splitContainer3 = new System.Windows.Forms.SplitContainer();
this.changelogBrowser = new System.Windows.Forms.WebBrowser();
this.progressBar1 = new System.Windows.Forms.ProgressBar();
this.closeBtn = new System.Windows.Forms.Button();
this.updBtn = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
((System.ComponentModel.ISupportInitialize)(this.mainSplitContainer)).BeginInit();
this.mainSplitContainer.Panel1.SuspendLayout();
this.mainSplitContainer.Panel2.SuspendLayout();
this.mainSplitContainer.SuspendLayout();
this.titleLayoutPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit();
this.splitContainer3.Panel1.SuspendLayout();
this.splitContainer3.Panel2.SuspendLayout();
this.splitContainer3.SuspendLayout();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// mainSplitContainer
//
this.mainSplitContainer.BackColor = System.Drawing.SystemColors.Control;
this.mainSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
this.mainSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.mainSplitContainer.IsSplitterFixed = true;
this.mainSplitContainer.Location = new System.Drawing.Point(1, 1);
this.mainSplitContainer.Name = "mainSplitContainer";
this.mainSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// mainSplitContainer.Panel1
//
this.mainSplitContainer.Panel1.Controls.Add(this.titleLayoutPanel);
this.mainSplitContainer.Panel1MinSize = 30;
//
// mainSplitContainer.Panel2
//
this.mainSplitContainer.Panel2.Controls.Add(this.splitContainer3);
this.mainSplitContainer.Size = new System.Drawing.Size(698, 438);
this.mainSplitContainer.SplitterDistance = 30;
this.mainSplitContainer.TabIndex = 7;
this.mainSplitContainer.TabStop = false;
//
// titleLayoutPanel
//
this.titleLayoutPanel.BackColor = System.Drawing.SystemColors.ControlDarkDark;
this.titleLayoutPanel.ColumnCount = 5;
this.titleLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F));
this.titleLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.titleLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 40F));
this.titleLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 40F));
this.titleLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 40F));
this.titleLayoutPanel.Controls.Add(this.closeWindowBtn, 4, 0);
this.titleLayoutPanel.Controls.Add(this.maximizeBtn, 3, 0);
this.titleLayoutPanel.Controls.Add(this.titlebar, 1, 0);
this.titleLayoutPanel.Controls.Add(this.minimizeBtn, 2, 0);
this.titleLayoutPanel.Controls.Add(this.label1, 0, 0);
this.titleLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.titleLayoutPanel.Location = new System.Drawing.Point(0, 0);
this.titleLayoutPanel.Name = "titleLayoutPanel";
this.titleLayoutPanel.RowCount = 1;
this.titleLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.titleLayoutPanel.Size = new System.Drawing.Size(698, 30);
this.titleLayoutPanel.TabIndex = 0;
this.titleLayoutPanel.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Titlebar_MouseDown);
//
// closeWindowBtn
//
this.closeWindowBtn.Dock = System.Windows.Forms.DockStyle.Fill;
this.closeWindowBtn.FlatAppearance.BorderSize = 0;
this.closeWindowBtn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
this.closeWindowBtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Red;
this.closeWindowBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.closeWindowBtn.Font = new System.Drawing.Font("Segoe UI Symbol", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.closeWindowBtn.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.closeWindowBtn.Location = new System.Drawing.Point(658, 0);
this.closeWindowBtn.Margin = new System.Windows.Forms.Padding(0);
this.closeWindowBtn.Name = "closeWindowBtn";
this.closeWindowBtn.Size = new System.Drawing.Size(40, 30);
this.closeWindowBtn.TabIndex = 3;
this.closeWindowBtn.TabStop = false;
this.closeWindowBtn.Text = "";
this.closeWindowBtn.UseVisualStyleBackColor = true;
this.closeWindowBtn.Click += new System.EventHandler(this.CloseBtn_Click);
//
// maximizeBtn
//
this.maximizeBtn.Dock = System.Windows.Forms.DockStyle.Fill;
this.maximizeBtn.FlatAppearance.BorderSize = 0;
this.maximizeBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.maximizeBtn.Font = new System.Drawing.Font("Segoe UI Symbol", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.maximizeBtn.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.maximizeBtn.Location = new System.Drawing.Point(618, 0);
this.maximizeBtn.Margin = new System.Windows.Forms.Padding(0);
this.maximizeBtn.Name = "maximizeBtn";
this.maximizeBtn.Size = new System.Drawing.Size(40, 30);
this.maximizeBtn.TabIndex = 2;
this.maximizeBtn.TabStop = false;
this.maximizeBtn.Text = "□";
this.maximizeBtn.UseVisualStyleBackColor = true;
this.maximizeBtn.Click += new System.EventHandler(this.MaximizeBtn_Click);
//
// titlebar
//
this.titlebar.Dock = System.Windows.Forms.DockStyle.Fill;
this.titlebar.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.titlebar.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.titlebar.Location = new System.Drawing.Point(123, 0);
this.titlebar.Name = "titlebar";
this.titlebar.Size = new System.Drawing.Size(452, 30);
this.titlebar.TabIndex = 0;
this.titlebar.Text = "titleBar";
this.titlebar.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.titlebar.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Titlebar_MouseDown);
//
// minimizeBtn
//
this.minimizeBtn.Dock = System.Windows.Forms.DockStyle.Fill;
this.minimizeBtn.FlatAppearance.BorderSize = 0;
this.minimizeBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.minimizeBtn.Font = new System.Drawing.Font("Segoe UI Symbol", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.minimizeBtn.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.minimizeBtn.Location = new System.Drawing.Point(578, 0);
this.minimizeBtn.Margin = new System.Windows.Forms.Padding(0);
this.minimizeBtn.Name = "minimizeBtn";
this.minimizeBtn.Size = new System.Drawing.Size(40, 30);
this.minimizeBtn.TabIndex = 1;
this.minimizeBtn.TabStop = false;
this.minimizeBtn.Text = "—";
this.minimizeBtn.UseVisualStyleBackColor = true;
this.minimizeBtn.Click += new System.EventHandler(this.MinimizeBtn_Click);
//
// label1
//
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
this.label1.Font = new System.Drawing.Font("Segoe UI Symbol", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.ForeColor = System.Drawing.SystemColors.Window;
this.label1.Location = new System.Drawing.Point(3, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(114, 30);
this.label1.TabIndex = 4;
this.label1.Text = "⛽";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// splitContainer3
//
this.splitContainer3.BackColor = System.Drawing.SystemColors.Control;
this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer3.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
this.splitContainer3.IsSplitterFixed = true;
this.splitContainer3.Location = new System.Drawing.Point(0, 0);
this.splitContainer3.Name = "splitContainer3";
this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer3.Panel1
//
this.splitContainer3.Panel1.Controls.Add(this.changelogBrowser);
//
// splitContainer3.Panel2
//
this.splitContainer3.Panel2.Controls.Add(this.progressBar1);
this.splitContainer3.Panel2.Controls.Add(this.closeBtn);
this.splitContainer3.Panel2.Controls.Add(this.updBtn);
this.splitContainer3.Size = new System.Drawing.Size(698, 404);
this.splitContainer3.SplitterDistance = 344;
this.splitContainer3.TabIndex = 7;
this.splitContainer3.TabStop = false;
//
// changelogBrowser
//
this.changelogBrowser.AllowNavigation = false;
this.changelogBrowser.AllowWebBrowserDrop = false;
this.changelogBrowser.Dock = System.Windows.Forms.DockStyle.Fill;
this.changelogBrowser.IsWebBrowserContextMenuEnabled = false;
this.changelogBrowser.Location = new System.Drawing.Point(0, 0);
this.changelogBrowser.MinimumSize = new System.Drawing.Size(19, 18);
this.changelogBrowser.Name = "changelogBrowser";
this.changelogBrowser.ScriptErrorsSuppressed = true;
this.changelogBrowser.Size = new System.Drawing.Size(698, 344);
this.changelogBrowser.TabIndex = 7;
this.changelogBrowser.TabStop = false;
this.changelogBrowser.WebBrowserShortcutsEnabled = false;
//
// progressBar1
//
this.progressBar1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.progressBar1.Location = new System.Drawing.Point(12, 14);
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(487, 30);
this.progressBar1.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
this.progressBar1.TabIndex = 4;
this.progressBar1.Visible = false;
//
// closeBtn
//
this.closeBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.closeBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(253)))));
this.closeBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.closeBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(171)))), ((int)(((byte)(171)))));
this.closeBtn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(192)))), ((int)(((byte)(224)))));
this.closeBtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(230)))), ((int)(((byte)(247)))));
this.closeBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.closeBtn.ForeColor = System.Drawing.SystemColors.ControlText;
this.closeBtn.Location = new System.Drawing.Point(507, 14);
this.closeBtn.Name = "closeBtn";
this.closeBtn.Size = new System.Drawing.Size(179, 30);
this.closeBtn.TabIndex = 7;
this.closeBtn.Text = "Close";
this.closeBtn.UseVisualStyleBackColor = false;
//
// updBtn
//
this.updBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.updBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(253)))));
this.updBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(171)))), ((int)(((byte)(171)))));
this.updBtn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(192)))), ((int)(((byte)(224)))));
this.updBtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(230)))), ((int)(((byte)(247)))));
this.updBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.updBtn.Location = new System.Drawing.Point(13, 14);
this.updBtn.Name = "updBtn";
this.updBtn.Size = new System.Drawing.Size(486, 30);
this.updBtn.TabIndex = 5;
this.updBtn.Text = "Update";
this.updBtn.UseVisualStyleBackColor = false;
this.updBtn.Visible = false;
this.updBtn.Click += new System.EventHandler(this.UpdBtn_Click);
//
// panel1
//
this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(131)))), ((int)(((byte)(131)))), ((int)(((byte)(131)))));
this.panel1.Controls.Add(this.mainSplitContainer);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Margin = new System.Windows.Forms.Padding(10);
this.panel1.Name = "panel1";
this.panel1.Padding = new System.Windows.Forms.Padding(1);
this.panel1.Size = new System.Drawing.Size(700, 440);
this.panel1.TabIndex = 8;
//
// UpdateWindow
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(700, 440);
this.ControlBox = false;
this.Controls.Add(this.panel1);
this.DoubleBuffered = true;
this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "UpdateWindow";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Load += new System.EventHandler(this.UpdateWindow_Load);
this.mainSplitContainer.Panel1.ResumeLayout(false);
this.mainSplitContainer.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.mainSplitContainer)).EndInit();
this.mainSplitContainer.ResumeLayout(false);
this.titleLayoutPanel.ResumeLayout(false);
this.splitContainer3.Panel1.ResumeLayout(false);
this.splitContainer3.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit();
this.splitContainer3.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.SplitContainer mainSplitContainer;
private System.Windows.Forms.SplitContainer splitContainer3;
private System.Windows.Forms.WebBrowser changelogBrowser;
private System.Windows.Forms.Button closeBtn;
private System.Windows.Forms.Button updBtn;
private System.Windows.Forms.ProgressBar progressBar1;
private System.Windows.Forms.TableLayoutPanel titleLayoutPanel;
private System.Windows.Forms.Label titlebar;
private System.Windows.Forms.Button closeWindowBtn;
private System.Windows.Forms.Button maximizeBtn;
private System.Windows.Forms.Button minimizeBtn;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label label1;
}
}

View File

@@ -0,0 +1,146 @@
using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using Katteker.Gui.Properties;
namespace Katteker.Gui
{
public sealed partial class UpdateWindow : Form
{
private const int HTCAPTION = 0x2;
private const int WM_NCLBUTTONDOWN = 0xA1;
/// <summary>
/// The Update Window
/// </summary>
public UpdateWindow()
{
Font = SystemFonts.MessageBoxFont;
Application.EnableVisualStyles();
if (Environment.OSVersion.Version.Major >= 6)
SetProcessDPIAware();
InitializeComponent();
}
private string Changelog => UpdateManager.ChangelogFilename;
/// <summary>
/// Last release entry.
/// </summary>
public ReleaseEntry ReleaseEntry { get; set; }
/// <summary>
/// Update manager
/// </summary>
public UpdateManager UpdateManager { get; set; }
private string PublishPath => UpdateManager.UrlOrPath;
/// <inheritdoc />
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing)
{
components?.Dispose();
}
base.Dispose(disposing);
}
[DllImport("User32.dll")]
private static extern bool ReleaseCapture();
[DllImport("User32.dll")]
private static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
[DllImport("user32.dll")]
private static extern bool SetProcessDPIAware();
private void CloseBtn_Click(object sender, EventArgs e)
{
Close();
}
private void MaximizeBtn_Click(object sender, EventArgs e)
{
WindowState = WindowState != FormWindowState.Maximized ? FormWindowState.Maximized : FormWindowState.Normal;
}
private void MinimizeBtn_Click(object sender, EventArgs e)
{
WindowState = FormWindowState.Minimized;
}
private void Titlebar_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons.Left) return;
ReleaseCapture();
SendMessage(Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0);
}
private async void UpdateWindow_Load(object sender, EventArgs e)
{
var changelog = await ChangelogHelper.LoadChangelogAsync(Changelog, PublishPath).ConfigureAwait(false);
Invoke(new Action(() => changelogBrowser.DocumentText = changelog));
if (ReleaseEntry == null)
{
Invoke(new Action(() => { WriteTitle(Resources.No_update_available); }));
}
else
{
var latest = ReleaseEntry.Version;
Invoke(new Action(() =>
{
WriteTitle(Resources.You_can_update_to_Version + latest);
updBtn.Visible = true;
}));
}
}
private async void UpdBtn_Click(object sender, EventArgs e)
{
Invoke(new Action(() => progressBar1.Visible = true));
try
{
var progress = new Progress<int>(x => Invoke(new Action(() => { progressBar1.Value = x; })));
await UpdateManager.UpdateAppAsync(progress).ConfigureAwait(false);
WriteTitle(Resources.You_re_up_to_date);
}
catch (Exception ex)
{
WriteTitle(ex.Message);
}
finally
{
Invoke(new Action(() =>
{
progressBar1.Visible = false;
updBtn.Visible = false;
var messResult = MessageBox.Show(
Resources.Installed_new_Version,
Resources.New_Version,
MessageBoxButtons.YesNo,
MessageBoxIcon.Question);
if (messResult == DialogResult.Yes)
{
DialogResult = DialogResult.OK;
Close();
}
}));
}
}
private void WriteTitle(string text)
{
Invoke(new Action(() =>
{
Text = text;
titlebar.Text = text;
}));
}
}
}

View File

@@ -0,0 +1,197 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABYYGwFCSVQrTlloXjZEUYFIV2iiUmqFt1h2
m8o1UHHcEShHPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFhgcBiQuPs5khK7/fajd/3up
4P94q+b/fa3p/0Jml/8NIkVQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEB80eUdy
qv9+rOj/eqfg/3Sk3f96p+D/SG2f/xMZKWMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAMGS45OWCR/1yOzf9Gdar/SXyr/0uBtP85bqT/IUBk3ilBU2JzhZU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+76ez/1P///3+f
rda5upINAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADD0KwKaIOVv7Dj7f/f////XHF4/yki
Yv8vK2L/LS5m/ykjVP+yr7X//////5yan/+Mk5T/mqWq/3qMlP95lKL/gZqp/32Po/9JVWn/ZG9u/837
/P/S////hay3/7i5lVEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHiOkn2YwtT/2////8fm
6v85Q1//Ni15/zYzeP8yMX7/KiNe/0pMUv+To5n/k6+2/7vc3v+339f/xPXv/9r////Z////2f///6DG
w/+22d7/2v///8X4/f9ehZvPubuYAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACYnpg7apO398//
///T////p8bM/y8sX/8/MH3/NTBx/zAmXP9bZHv/psbK/8z4+f/Y////jau2/3B7ov98gqf/hZWd/7/m
4f/a////xe30/8L7/f/a////eqfG/3WEk4EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGR3
lbWw5/L/0v///9P///+Jp67/Lydl/zgubP8xOFv/kKmx/9T++//N////1v///6S8wf97d6r/trD//7Wv
//+gm+H/X3GM/7DY3v/N/Pn/1////4691/9Nboa3xMKtBgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALTF
mw2Ln5NQfqPD/9P////N+f//2f///3WKlP8rImH/Nz5m/6zN0P/a////yfv//8z7///N9uj/cn6d/7Wx
+v+srPj/n5ve/3t3ov9JWoD/W4i0/2aax/9chrf/UnKM1K64lRoAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAmpuYUnOEmKuv3+n/z/7//8z8/P/a////b3iN/yYpS/+iw87/1////8z8/P/O/P3/2P///5i9
0P9SXoT/doOz/19rkf9IS2D/Z2ls/5GWnP91gpr/ZJDE/0hytf+KlYiDAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAABje5eGbY6k2cX9/v/P/f//yfj7/5/Awv8+SVL/bH2B/+D////J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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJadk0xUgLX/cp3a/3Wh2v9ReqLWcHuVBwAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtr+jJENtlehZjdH/VH22/3uU
l38AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg6KaP3KG
jb2MnJd0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAA/wB///8Af///gH///4Af//+AA///AAD//gAAf/4AAD/8AAAf+AAAD/AA
AA/wAAAP4AAAH+AAAB+AAAA/gAAAf4AAAH+AAAB/gAAAP4AAAD/AAAAH8AAAA/gAAAH/gAAB/4ABgf/A
A///wA///8H////A////wP///8H////j//8=
</value>
</data>
</root>

60
Katteker.Gui/Wrapper.cs Normal file
View File

@@ -0,0 +1,60 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using Katteker.Gui.Properties;
namespace Katteker.Gui
{
/// <summary>
/// The wrapper to add Squirrel-capability to older Programs.
/// </summary>
public static class Wrapper
{
/// <summary>
/// Checks for Updates.
/// </summary>
/// <returns>Task</returns>
public static Task CheckForUpdateAsync() => CheckForUpdateAsync(false);
/// <summary>
/// Checks for Updates.
/// </summary>
/// <param name="isStartup">Is this Method called on Startup of the Program.</param>
/// <returns>Task</returns>
public static async Task CheckForUpdateAsync(bool isStartup)
{
using (var window = new UpdateWindow())
{
var dialogResult = DialogResult.Cancel;
if (!UpdateManager.TryCreate(out var manager) && !isStartup)
{
MessageBox.Show(Resources.SquirrelWrapper_CheckForUpdate,
Resources.SquirrelWrapper_CheckForUpdate_Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
var releases = (await manager.CheckForUpdateAsync().ConfigureAwait(true)).ToArray();
window.UpdateManager = manager;
window.ReleaseEntry = releases.LastOrDefault();
if (isStartup)
{
if (releases?.Any() == true)
{
dialogResult = window.ShowDialog();
}
}
else
{
dialogResult = window.ShowDialog();
}
if (dialogResult == DialogResult.OK)
{
manager.RestartApp();
}
}
}
}
}

23
Katteker.Gui/app.config Normal file
View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="NuGet.Core" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.8.50926.602" newVersion="2.8.50926.602" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Mono.Cecil" publicKeyToken="0738eb9f132ed756" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.9.5.0" newVersion="0.9.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="DeltaCompressionDotNet.MsDelta" publicKeyToken="46b2138a390abf55" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="SharpCompress" publicKeyToken="afb0a02973931d96" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.19.2.0" newVersion="0.19.2.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="CommonMark.NET" version="0.15.1" targetFramework="net45" />
</packages>