From a06a993d868766f2b7faaf9fbde8ceee37f696e6 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 8 May 2019 10:54:28 +0200 Subject: installer: smarter detection of SYSTEM profile folder Signed-off-by: Simon Rozman --- installer/customactions.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/installer/customactions.js b/installer/customactions.js index 9ca93ca5..1647c20e 100644 --- a/installer/customactions.js +++ b/installer/customactions.js @@ -90,7 +90,9 @@ function EvaluateWireGuardServices() { function RemoveConfigFolder() { try { - fso.DeleteFolder(fso.BuildPath(fso.GetSpecialFolder(1), "config\\systemprofile\\AppData\\Local\\WireGuard"), true); + var path = wsh.RegRead("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\S-1-5-18\\ProfileImagePath"); + path = wsh.ExpandEnvironmentStrings(path.toString()); + fso.DeleteFolder(fso.BuildPath(path, "AppData\\Local\\WireGuard"), true); } catch(e) { logMessage("Failed to remove configuration on uninstall: " + e.message); } -- cgit v1.2.3-59-g8ed1b