mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 02:37:03 -07:00
Fixed some issues with the version being shown in the about.
This commit is contained in:
parent
5c6a3f2f78
commit
cfdc7a7ec2
4 changed files with 34 additions and 33 deletions
7
Greenshot/Forms/AboutForm.Designer.cs
generated
7
Greenshot/Forms/AboutForm.Designer.cs
generated
|
@ -20,6 +20,7 @@
|
|||
*/
|
||||
|
||||
using System.Reflection;
|
||||
using Greenshot.Helpers;
|
||||
|
||||
namespace Greenshot {
|
||||
partial class AboutForm {
|
||||
|
@ -116,7 +117,7 @@ namespace Greenshot {
|
|||
this.linkLblBugs.Size = new System.Drawing.Size(465, 23);
|
||||
this.linkLblBugs.TabIndex = 8;
|
||||
this.linkLblBugs.TabStop = true;
|
||||
this.linkLblBugs.Text = "http://getgreenshot.org/tickets/?version=" + Assembly.GetEntryAssembly().GetName().Version;
|
||||
this.linkLblBugs.Text = "http://getgreenshot.org/tickets/?version=" + EnvironmentInfo.GetGreenshotVersion(true);
|
||||
this.linkLblBugs.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabelClicked);
|
||||
//
|
||||
// lblBugs
|
||||
|
@ -134,7 +135,7 @@ namespace Greenshot {
|
|||
this.linkLblDonations.Size = new System.Drawing.Size(465, 23);
|
||||
this.linkLblDonations.TabIndex = 10;
|
||||
this.linkLblDonations.TabStop = true;
|
||||
this.linkLblDonations.Text = "http://getgreenshot.org/support/?version=" + Assembly.GetEntryAssembly().GetName().Version;
|
||||
this.linkLblDonations.Text = "http://getgreenshot.org/support/?version=" + EnvironmentInfo.GetGreenshotVersion(true);
|
||||
this.linkLblDonations.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabelClicked);
|
||||
//
|
||||
// lblDonations
|
||||
|
@ -170,7 +171,7 @@ namespace Greenshot {
|
|||
this.linkLabel1.Size = new System.Drawing.Size(130, 23);
|
||||
this.linkLabel1.TabIndex = 13;
|
||||
this.linkLabel1.TabStop = true;
|
||||
this.linkLabel1.Text = "http://getgreenshot.org";
|
||||
this.linkLabel1.Text = "http://getgreenshot.org/?version=" + EnvironmentInfo.GetGreenshotVersion(true);
|
||||
this.linkLabel1.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
||||
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabelClicked);
|
||||
//
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace Greenshot {
|
|||
/// <summary>
|
||||
/// The about form
|
||||
/// </summary>
|
||||
public partial class AboutForm : AnimatingBaseForm {
|
||||
public sealed partial class AboutForm : AnimatingBaseForm {
|
||||
private static readonly ILog LOG = LogManager.GetLogger(typeof(AboutForm));
|
||||
private Bitmap _bitmap;
|
||||
private readonly ColorAnimator _backgroundAnimation;
|
||||
|
@ -145,11 +145,11 @@ namespace Greenshot {
|
|||
// Only use double-buffering when we are NOT in a Terminal Server session
|
||||
DoubleBuffered = !IsTerminalServerSession;
|
||||
|
||||
// Use the self drawn image, first we create the background to be the backcolor (as we animate from this)
|
||||
// Use the self drawn image, first we create the background to be the back-color (as we animate from this)
|
||||
_bitmap = ImageHelper.CreateEmpty(90, 90, PixelFormat.Format24bppRgb, BackColor, 96, 96);
|
||||
pictureBox1.Image = _bitmap;
|
||||
|
||||
lblTitle.Text = "Greenshot " + EnvironmentInfo.GreenshotVersion + (IniConfig.IsPortable ? " Portable" : "") + (" (" + OsInfo.Bits) + " bit)";
|
||||
lblTitle.Text = "Greenshot " + EnvironmentInfo.GetGreenshotVersion() + (IniConfig.IsPortable ? " Portable" : "") + (" (" + OsInfo.Bits) + " bit)";
|
||||
|
||||
// Number of frames the pixel animation takes
|
||||
int frames = FramesForMillis(2000);
|
||||
|
|
|
@ -56,38 +56,38 @@ namespace Greenshot.Helpers
|
|||
return Type.GetType("System.Reflection.ReflectionContext", false) != null;
|
||||
}
|
||||
|
||||
public static string GreenshotVersion
|
||||
public static string GetGreenshotVersion(bool shortVersion = false)
|
||||
{
|
||||
get
|
||||
var executingAssembly = Assembly.GetExecutingAssembly();
|
||||
|
||||
// Use assembly version
|
||||
string greenshotVersion = executingAssembly.GetName().Version.ToString();
|
||||
|
||||
// Use AssemblyFileVersion if available
|
||||
var assemblyFileVersionAttribute = executingAssembly.GetCustomAttribute<AssemblyFileVersionAttribute>();
|
||||
if (!string.IsNullOrEmpty(assemblyFileVersionAttribute?.Version))
|
||||
{
|
||||
var executingAssembly = Assembly.GetExecutingAssembly();
|
||||
|
||||
// Use assembly version
|
||||
string greenshotVersion = executingAssembly.GetName().Version.ToString();
|
||||
|
||||
// Use AssemblyFileVersion if available
|
||||
var v = executingAssembly.GetName().Version;
|
||||
var assemblyFileVersion = executingAssembly.GetCustomAttribute<AssemblyFileVersionAttribute>();
|
||||
if (!string.IsNullOrEmpty(assemblyFileVersion?.Version))
|
||||
{
|
||||
greenshotVersion = assemblyFileVersion.Version;
|
||||
}
|
||||
var assemblyFileVersion = new Version(assemblyFileVersionAttribute.Version);
|
||||
greenshotVersion = assemblyFileVersion.ToString(3);
|
||||
}
|
||||
|
||||
if (!shortVersion)
|
||||
{
|
||||
// Use AssemblyInformationalVersion if available
|
||||
var assemblyInformationalVersion = executingAssembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>();
|
||||
if (!string.IsNullOrEmpty(assemblyInformationalVersion?.InformationalVersion))
|
||||
var informationalVersionAttribute = executingAssembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>();
|
||||
if (!string.IsNullOrEmpty(informationalVersionAttribute?.InformationalVersion))
|
||||
{
|
||||
greenshotVersion = assemblyInformationalVersion.InformationalVersion;
|
||||
greenshotVersion = informationalVersionAttribute.InformationalVersion;
|
||||
}
|
||||
|
||||
return greenshotVersion.Replace("+", " - ");
|
||||
}
|
||||
|
||||
return greenshotVersion.Replace("+", " - ");
|
||||
}
|
||||
|
||||
public static string EnvironmentToString(bool newline)
|
||||
{
|
||||
StringBuilder environment = new StringBuilder();
|
||||
environment.Append("Software version: " + GreenshotVersion);
|
||||
environment.Append("Software version: " + GetGreenshotVersion());
|
||||
if (IniConfig.IsPortable) {
|
||||
environment.Append(" Portable");
|
||||
}
|
||||
|
|
14
version.json
14
version.json
|
@ -10,14 +10,14 @@
|
|||
},
|
||||
"cloudBuild": {
|
||||
"setVersionVariables": true,
|
||||
"setAllVariables": true,
|
||||
"buildNumber": {
|
||||
"enabled": true,
|
||||
"includeCommitId": {
|
||||
"when": "nonPublicReleaseOnly",
|
||||
"where": "buildMetadata"
|
||||
"setAllVariables": true,
|
||||
"buildNumber": {
|
||||
"enabled": true,
|
||||
"includeCommitId": {
|
||||
"when": "nonPublicReleaseOnly",
|
||||
"where": "buildMetadata"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"inherit": false
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue