Fix compilation on Windows

This commit is contained in:
Matthew Holt 2022-07-28 15:44:36 -06:00
parent 35a81d7c5b
commit 56c139f003
No known key found for this signature in database
GPG key ID: 2A349DD577D586A5

View file

@ -31,6 +31,9 @@ import (
func removeCaddyBinary(path string) error { func removeCaddyBinary(path string) error {
var sI syscall.StartupInfo var sI syscall.StartupInfo
var pI syscall.ProcessInformation var pI syscall.ProcessInformation
argv := syscall.UTF16PtrFromString(filepath.Join(os.Getenv("windir"), "system32", "cmd.exe") + " /C del " + path) argv, err := syscall.UTF16PtrFromString(filepath.Join(os.Getenv("windir"), "system32", "cmd.exe") + " /C del " + path)
if err != nil {
return err
}
return syscall.CreateProcess(nil, argv, nil, nil, true, 0, nil, nil, &sI, &pI) return syscall.CreateProcess(nil, argv, nil, nil, true, 0, nil, nil, &sI, &pI)
} }