summaryrefslogtreecommitdiff
path: root/LibTSforge/Modifiers/UniqueIdDelete.cs
diff options
context:
space:
mode:
authorWitherOrNot2025-04-24 16:13:10 +0000
committerGitHub2025-04-24 16:13:10 +0000
commitf81edcb3171d1f80da1c67abdf7193d871b18378 (patch)
tree993d3ea250c9d264c61252dd388fee5e5447e218 /LibTSforge/Modifiers/UniqueIdDelete.cs
parent8aa1f9078d786a7b20d2b92bbeefdd77a93dd828 (diff)
parent912f83c11b75c93f38b7966d7b727144eee7f23d (diff)
downloadTSforge-f81edcb3171d1f80da1c67abdf7193d871b18378.zip
Merge pull request #5 from massgravel/longhorn1.1.0
Longhorn
Diffstat (limited to 'LibTSforge/Modifiers/UniqueIdDelete.cs')
-rw-r--r--LibTSforge/Modifiers/UniqueIdDelete.cs13
1 files changed, 7 insertions, 6 deletions
diff --git a/LibTSforge/Modifiers/UniqueIdDelete.cs b/LibTSforge/Modifiers/UniqueIdDelete.cs
index b83d328..b66954a 100644
--- a/LibTSforge/Modifiers/UniqueIdDelete.cs
+++ b/LibTSforge/Modifiers/UniqueIdDelete.cs
@@ -1,13 +1,15 @@
namespace LibTSforge.Modifiers
{
using System;
- using LibTSforge.PhysicalStore;
- using LibTSforge.SPP;
+ using PhysicalStore;
+ using SPP;
public static class UniqueIdDelete
{
public static void DeleteUniqueId(PSVersion version, bool production, Guid actId)
{
+ if (version == PSVersion.Vista) throw new NotSupportedException("This feature is not supported on Windows Vista/Server 2008.");
+
Guid appId;
if (actId == Guid.Empty)
@@ -25,14 +27,13 @@ namespace LibTSforge.Modifiers
appId = SLApi.GetAppId(actId);
}
- string instId = SLApi.GetInstallationID(actId);
Guid pkeyId = SLApi.GetInstalledPkeyID(actId);
- Utils.KillSPP();
+ SPPUtils.KillSPP(version);
Logger.WriteLine("Writing TrustedStore data...");
- using (IPhysicalStore store = Utils.GetStore(version, production))
+ using (IPhysicalStore store = SPPUtils.GetStore(version, production))
{
string key = string.Format("SPPSVC\\{0}\\{1}", appId, actId);
PSBlock keyBlock = store.GetBlock(key, pkeyId.ToString());
@@ -42,7 +43,7 @@ namespace LibTSforge.Modifiers
throw new Exception("No product key found.");
}
- VariableBag pkb = new VariableBag(keyBlock.Data);
+ VariableBag pkb = new VariableBag(keyBlock.Data, version);
pkb.DeleteBlock("SppPkeyUniqueIdToken");