Skip to content

Commit

Permalink
Fix compilation on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mholt committed Jul 28, 2022
1 parent 35a81d7 commit 56c139f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/removebinary_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ import (
func removeCaddyBinary(path string) error {
var sI syscall.StartupInfo
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)
}

0 comments on commit 56c139f

Please sign in to comment.