diff --git a/pkg/permission/windows.go b/pkg/permission/windows.go index 2169951..00cf5cf 100644 --- a/pkg/permission/windows.go +++ b/pkg/permission/windows.go @@ -1,30 +1,30 @@ package permission -import ( - "fmt" - "golang.org/x/sys/windows" - "os" - "strings" - "syscall" -) - -func RunMeElevated() error { - verb := "runas" - exe, _ := os.Executable() - cwd, _ := os.Getwd() - args := strings.Join(os.Args[1:], " ") - - verbPtr, _ := syscall.UTF16PtrFromString(verb) - exePtr, _ := syscall.UTF16PtrFromString(exe) - cwdPtr, _ := syscall.UTF16PtrFromString(cwd) - argPtr, _ := syscall.UTF16PtrFromString(args) - - var showCmd int32 = 1 //SW_NORMAL - - err := windows.ShellExecute(0, verbPtr, exePtr, argPtr, cwdPtr, showCmd) - if err != nil { - return fmt.Errorf("windows shell execute: %w", err) - } - - return nil -} +//import ( +// "fmt" +// "golang.org/x/sys/windows" +// "os" +// "strings" +// "syscall" +//) +// +//func RunMeElevated() error { +// verb := "runas" +// exe, _ := os.Executable() +// cwd, _ := os.Getwd() +// args := strings.Join(os.Args[1:], " ") +// +// verbPtr, _ := syscall.UTF16PtrFromString(verb) +// exePtr, _ := syscall.UTF16PtrFromString(exe) +// cwdPtr, _ := syscall.UTF16PtrFromString(cwd) +// argPtr, _ := syscall.UTF16PtrFromString(args) +// +// var showCmd int32 = 1 //SW_NORMAL +// +// err := windows.ShellExecute(0, verbPtr, exePtr, argPtr, cwdPtr, showCmd) +// if err != nil { +// return fmt.Errorf("windows shell execute: %w", err) +// } +// +// return nil +//}