Skip to content

Commit 654aa95

Browse files
authored
[client,gui] Update url_windows.go to offer arm64 executable download (#4586)
1 parent 9021bb5 commit 654aa95

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

version/url_windows.go

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,28 @@
11
package version
22

3-
import "golang.org/x/sys/windows/registry"
3+
import (
4+
"golang.org/x/sys/windows/registry"
5+
"runtime"
6+
)
47

58
const (
69
urlWinExe = "https://pkgs.netbird.io/windows/x64"
10+
urlWinExeArm = "https://pkgs.netbird.io/windows/arm64"
711
)
812

913
var regKeyAppPath = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\Netbird"
1014

1115
// DownloadUrl return with the proper download link
1216
func DownloadUrl() string {
1317
_, err := registry.OpenKey(registry.LOCAL_MACHINE, regKeyAppPath, registry.QUERY_VALUE)
14-
if err == nil {
15-
return urlWinExe
16-
} else {
18+
if err != nil {
1719
return downloadURL
1820
}
21+
22+
url := urlWinExe
23+
if runtime.GOARCH == "arm64" {
24+
url = urlWinExeArm
25+
}
26+
27+
return url
1928
}

0 commit comments

Comments
 (0)