Added Windows Helper (not for the test)
MODIFY
WalletWasabi.Fluent/Helpers/StartupHelper.cs
WalletWasabi.Fluent/Helpers/StartupHelper.cs
-using Microsoft.Win32;
using System;
using System.IO;
using System.Runtime.InteropServices;
@@ -20,7 +19,7 @@ namespace WalletWasabi.Fluent.Helpers
{
throw new InvalidOperationException($"Path {pathToExeFile} does not exist.");
}
- StartOnWindowsStartup(runOnSystemStartup, pathToExeFile);
+ WindowsStartUpHelper.StartOnWindowsStartup(runOnSystemStartup, pathToExeFile);
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
@@ -31,23 +30,5 @@ namespace WalletWasabi.Fluent.Helpers
await MacOsStartUpHelper.ModifyLoginItemsAsync(runOnSystemStartup);
}
}
-
- private static void StartOnWindowsStartup(bool runOnSystemStartup, string pathToExeFile)
- {
- if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
- {
- throw new InvalidOperationException("Registry modification can only be done on Windows.");
- }
-
- using RegistryKey key = Registry.CurrentUser.OpenSubKey(KeyPath, writable: true) ?? throw new InvalidOperationException("Registry operation failed.");
- if (runOnSystemStartup)
- {
- key.SetValue(nameof(WalletWasabi), pathToExeFile);
- }
- else
- {
- key.DeleteValue(nameof(WalletWasabi), false);
- }
- }
}
}

ADD
WalletWasabi.Fluent/Helpers/WindowsStartUpHelper.cs
+using Microsoft.Win32;
+using System;
+using System.Runtime.InteropServices;
+
+namespace WalletWasabi.Fluent.Helpers
+{
+ public static class WindowsStartUpHelper
+ {
+ private const string KeyPath = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run";
+
+ public static void StartOnWindowsStartup(bool runOnSystemStartup, string pathToExeFile)
+ {
+ if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ {
+ throw new InvalidOperationException("Registry modification can only be done on Windows.");
+ }
+
+ using RegistryKey key = Registry.CurrentUser.OpenSubKey(KeyPath, writable: true) ?? throw new InvalidOperationException("Registry operation failed.");
+ if (runOnSystemStartup)
+ {
+ key.SetValue(nameof(WalletWasabi), pathToExeFile);
+ }
+ else
+ {
+ key.DeleteValue(nameof(WalletWasabi), false);
+ }
+ }
+ }
+}

Added Windows Helper (not for the test)