From bae6e3b2bf76de9bc08bcbc143a4b5ab57a7aca6 Mon Sep 17 00:00:00 2001
From: Kimi <58662979+kiminuo@users.noreply.github.com>
Date: Wed, 14 Jun 2023 19:11:49 +0200
Subject: [PATCH] Packager: Rename Daemon + Fix for `Release` mode (#10883)
* Introduce Daemon executable file constant
* Rename WalletWasabi.Daemon -> wassabeed
* Make sure that Daemon is a normal console application. WinExe is for GUI apps.
---
.../WalletWasabi.Daemon.csproj | 15 +++-----
WalletWasabi.Packager/Program.cs | 34 ++++++++-----------
WalletWasabi/Helpers/Constants.cs | 5 +++
3 files changed, 23 insertions(+), 31 deletions(-)
diff --git a/WalletWasabi.Daemon/WalletWasabi.Daemon.csproj b/WalletWasabi.Daemon/WalletWasabi.Daemon.csproj
index 5fcebf277d3..0da39f38da7 100644
--- a/WalletWasabi.Daemon/WalletWasabi.Daemon.csproj
+++ b/WalletWasabi.Daemon/WalletWasabi.Daemon.csproj
@@ -1,13 +1,5 @@
-
- Exe
-
-
-
- WinExe
-
-
net7.0
latest
@@ -20,6 +12,7 @@
true
win7-x64;linux-x64;linux-arm64;osx-x64;osx-arm64
$(MSBuildProjectDirectory)\=WalletWasabi.Daemon
+ Exe
@@ -41,8 +34,8 @@
Wasabi Wallet Fluent Daemon
-
-
-
+
+
+
diff --git a/WalletWasabi.Packager/Program.cs b/WalletWasabi.Packager/Program.cs
index bbdcc406926..129a04bb1b1 100644
--- a/WalletWasabi.Packager/Program.cs
+++ b/WalletWasabi.Packager/Program.cs
@@ -25,6 +25,8 @@ namespace WalletWasabi.Packager;
public static class Program
{
public const string PfxPath = "C:\\digicert.pfx";
+
+ public const string DaemonExecutableName = Constants.DaemonExecutableName;
public const string ExecutableName = Constants.ExecutableName;
private const string WasabiPrivateKeyFilePath = @"C:\wasabi\Wasabi.privkey";
@@ -318,28 +320,20 @@ private static async Task PublishAsync()
}
}
- // Rename the final exe.
- string oldExecutablePath;
- string newExecutablePath;
- if (target.StartsWith("win"))
- {
- oldExecutablePath = Path.Combine(currentBinDistDirectory, "WalletWasabi.Fluent.Desktop.exe");
- newExecutablePath = Path.Combine(currentBinDistDirectory, $"{ExecutableName}.exe");
-
- // Delete unused executables.
- File.Delete(Path.Combine(currentBinDistDirectory, "WalletWasabi.Fluent.exe"));
- }
- else // Linux & OSX
- {
- oldExecutablePath = Path.Combine(currentBinDistDirectory, "WalletWasabi.Fluent.Desktop");
- newExecutablePath = Path.Combine(currentBinDistDirectory, ExecutableName);
-
- // Delete unused executables.
- File.Delete(Path.Combine(currentBinDistDirectory, "WalletWasabi.Fluent"));
- }
+ // Rename WalletWasabi.Fluent.Desktop(.exe) -> wassabee(.exe).
+ string executableExtension = target.StartsWith("win") ? ".exe" : "";
+ string oldExecutablePath = Path.Combine(currentBinDistDirectory, $"WalletWasabi.Fluent.Desktop{executableExtension}");
+ string newExecutablePath = Path.Combine(currentBinDistDirectory, $"{ExecutableName}{executableExtension}");
+ File.Move(oldExecutablePath, newExecutablePath);
+ // Rename WalletWasabi.Daemon(.exe) -> wassabeed(.exe).
+ oldExecutablePath = Path.Combine(currentBinDistDirectory, $"WalletWasabi.Daemon{executableExtension}");
+ newExecutablePath = Path.Combine(currentBinDistDirectory, $"{DaemonExecutableName}{executableExtension}");
File.Move(oldExecutablePath, newExecutablePath);
+ // Delete unused executables.
+ File.Delete(Path.Combine(currentBinDistDirectory, $"WalletWasabi.Fluent{executableExtension}"));
+
// IF IT'S IN ONLYBINARIES MODE DON'T DO ANYTHING FANCY PACKAGING AFTER THIS!!!
if (OnlyBinaries)
{
@@ -413,7 +407,7 @@ private static async Task PublishAsync()
Console.WriteLine($"# Move '{publishedFolder}' to '{newFolderPath}'.");
Directory.Move(publishedFolder, newFolderPath);
publishedFolder = newFolderPath;
- string chmodExecutablesArgs = "-type f \\( -name 'wassabee' -o -name 'hwi' -o -name 'bitcoind' -o -name 'tor' \\) -exec chmod +x {} \\;";
+ string chmodExecutablesArgs = $$"""-type f \( -name '{{ExecutableName}}' -o -name '{{DaemonExecutableName}}' -o -name 'hwi' -o -name 'bitcoind' -o -name 'tor' \) -exec chmod +x {} \;""";
string[] commands = new string[]
{
diff --git a/WalletWasabi/Helpers/Constants.cs b/WalletWasabi/Helpers/Constants.cs
index 9712f37f04b..c7d92f0762a 100644
--- a/WalletWasabi/Helpers/Constants.cs
+++ b/WalletWasabi/Helpers/Constants.cs
@@ -60,7 +60,12 @@ public static class Constants
public const string AlphaNumericCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
public const string CapitalAlphaNumericCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
+ /// Executable file name of Wasabi Wallet Daemon application (without extension).
+ public const string DaemonExecutableName = $"{ExecutableName}d";
+
+ /// Executable file name of Wasabi Wallet UI application (without extension).
public const string ExecutableName = "wassabee";
+
public const string AppName = "Wasabi Wallet";
public const string BuiltinBitcoinNodeName = "Bitcoin Knots";