aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/conf
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-11-17 11:32:32 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2020-11-17 11:32:32 +0100
commit0037b328f8214d42932ee1984c712ecb364e994c (patch)
tree913eb6ad87a8e2a3e4fd7c361e595f822498faa4 /conf
parentconf: cleanup final path buffer handling (diff)
downloadwireguard-windows-0037b328f8214d42932ee1984c712ecb364e994c.tar.xz
wireguard-windows-0037b328f8214d42932ee1984c712ecb364e994c.zip
conf: do not attempt to create programfiles
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'conf')
-rw-r--r--conf/path_windows.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/conf/path_windows.go b/conf/path_windows.go
index e02b03eb..526aeba0 100644
--- a/conf/path_windows.go
+++ b/conf/path_windows.go
@@ -51,6 +51,7 @@ func RootDirectory(create bool) (string, error) {
if cachedRootDir != "" {
return cachedRootDir, nil
}
+ //TODO: remove the wow detection logic when Go supports arm64
var isWow bool
var processMachine, nativeMachine uint16
err := windows.IsWow64Process2(windows.CurrentProcess(), &processMachine, &nativeMachine)
@@ -67,7 +68,7 @@ func RootDirectory(create bool) (string, error) {
}
var root string
if !isWow {
- root, err = windows.KnownFolderPath(windows.FOLDERID_ProgramFiles, windows.KF_FLAG_CREATE)
+ root, err = windows.KnownFolderPath(windows.FOLDERID_ProgramFiles, windows.KF_FLAG_DEFAULT)
if err != nil {
return "", err
}