mirror of
https://github.com/netbirdio/netbird.git
synced 2024-11-22 16:13:31 +01:00
6d4240a5ae
Periodically fetch the latest available version, and the UI will shows a new menu for the download link. It checks both the daemon version and the UI version.
20 lines
452 B
Go
20 lines
452 B
Go
package version
|
|
|
|
import "golang.org/x/sys/windows/registry"
|
|
|
|
const (
|
|
urlWinExe = "https://pkgs.netbird.io/windows/x64"
|
|
)
|
|
|
|
var regKeyAppPath = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\Netbird"
|
|
|
|
// DownloadUrl return with the proper download link
|
|
func DownloadUrl() string {
|
|
_, err := registry.OpenKey(registry.LOCAL_MACHINE, regKeyAppPath, registry.QUERY_VALUE)
|
|
if err == nil {
|
|
return urlWinExe
|
|
} else {
|
|
return downloadURL
|
|
}
|
|
}
|