Skip to content

Commit

Permalink
Added versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
Victoare committed Feb 2, 2024
1 parent cc62333 commit 1e23185
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
5 changes: 3 additions & 2 deletions source/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions source/MainForm.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Diagnostics;
using System.Net;
using System.Reflection;

namespace WledSRServer
{
Expand All @@ -25,6 +26,8 @@ public MainForm()
// V=FreqToDisplay, V0=FreqLow, V1=FreqHigh, X0-X1 control width
// X = X0 + (X1 - X0)(log(V) - log(V0))/(log(V1) - log(V0))

Text = $"WLED SoundReactive Server - {Program.Version(false)}";

btnSetAutoRun.CheckboxChecked = AdminFunctions.GetAutoRun();
btnSetStartupGUI.CheckboxChecked = Properties.Settings.Default.StartWithoutGUI;
txtUdpPort.Text = Properties.Settings.Default.WledUdpMulticastPort.ToString();
Expand Down
4 changes: 4 additions & 0 deletions source/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ internal class Program

public const string MboxTitle = "WLED SR Server";

public static string Version(bool withCommitHash)
=> Application.ProductVersion.Substring(0, Application.ProductVersion.IndexOf('+') + (withCommitHash ? 8 : 0));

[STAThread]
private static void Main(string[] args)
{
Expand Down Expand Up @@ -52,6 +55,7 @@ public static void LogException(Exception ex)
var logFile = Path.Combine(Environment.CurrentDirectory, "exceptionlog.txt");
var writer = new StreamWriter(logFile, true);
writer.WriteLine($"===[ {DateTime.Now} ]==============================================================================");
writer.WriteLine($"App version: {Version(true)}");
writer.WriteLine($"Message: {ex.Message}");
writer.WriteLine($"Stack Trace");
writer.WriteLine($"{ex.StackTrace}");
Expand Down
3 changes: 2 additions & 1 deletion source/WledSRServer.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
Expand All @@ -10,6 +10,7 @@
<PublishSingleFile>true</PublishSingleFile>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<ApplicationIcon>042_cheerful_rgb.ico</ApplicationIcon>
<Version>1.0.1</Version>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 1e23185

Please sign in to comment.