Create Version extension for proper version string
MODIFY
WalletWasabi.Gui/CommandLine/CommandInterpreter.cs
WalletWasabi.Gui/CommandLine/CommandInterpreter.cs
@@ -70,11 +70,7 @@ namespace WalletWasabi.Gui.CommandLine
private static void ShowVersion()
{
-#if RELEASE
- Console.WriteLine($"Wasabi Client Version: {Constants.ClientVersion.ToString(3)}");
-#else
- Console.WriteLine($"Wasabi Client Version: {Constants.ClientVersion.ToString(4)}");
-#endif
+ Console.WriteLine($"Wasabi Client Version: {Constants.ClientVersion.ToVersionString()}");
Console.WriteLine($"Compatible Coordinator Version: {Constants.BackendMajorVersion}");
}

MODIFY
WalletWasabi.Gui/Tabs/AboutViewModel.cs
WalletWasabi.Gui/Tabs/AboutViewModel.cs
@@ -34,11 +34,7 @@ namespace WalletWasabi.Gui.Tabs
public Version Version { get; }
-#if RELEASE
- public string VersionText => $"v{Version.ToString(3)}";
-#else
- public string VersionText => $"v{Version.ToString(4)}";
-#endif
+ public string VersionText => $"v{Version.ToVersionString()}";
public string ClearnetLink => "https://wasabiwallet.io/";

MODIFY
WalletWasabi.Packager/Program.cs
WalletWasabi.Packager/Program.cs
@@ -52,11 +52,7 @@ namespace WalletWasabi.Packager
public static string WixProjectDirectory = Path.GetFullPath(Path.Combine(SolutionDirectory, "WalletWasabi.WindowsInstaller\\"));
public static string BinDistDirectory = Path.GetFullPath(Path.Combine(GuiProjectDirectory, "bin\\dist"));
-#if RELEASE
- public static string VersionPrefix = Constants.ClientVersion.ToString();
-#else
- public static string VersionPrefix = Constants.ClientVersion.ToString();
-#endif
+ public static string VersionPrefix = Constants.ClientVersion.ToVersionString();
public static bool OnlyBinaries;
public static bool OnlyCreateDigests;

ADD
WalletWasabi/Extensions/VersionExtensions.cs
+using System;
+
+namespace System
+{
+ public static class VersionExtensions
+ {
+ public static string ToVersionString(this Version version)
+ {
+#if RELEASE
+ return version.ToString(3);
+#else
+ return version.ToString(4);
+#endif
+ }
+ }
+}

MODIFY
WalletWasabi/Services/WalletService.cs
WalletWasabi/Services/WalletService.cs
@@ -753,11 +753,7 @@ namespace WalletWasabi.Services
{
ConnectCancellation = handshakeTimeout.Token,
IsRelay = false,
-#if RELEASE
- UserAgent = $"/Wasabi:{Constants.ClientVersion.ToString(3)}/"
-#else
- UserAgent = $"/Wasabi:{Constants.ClientVersion.ToString(4)}/"
-#endif
+ UserAgent = $"/Wasabi:{Constants.ClientVersion.ToVersionString()}/"
};
// If an onion was added must try to use Tor.

Create Version extension for proper version string