Cleanup Packager based on VS2019 complains
MODIFY
WalletWasabi.Packager/NSubsys/NSubsysUtil.cs
WalletWasabi.Packager/NSubsys/NSubsysUtil.cs
@@ -24,9 +24,13 @@ namespace NSubsys
var headerType = peFile.Is32BitHeader ? typeof(IMAGE_OPTIONAL_HEADER32) : typeof(IMAGE_OPTIONAL_HEADER64);
if (peFile.Is32BitHeader)
+ {
subsysVal = (SubSystemType)peFile.OptionalHeader32.Subsystem;
+ }
else
+ {
subsysVal = (SubSystemType)peFile.OptionalHeader64.Subsystem;
+ }
subsysOffset += Marshal.OffsetOf(headerType, "Subsystem").ToInt32();
@@ -43,7 +47,9 @@ namespace NSubsys
var subsysSetting = BitConverter.GetBytes((ushort)SubSystemType.IMAGE_SUBSYSTEM_WINDOWS_GUI);
if (!BitConverter.IsLittleEndian)
+ {
Array.Reverse(subsysSetting);
+ }
if (peFile.Stream.CanWrite)
{

MODIFY
WalletWasabi.Packager/Program.cs
WalletWasabi.Packager/Program.cs
@@ -302,7 +302,7 @@ namespace WalletWasabi.Packager
}
Tools.ClearSha512Tags(currentBinDistDirectory);
- Tools.RemoveSosDocsUnix(currentBinDistDirectory);
+ //Tools.RemoveSosDocsUnix(currentBinDistDirectory);
// Remove Tor binaries those are not relevant to the platform.
var torFolder = new DirectoryInfo(Path.Combine(currentBinDistDirectory, "TorDaemons"));
@@ -364,12 +364,18 @@ namespace WalletWasabi.Packager
}
// IF IT'S IN ONLYBINARIES MODE DON'T DO ANYTHING FANCY PACKAGING AFTER THIS!!!
- if (OnlyBinaries) continue; // In Windows build at this moment it doesn't matter though.
+ if (OnlyBinaries)
+ {
+ continue; // In Windows build at this moment it doesn't matter though.
+ }
}
else if (target.StartsWith("osx"))
{
// IF IT'S IN ONLYBINARIES MODE DON'T DO ANYTHING FANCY PACKAGING AFTER THIS!!!
- if (OnlyBinaries) continue;
+ if (OnlyBinaries)
+ {
+ continue;
+ }
var tempName = Path.Combine(BinDistDirectory, $"temp-{target}");
Directory.Move(currentBinDistDirectory, tempName);
@@ -502,7 +508,10 @@ namespace WalletWasabi.Packager
else if (target.StartsWith("linux"))
{
// IF IT'S IN ONLYBINARIES MODE DON'T DO ANYTHING FANCY PACKAGING AFTER THIS!!!
- if (OnlyBinaries) continue;
+ if (OnlyBinaries)
+ {
+ continue;
+ }
Console.WriteLine("Create Linux .tar.gz");
if (!Directory.Exists(publishedFolder))

MODIFY
WalletWasabi.Packager/Tools.cs
WalletWasabi.Packager/Tools.cs
@@ -10,7 +10,10 @@ namespace WalletWasabi.Packager
public static void ClearSha512Tags(string pathToSearch)
{
var files = Directory.GetFiles(pathToSearch, "*.deps.json"); //https://natemcmaster.com/blog/2017/12/21/netcore-primitives/
- if (files is null) return;
+ if (files is null)
+ {
+ return;
+ }
foreach (var depsFilePath in files)
{
@@ -24,7 +27,11 @@ namespace WalletWasabi.Packager
{
// "sha512": "",
var lineToAdd = " \"sha512\": \"\"";
- if (line.EndsWith(',')) lineToAdd += ',';
+ if (line.EndsWith(','))
+ {
+ lineToAdd += ',';
+ }
+
outLines.Add(lineToAdd);
}
else
@@ -37,10 +44,10 @@ namespace WalletWasabi.Packager
}
}
- public static void RemoveSosDocsUnix(string pathToSearch)
- {
- // ToDo?: Must remove from the ui.deps.json, too otherwise binary will fail.
- // Leave it to not do anything for now.
+ //public static void RemoveSosDocsUnix(string pathToSearch)
+ //{
+ // // ToDo ?: Must remove from the ui.deps.json, too otherwise binary will fail.
+ // // Leave it to not do anything for now.
// string[] files = Directory.GetFiles(pathToSearch, "sosdocsunix.txt", SearchOption.AllDirectories);
// if (files is null) return;
@@ -48,7 +55,7 @@ namespace WalletWasabi.Packager
// {
// File.Delete(sosDocsUnixFilePath);
// }
- }
+ //}
public static string LinuxPathCombine(params string[] paths)
{

Cleanup Packager based on VS2019 complains