summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLyssa2025-04-02 09:53:00 +0000
committerLyssa2025-04-02 09:53:00 +0000
commit07f43e261381c8b9229fcf376e310d8f02ccb16d (patch)
tree38c28bbfd84128655f66d537d5fbb21487b434ea
parentbcebe2248cba255b5102b3e329841de2d388fd41 (diff)
downloadTSforge-07f43e261381c8b9229fcf376e310d8f02ccb16d.zip
move detectcurrentkey to common
-rw-r--r--LibTSforge/Common.cs18
-rw-r--r--LibTSforge/SPP/SPPUtils.cs20
2 files changed, 18 insertions, 20 deletions
diff --git a/LibTSforge/Common.cs b/LibTSforge/Common.cs
index a1b4294..4a95a08 100644
--- a/LibTSforge/Common.cs
+++ b/LibTSforge/Common.cs
@@ -243,24 +243,6 @@ namespace LibTSforge
throw new NotSupportedException("Unable to auto-detect version info");
}
-
- public static bool DetectCurrentKey()
- {
- SLApi.RefreshLicenseStatus();
-
- using (RegistryKey wpaKey = Registry.LocalMachine.OpenSubKey(@"SYSTEM\WPA"))
- {
- foreach (string subKey in wpaKey.GetSubKeyNames())
- {
- if (subKey.StartsWith("8DEC0AF1"))
- {
- return subKey.Contains("P");
- }
- }
- }
-
- throw new FileNotFoundException("Failed to autodetect key type, specify physical store key with /prod or /test arguments.");
- }
}
public static class Logger
diff --git a/LibTSforge/SPP/SPPUtils.cs b/LibTSforge/SPP/SPPUtils.cs
index 08dbe03..1046439 100644
--- a/LibTSforge/SPP/SPPUtils.cs
+++ b/LibTSforge/SPP/SPPUtils.cs
@@ -5,11 +5,9 @@ namespace LibTSforge.SPP
using LibTSforge.TokenStore;
using Microsoft.Win32;
using System;
- using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.ServiceProcess;
- using System.Text;
public static class SPPUtils
{
@@ -130,6 +128,24 @@ namespace LibTSforge.SPP
SLApi.RefreshLicenseStatus();
}
+ public static bool DetectCurrentKey()
+ {
+ SLApi.RefreshLicenseStatus();
+
+ using (RegistryKey wpaKey = Registry.LocalMachine.OpenSubKey(@"SYSTEM\WPA"))
+ {
+ foreach (string subKey in wpaKey.GetSubKeyNames())
+ {
+ if (subKey.StartsWith("8DEC0AF1"))
+ {
+ return subKey.Contains("P");
+ }
+ }
+ }
+
+ throw new FileNotFoundException("Failed to autodetect key type, specify physical store key with /prod or /test arguments.");
+ }
+
public static string GetPSPath(PSVersion version)
{
switch (version)