From 728d82664323ccc913626496400c27949a1bdf5c Mon Sep 17 00:00:00 2001 From: Sparronator9999 <86388887+Sparronator9999@users.noreply.github.com> Date: Mon, 9 Dec 2024 21:04:03 +1100 Subject: [PATCH] About dialog overhaul + new version string system - Add brand-new About dialog - Rename "SNAPSHOT" builds to "dev" - Only show commit hash in version string if running a dev build, otherwise just show the program version, and beta/RC/etc. suffix if set - Remove unused Strings.cs function --- YAMDCC.Config/YAMDCC.Config.csproj | 2 +- .../Dialogs/VersionDialog.Designer.cs | 262 ++++++++++++++++++ YAMDCC.ConfigEditor/Dialogs/VersionDialog.cs | 68 +++++ .../Dialogs/VersionDialog.resx | 221 +++++++++++++++ YAMDCC.ConfigEditor/MainWindow.cs | 5 +- YAMDCC.ConfigEditor/Strings.cs | 12 - YAMDCC.ConfigEditor/Strings.resx | 25 +- YAMDCC.ConfigEditor/Utils.cs | 63 ++++- .../YAMDCC.ConfigEditor.csproj | 2 +- YAMDCC.ECAccess/YAMDCC.ECAccess.csproj | 2 +- YAMDCC.IPC/YAMDCC.IPC.csproj | 3 +- YAMDCC.Logs/YAMDCC.Logs.csproj | 2 +- YAMDCC.Service/YAMDCC.Service.csproj | 2 +- 13 files changed, 626 insertions(+), 43 deletions(-) create mode 100644 YAMDCC.ConfigEditor/Dialogs/VersionDialog.Designer.cs create mode 100644 YAMDCC.ConfigEditor/Dialogs/VersionDialog.cs create mode 100644 YAMDCC.ConfigEditor/Dialogs/VersionDialog.resx diff --git a/YAMDCC.Config/YAMDCC.Config.csproj b/YAMDCC.Config/YAMDCC.Config.csproj index d57050e..a831e74 100644 --- a/YAMDCC.Config/YAMDCC.Config.csproj +++ b/YAMDCC.Config/YAMDCC.Config.csproj @@ -13,7 +13,7 @@ net48 YAMDCC config library 0.6.9.420 - SNAPSHOT + dev none diff --git a/YAMDCC.ConfigEditor/Dialogs/VersionDialog.Designer.cs b/YAMDCC.ConfigEditor/Dialogs/VersionDialog.Designer.cs new file mode 100644 index 0000000..9372bc4 --- /dev/null +++ b/YAMDCC.ConfigEditor/Dialogs/VersionDialog.Designer.cs @@ -0,0 +1,262 @@ +// This file is part of YAMDCC (Yet Another MSI Dragon Center Clone). +// Copyright © Sparronator9999 2023-2024. +// +// YAMDCC is free software: you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation, either version 3 of the License, or (at your option) +// any later version. +// +// YAMDCC is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +// more details. +// +// You should have received a copy of the GNU General Public License along with +// YAMDCC. If not, see . + +namespace YAMDCC.ConfigEditor.Dialogs +{ + partial class VersionDialog + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.Windows.Forms.PictureBox picLogo; + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(VersionDialog)); + System.Windows.Forms.Label lblTitle; + System.Windows.Forms.Label lblSubtitle; + System.Windows.Forms.TableLayoutPanel tblMain; + System.Windows.Forms.FlowLayoutPanel flwLinks; + System.Windows.Forms.Button btnLicense; + System.Windows.Forms.Button btnSource; + System.Windows.Forms.Button btnFAQ; + System.Windows.Forms.Button btnIssues; + this.lblVersion = new System.Windows.Forms.Label(); + this.lblCopyright = new System.Windows.Forms.Label(); + this.lblDesc = new System.Windows.Forms.Label(); + this.lblRevision = new System.Windows.Forms.Label(); + picLogo = new System.Windows.Forms.PictureBox(); + lblTitle = new System.Windows.Forms.Label(); + lblSubtitle = new System.Windows.Forms.Label(); + tblMain = new System.Windows.Forms.TableLayoutPanel(); + flwLinks = new System.Windows.Forms.FlowLayoutPanel(); + btnLicense = new System.Windows.Forms.Button(); + btnSource = new System.Windows.Forms.Button(); + btnFAQ = new System.Windows.Forms.Button(); + btnIssues = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(picLogo)).BeginInit(); + tblMain.SuspendLayout(); + flwLinks.SuspendLayout(); + this.SuspendLayout(); + // + // picLogo + // + picLogo.Anchor = System.Windows.Forms.AnchorStyles.Top; + picLogo.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("picLogo.BackgroundImage"))); + picLogo.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + picLogo.Location = new System.Drawing.Point(6, 6); + picLogo.Name = "picLogo"; + tblMain.SetRowSpan(picLogo, 6); + picLogo.Size = new System.Drawing.Size(128, 128); + picLogo.TabIndex = 0; + picLogo.TabStop = false; + // + // lblTitle + // + lblTitle.AutoSize = true; + lblTitle.Font = new System.Drawing.Font("Segoe UI", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + lblTitle.Location = new System.Drawing.Point(140, 3); + lblTitle.Name = "lblTitle"; + lblTitle.Size = new System.Drawing.Size(114, 32); + lblTitle.TabIndex = 1; + lblTitle.Text = "YAMDCC"; + // + // lblSubtitle + // + lblSubtitle.AutoSize = true; + lblSubtitle.Location = new System.Drawing.Point(140, 35); + lblSubtitle.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3); + lblSubtitle.Name = "lblSubtitle"; + lblSubtitle.Size = new System.Drawing.Size(214, 15); + lblSubtitle.TabIndex = 2; + lblSubtitle.Text = "(Yet Another MSI Dragon Center Clone)"; + // + // lblVersion + // + this.lblVersion.AutoSize = true; + this.lblVersion.Location = new System.Drawing.Point(140, 56); + this.lblVersion.Margin = new System.Windows.Forms.Padding(3); + this.lblVersion.Name = "lblVersion"; + this.lblVersion.Size = new System.Drawing.Size(48, 15); + this.lblVersion.TabIndex = 3; + this.lblVersion.Text = "Version "; + // + // tblMain + // + tblMain.AutoSize = true; + tblMain.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + tblMain.ColumnCount = 2; + tblMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + tblMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + tblMain.Controls.Add(picLogo, 0, 0); + tblMain.Controls.Add(lblTitle, 1, 0); + tblMain.Controls.Add(lblSubtitle, 1, 1); + tblMain.Controls.Add(this.lblVersion, 1, 2); + tblMain.Controls.Add(this.lblCopyright, 0, 6); + tblMain.Controls.Add(this.lblDesc, 1, 4); + tblMain.Controls.Add(flwLinks, 1, 5); + tblMain.Controls.Add(this.lblRevision, 1, 3); + tblMain.Dock = System.Windows.Forms.DockStyle.Fill; + tblMain.Location = new System.Drawing.Point(0, 0); + tblMain.Name = "tblMain"; + tblMain.Padding = new System.Windows.Forms.Padding(3); + tblMain.RowCount = 7; + tblMain.RowStyles.Add(new System.Windows.Forms.RowStyle()); + tblMain.RowStyles.Add(new System.Windows.Forms.RowStyle()); + tblMain.RowStyles.Add(new System.Windows.Forms.RowStyle()); + tblMain.RowStyles.Add(new System.Windows.Forms.RowStyle()); + tblMain.RowStyles.Add(new System.Windows.Forms.RowStyle()); + tblMain.RowStyles.Add(new System.Windows.Forms.RowStyle()); + tblMain.RowStyles.Add(new System.Windows.Forms.RowStyle()); + tblMain.Size = new System.Drawing.Size(524, 181); + tblMain.TabIndex = 5; + // + // lblCopyright + // + this.lblCopyright.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.lblCopyright.AutoSize = true; + tblMain.SetColumnSpan(this.lblCopyright, 2); + this.lblCopyright.Location = new System.Drawing.Point(232, 151); + this.lblCopyright.Name = "lblCopyright"; + this.lblCopyright.Size = new System.Drawing.Size(60, 15); + this.lblCopyright.TabIndex = 4; + this.lblCopyright.Text = "Copyright"; + this.lblCopyright.TextAlign = System.Drawing.ContentAlignment.TopCenter; + // + // lblDesc + // + this.lblDesc.AutoSize = true; + this.lblDesc.Location = new System.Drawing.Point(140, 98); + this.lblDesc.Margin = new System.Windows.Forms.Padding(3); + this.lblDesc.Name = "lblDesc"; + this.lblDesc.Size = new System.Drawing.Size(67, 15); + this.lblDesc.TabIndex = 5; + this.lblDesc.Text = "Description"; + // + // flwLinks + // + flwLinks.AutoSize = true; + flwLinks.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + flwLinks.Controls.Add(btnLicense); + flwLinks.Controls.Add(btnSource); + flwLinks.Controls.Add(btnFAQ); + flwLinks.Controls.Add(btnIssues); + flwLinks.Location = new System.Drawing.Point(140, 119); + flwLinks.Name = "flwLinks"; + flwLinks.Size = new System.Drawing.Size(324, 29); + flwLinks.TabIndex = 6; + // + // btnLicense + // + btnLicense.Location = new System.Drawing.Point(3, 3); + btnLicense.Name = "btnLicense"; + btnLicense.Size = new System.Drawing.Size(75, 23); + btnLicense.TabIndex = 0; + btnLicense.Text = "License"; + btnLicense.UseVisualStyleBackColor = true; + btnLicense.Click += new System.EventHandler(this.btnLicense_Click); + // + // btnSource + // + btnSource.Location = new System.Drawing.Point(84, 3); + btnSource.Name = "btnSource"; + btnSource.Size = new System.Drawing.Size(75, 23); + btnSource.TabIndex = 1; + btnSource.Text = "Source"; + btnSource.UseVisualStyleBackColor = true; + btnSource.Click += new System.EventHandler(this.btnSource_Click); + // + // btnFAQ + // + btnFAQ.Location = new System.Drawing.Point(165, 3); + btnFAQ.Name = "btnFAQ"; + btnFAQ.Size = new System.Drawing.Size(75, 23); + btnFAQ.TabIndex = 2; + btnFAQ.Text = "FAQ"; + btnFAQ.UseVisualStyleBackColor = true; + btnFAQ.Click += new System.EventHandler(this.btnFAQ_Click); + // + // btnIssues + // + btnIssues.Location = new System.Drawing.Point(246, 3); + btnIssues.Name = "btnIssues"; + btnIssues.Size = new System.Drawing.Size(75, 23); + btnIssues.TabIndex = 3; + btnIssues.Text = "Issues"; + btnIssues.UseVisualStyleBackColor = true; + btnIssues.Click += new System.EventHandler(this.btnIssues_Click); + // + // lblRevision + // + this.lblRevision.AutoSize = true; + this.lblRevision.Location = new System.Drawing.Point(140, 77); + this.lblRevision.Margin = new System.Windows.Forms.Padding(3); + this.lblRevision.Name = "lblRevision"; + this.lblRevision.Size = new System.Drawing.Size(83, 15); + this.lblRevision.TabIndex = 7; + this.lblRevision.Text = "Revision (Git): "; + // + // VersionDialog + // + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.AutoSize = true; + this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.ClientSize = new System.Drawing.Size(524, 181); + this.Controls.Add(tblMain); + 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.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "VersionDialog"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "About YAMDCC"; + ((System.ComponentModel.ISupportInitialize)(picLogo)).EndInit(); + tblMain.ResumeLayout(false); + tblMain.PerformLayout(); + flwLinks.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + private System.Windows.Forms.Label lblVersion; + private System.Windows.Forms.Label lblDesc; + private System.Windows.Forms.Label lblCopyright; + private System.Windows.Forms.Label lblRevision; + } +} diff --git a/YAMDCC.ConfigEditor/Dialogs/VersionDialog.cs b/YAMDCC.ConfigEditor/Dialogs/VersionDialog.cs new file mode 100644 index 0000000..949ccc8 --- /dev/null +++ b/YAMDCC.ConfigEditor/Dialogs/VersionDialog.cs @@ -0,0 +1,68 @@ +// This file is part of YAMDCC (Yet Another MSI Dragon Center Clone). +// Copyright © Sparronator9999 2023-2024. +// +// YAMDCC is free software: you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation, either version 3 of the License, or (at your option) +// any later version. +// +// YAMDCC is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +// more details. +// +// You should have received a copy of the GNU General Public License along with +// YAMDCC. If not, see . + +using System; +using System.Drawing; +using System.Diagnostics; +using System.Reflection; +using System.Windows.Forms; + +namespace YAMDCC.ConfigEditor.Dialogs +{ + internal sealed partial class VersionDialog : Form + { + private static readonly string SourcePrefix = "https://github.com/Sparronator9999/YAMDCC"; + + public VersionDialog() + { + InitializeComponent(); + lblDesc.Text = Strings.GetString("dlgAboutDesc"); + lblCopyright.Text = Strings.GetString("dlgAboutCopyright"); + lblVersion.Text += Utils.GetVerString(); + + string revision = Utils.GetRevision(); + + if (string.IsNullOrEmpty(revision)) + { + lblRevision.Hide(); + } + else + { + lblRevision.Text += revision; + } + } + + private void btnLicense_Click(object sender, EventArgs e) + { + Process.Start("https://www.gnu.org/licenses/gpl-3.0.html#license-text"); + } + + private void btnSource_Click(object sender, EventArgs e) + { + Process.Start(SourcePrefix); + } + + private void btnFAQ_Click(object sender, EventArgs e) + { + Process.Start($"{SourcePrefix}#faq"); + } + + private void btnIssues_Click(object sender, EventArgs e) + { + Process.Start($"{SourcePrefix}/issues"); + } + } +} diff --git a/YAMDCC.ConfigEditor/Dialogs/VersionDialog.resx b/YAMDCC.ConfigEditor/Dialogs/VersionDialog.resx new file mode 100644 index 0000000..97ab25d --- /dev/null +++ b/YAMDCC.ConfigEditor/Dialogs/VersionDialog.resx @@ -0,0 +1,221 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + + + + iVBORw0KGgoAAAANSU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JTW1slbypQvd55+l + HkYo5wz1XEk9vJluqhKDldTUylrJly50n3+WehihnDPUcyX18Ga6qUoMVlJTK2klDtFSztA3jlTznVTT + kXq6k2p+E91UJQYrqamVtBKHaAln6BtHqvlOqulIPd1JNb+JbqoSg5XU1EpaiUO0hDP0jSPVfCfVdKSe + 7qSa30Q3VYnBSmpqJa3EIVrCGfrGkWq+k2o6Uk93Us1vopuqxGAlNbWSVuIULeWMPr9qvlNfj2r+JtX8 + JrqpSgxWUlMraSVO0VLO6POr5jv19ajmb1LNb6KbqsRgJTW1klbiFC3ljD6/ar5TX49q/ibV/Ca6qUoM + VlJTK2klTtFSzujzq+Y79fWo5m9SzW+im6rEYCU1tZJW4qW0tEf971XjSvp6Z2kmI1Tjm+imKjFYSU2t + pJV4KS3tUf971biSvt5ZmskI1fgmuqlKDFZSUytpJV5KS3vU/141rqSvd5ZmMkI1voluqhKDldTUSlqJ + l9LSHvW/V40r6eudpZmMUI1vopuqxGAlNbWSfqFayV+lGleimq/Uv09PNb6JbqoSg5XU1Er6hWolf5Vq + XIlqvlL/Pj3V+Ca6qUoMVlJTK+kXqpX8VapxJar5Sv379FTjm+imKjFYSU2tpF+oVvJXqcaVqOYr9e/T + U41vopuqxGAlNbUSLdVRa+FWqnElqvlO/fuoxjfRTVVisJKaWkm/UL3Wwq1U40pU853691GNb6KbqsRg + JTW1kn6heq2FW6nGlajmO/XvoxrfRDdVicFKamol/UL1Wgu3Uo0rUc136t9HNb6JbqoSg5XU1Er6hRrV + WiylGlfS16uZHPW/r6Ya30Q3VYnBSmpqJVraEa3FUqpxJX29mslR//tqqvFNdFOVGKykplaipR3RWiyl + GlfS16uZHPW/r6Ya30Q3VYnBSmpqJVraEa3FUqpxJX29mslR//tqqvFNdFOVGKykplaipf2mNrKlFryv + RzXP6POPUs1vopuqxGAlNbUSLeU3tZEtteB9Pap5Rp9/lGp+E91UJQYrqamVaCm/qY1sqQXv61HNM/r8 + o1Tzm+imKjFYSU2tREv5TW1kSy14X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9MBgRe2AwIvbAYETsgcGI2AOD + EbEHBiNiDwxGxB4YjIg9MBgRe2AwIvbAYETsgcGI2AODEbEHBiNiDwxGxB4YjIg9MBgRe2AwIvbAYETs + gcGI2AODEbEHBiNiDwxGxB4YjIg9MBgRO/jrr/8HN844nCeJjj4AAAAASUVORK5CYII= + + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + \ No newline at end of file diff --git a/YAMDCC.ConfigEditor/MainWindow.cs b/YAMDCC.ConfigEditor/MainWindow.cs index 6f1c7e7..24fd8b3 100644 --- a/YAMDCC.ConfigEditor/MainWindow.cs +++ b/YAMDCC.ConfigEditor/MainWindow.cs @@ -63,7 +63,7 @@ public MainWindow() Icon = Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location); // set title text to include program version - Text = $"YAMDCC config editor - v{Utils.GetShortVerString()}"; + Text = $"YAMDCC config editor - v{Utils.GetVerString()}"; // set literally every tooltip tsiLoadConf.ToolTipText = Strings.GetString("ttLoadConf"); @@ -542,8 +542,7 @@ private void tsiUninstall_Click(object sender, EventArgs e) #region Help private void tsiAbout_Click(object sender, EventArgs e) => - MessageBox.Show(Strings.GetString("dlgAbout", Utils.GetShortVerString()), "About", - MessageBoxButtons.OK, MessageBoxIcon.Information); + new VersionDialog().ShowDialog(); private void tsiSrc_Click(object sender, EventArgs e) => // TODO: add GitHub project link diff --git a/YAMDCC.ConfigEditor/Strings.cs b/YAMDCC.ConfigEditor/Strings.cs index 60ca727..6eca56f 100644 --- a/YAMDCC.ConfigEditor/Strings.cs +++ b/YAMDCC.ConfigEditor/Strings.cs @@ -70,17 +70,5 @@ public static string GetString(string name, object arg0) ? null : string.Format(CultureInfo.InvariantCulture, temp, arg0); } - - /// - /// - /// The objects to format the string with. - /// - public static string GetString(string name, params object[] args) - { - string temp = GetString(name); - return temp is null - ? null - : string.Format(CultureInfo.InvariantCulture, temp, args); - } } } diff --git a/YAMDCC.ConfigEditor/Strings.resx b/YAMDCC.ConfigEditor/Strings.resx index f9c145e..6986e28 100644 --- a/YAMDCC.ConfigEditor/Strings.resx +++ b/YAMDCC.ConfigEditor/Strings.resx @@ -117,17 +117,8 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - YAMDCC - Yet Another MSI Dragon Center Clone -Version {0} -A fast, lightweight alternative to MSI Center for MSI laptops, written in C#. -Copyright © Sparronator9999, 2023-2024 - -This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along with this program. If not, visit <https://www.gnu.org/licenses/gpl-3.0.html> for a copy. + + A fast, lightweight alternative to MSI Center for MSI laptops, written in C#. Please enter a name for your new fan profile: @@ -261,10 +252,8 @@ A dialog will open, in which you can enter the fan profile's new name. The fan profile to adjust for the current fan. - Revert the currently loaded config to when -it was first loaded using "Load Config", -or saved using "Save Config", whichever -came last. + Revert the currently loaded config to when it was first loaded +using "Load Config", or saved using "Save Config", whichever came last. Saves the currently loaded config to an XML file. @@ -347,4 +336,8 @@ Make sure to save your config (using the "Save config" button)! Cancel and continue loading YAMDCC? - \ No newline at end of file + + Copyright © Sparronator9999 (and contributors), 2023-2024. +YAMDCC and its authors are not affiliated with Micro-Star International Co., Ltd. in any way, shape, or form. + + diff --git a/YAMDCC.ConfigEditor/Utils.cs b/YAMDCC.ConfigEditor/Utils.cs index a5f0e37..3f39f33 100644 --- a/YAMDCC.ConfigEditor/Utils.cs +++ b/YAMDCC.ConfigEditor/Utils.cs @@ -14,6 +14,7 @@ // You should have received a copy of the GNU General Public License along with // YAMDCC. If not, see . +using System; using System.Diagnostics; using System.IO; using System.Linq; @@ -43,16 +44,66 @@ public static DialogResult ShowError(string message) MessageBoxButtons.OK, MessageBoxIcon.Error); } - public static string GetShortVerString() + public static string GetVerString() + { + // format: X.Y.Z-SUFFIX[.W]+REVISION, + // where W is a beta/release candidate version if applicable + string prodVer = Application.ProductVersion; + + string suffix; + if (prodVer.Contains("-")) + { + // remove the version number (SUFFIX[.W]+REVISION at this point): + suffix = prodVer.Remove(0, prodVer.IndexOf('-') + 1); + + // remove Git hash, if it exists (for "dev" detection) + if (suffix.Contains("+")) + { + suffix = suffix.Remove(suffix.IndexOf('+')); + } + } + else + { + // suffix probably doesn't exist... + suffix = string.Empty; + } + + switch (suffix.ToLowerInvariant()) + { + case "release": + // only show the version number (e.g. X.Y.Z): + return prodVer.Remove(prodVer.IndexOf('-')); + case "dev": + return prodVer.Contains("+") + // probably a snapshot release (e.g. X.Y.Z-SNAPSHOT+REVISION); + // show shortened Git commit hash if it exists: + ? prodVer.Remove(prodVer.IndexOf('+') + 8) + // Return the product version if not in expected format + : prodVer; + default: // beta, RC, etc. + return prodVer.Contains(".") && prodVer.Contains("+") + // Beta releases should be in format X.Y.Z-beta.W+REVISION. + // Remove the revision (i.e. only show X.Y.Z-beta.W): + ? prodVer.Remove(prodVer.IndexOf('+')) + // Return the product version if not in expected format + : prodVer; + } + } + + /// + /// Gets the Git revision of this program, if available. + /// + /// + /// The Git hash of the program version if available, + /// otherwise . + /// + public static string GetRevision() { string prodVer = Application.ProductVersion; return prodVer.Contains("+") - // only show shortened Git commit hash if it exists - // (plus(+) symbol + 7 characters) - ? prodVer.Remove(prodVer.IndexOf('+') + 8) - // otherwise just return the product version - : prodVer; + ? prodVer.Remove(0, prodVer.IndexOf('+') + 1) + : string.Empty; } /// diff --git a/YAMDCC.ConfigEditor/YAMDCC.ConfigEditor.csproj b/YAMDCC.ConfigEditor/YAMDCC.ConfigEditor.csproj index 8c10ce4..cf182f4 100644 --- a/YAMDCC.ConfigEditor/YAMDCC.ConfigEditor.csproj +++ b/YAMDCC.ConfigEditor/YAMDCC.ConfigEditor.csproj @@ -21,7 +21,7 @@ YAMDCC configuration utility true 0.6.9.420 - SNAPSHOT + dev none diff --git a/YAMDCC.ECAccess/YAMDCC.ECAccess.csproj b/YAMDCC.ECAccess/YAMDCC.ECAccess.csproj index 4974c23..8bd932d 100644 --- a/YAMDCC.ECAccess/YAMDCC.ECAccess.csproj +++ b/YAMDCC.ECAccess/YAMDCC.ECAccess.csproj @@ -14,7 +14,7 @@ net48 YAMDCC EC access library 0.6.9.420 - SNAPSHOT + dev none diff --git a/YAMDCC.IPC/YAMDCC.IPC.csproj b/YAMDCC.IPC/YAMDCC.IPC.csproj index 0540c4d..b546187 100644 --- a/YAMDCC.IPC/YAMDCC.IPC.csproj +++ b/YAMDCC.IPC/YAMDCC.IPC.csproj @@ -12,7 +12,8 @@ win7-x64;win7-x86;win-x64;win-x86 net48 Named Pipe Wrapper library - 2.0.0.0 + 2.0.1.0 + release none diff --git a/YAMDCC.Logs/YAMDCC.Logs.csproj b/YAMDCC.Logs/YAMDCC.Logs.csproj index 9745a15..7ff8946 100644 --- a/YAMDCC.Logs/YAMDCC.Logs.csproj +++ b/YAMDCC.Logs/YAMDCC.Logs.csproj @@ -13,7 +13,7 @@ net48 YAMDCC logging library 0.6.9.420 - SNAPSHOT + dev none diff --git a/YAMDCC.Service/YAMDCC.Service.csproj b/YAMDCC.Service/YAMDCC.Service.csproj index f715657..79460e4 100644 --- a/YAMDCC.Service/YAMDCC.Service.csproj +++ b/YAMDCC.Service/YAMDCC.Service.csproj @@ -15,7 +15,7 @@ net48 YAMDCC helper service 0.6.9.420 - SNAPSHOT + dev app.manifest