Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packager: Rename Daemon + Fix for Release mode #10883

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 4 additions & 11 deletions WalletWasabi.Daemon/WalletWasabi.Daemon.csproj
@@ -1,13 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputType>Exe</OutputType>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputType>WinExe</OutputType>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WinExe is only for UI applications (eg WinForms or WPF). That's why in the Release mode the program did not wait for any console input.

</PropertyGroup>

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<AnalysisLevel>latest</AnalysisLevel>
Expand All @@ -20,6 +12,7 @@
<InvariantGlobalization>true</InvariantGlobalization>
<RuntimeIdentifiers>win7-x64;linux-x64;linux-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>
<PathMap>$(MSBuildProjectDirectory)\=WalletWasabi.Daemon</PathMap>
<OutputType>Exe</OutputType>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -41,8 +34,8 @@
<Product>Wasabi Wallet Fluent Daemon</Product>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\WalletWasabi\WalletWasabi.csproj" />
</ItemGroup>
<ItemGroup>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spaces -> tabs

<ProjectReference Include="..\WalletWasabi\WalletWasabi.csproj" />
</ItemGroup>

</Project>
34 changes: 14 additions & 20 deletions WalletWasabi.Packager/Program.cs
Expand Up @@ -25,6 +25,8 @@ namespace WalletWasabi.Packager;
public static class Program
{
public const string PfxPath = "C:\\digicert.pfx";

public const string DaemonExecutableName = Constants.DaemonExecutableName;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done for consistency with the line below.

public const string ExecutableName = Constants.ExecutableName;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to have:

Suggested change
public const string ExecutableName = Constants.ExecutableName;
public const string UiExecutableName = Constants.UiExecutableName;

We can change it if you like.


private const string WasabiPrivateKeyFilePath = @"C:\wasabi\Wasabi.privkey";
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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[]
{
Expand Down
5 changes: 5 additions & 0 deletions WalletWasabi/Helpers/Constants.cs
Expand Up @@ -60,7 +60,12 @@ public static class Constants
public const string AlphaNumericCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
public const string CapitalAlphaNumericCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";

/// <summary>Executable file name of Wasabi Wallet Daemon application (without extension).</summary>
public const string DaemonExecutableName = $"{ExecutableName}d";

/// <summary>Executable file name of Wasabi Wallet UI application (without extension).</summary>
public const string ExecutableName = "wassabee";

public const string AppName = "Wasabi Wallet";
public const string BuiltinBitcoinNodeName = "Bitcoin Knots";

Expand Down