aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2019-05-08 10:54:28 +0200
committerSimon Rozman <simon@rozman.si>2019-05-08 10:54:55 +0200
commitd25ed9f341d79c62d5bc28e9ddfd665bcff98870 (patch)
tree031c2283a87c1f9727d425ebb924606138c54406
parentconfview: show in the case that there are no peers (diff)
downloadwireguard-windows-d25ed9f341d79c62d5bc28e9ddfd665bcff98870.tar.xz
wireguard-windows-d25ed9f341d79c62d5bc28e9ddfd665bcff98870.zip
installer: smarter detection of SYSTEM profile folder
Signed-off-by: Simon Rozman <simon@rozman.si>
-rw-r--r--installer/customactions.js4
1 files changed, 3 insertions, 1 deletions
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);
}