Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Build .NET project

on:
push:
pull_request:

jobs:
build:
Expand Down
21 changes: 13 additions & 8 deletions ZXBStudio/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static string Version
{
if(string.IsNullOrEmpty(_Version))
{
SetVerion();
SetVersion();
}
return _Version;
}
Expand All @@ -25,7 +25,7 @@ public static string VersionDate { get
{
if (string.IsNullOrEmpty(_VersionDate))
{
SetVerion();
SetVersion();
}
return _VersionDate;
}
Expand All @@ -45,14 +45,14 @@ public static void Main(string[] args)
TypeNameHandling = TypeNameHandling.Auto,
};

SetVerion();
SetVersion();

BuildAvaloniaApp()
.StartWithClassicDesktopLifetime(args);
}


public static void SetVerion()
public static void SetVersion()
{
try
{
Expand All @@ -61,15 +61,20 @@ public static void SetVerion()
_Version = $"{version.Major}.{version.Minor}.{version.Build}";
if (version.Revision != 0)
{
_Version = $"{Version} - beta {version.Revision}";
_Version = $"{_Version} - beta {version.Revision}";
}
var buildDate = System.IO.File.GetLastWriteTime(assembly.Location);

string path = assembly.Location;
if (string.IsNullOrEmpty(path))
path = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;

var buildDate = System.IO.File.GetLastWriteTime(path);
_VersionDate = buildDate.ToString("yyyy.MM.dd");
}
catch
{
_Version = "";
_VersionDate = "";
_Version = "Unknown";
_VersionDate = "Unknown";
}
}

Expand Down