aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/updater
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-05-13 09:01:49 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-05-13 13:28:00 +0200
commitcdb3701c95cbe6379288c486231e71e42dca0601 (patch)
tree710f0442ce9e89bc7832c9db56bfa8cdef00bb64 /updater
parentui: lock runtime thread as early as possible (diff)
downloadwireguard-windows-cdb3701c95cbe6379288c486231e71e42dca0601.tar.xz
wireguard-windows-cdb3701c95cbe6379288c486231e71e42dca0601.zip
service: allow go to create correct environment block
Diffstat (limited to 'updater')
-rw-r--r--updater/downloader.go4
-rw-r--r--updater/msirunner_windows.go3
2 files changed, 3 insertions, 4 deletions
diff --git a/updater/downloader.go b/updater/downloader.go
index 2f83b9b2..88931d61 100644
--- a/updater/downloader.go
+++ b/updater/downloader.go
@@ -70,7 +70,7 @@ func CheckForUpdate() (*UpdateFound, error) {
var updateInProgress = uint32(0)
-func DownloadVerifyAndExecute(userToken uintptr, userEnvironment []string) (progress chan DownloadProgress) {
+func DownloadVerifyAndExecute(userToken uintptr) (progress chan DownloadProgress) {
progress = make(chan DownloadProgress, 128)
progress <- DownloadProgress{Activity: "Initializing"}
@@ -158,7 +158,7 @@ func DownloadVerifyAndExecute(userToken uintptr, userEnvironment []string) (prog
}
progress <- DownloadProgress{Activity: "Installing update"}
- err = runMsi(name, userToken, userEnvironment)
+ err = runMsi(name, userToken)
os.Remove(name) //TODO: Do we have any sort of TOCTOU here?
if err != nil {
progress <- DownloadProgress{Error: err}
diff --git a/updater/msirunner_windows.go b/updater/msirunner_windows.go
index de3fb58e..1ea405f4 100644
--- a/updater/msirunner_windows.go
+++ b/updater/msirunner_windows.go
@@ -19,7 +19,7 @@ import (
"unsafe"
)
-func runMsi(msiPath string, userToken uintptr, env []string) error {
+func runMsi(msiPath string, userToken uintptr) error {
system32, err := windows.GetSystemDirectory()
if err != nil {
return err
@@ -34,7 +34,6 @@ func runMsi(msiPath string, userToken uintptr, env []string) error {
Token: syscall.Token(userToken),
},
Files: []*os.File{devNull, devNull, devNull},
- Env: env,
Dir: path.Dir(msiPath),
}
msiexec := path.Join(system32, "msiexec.exe")