Updated elevation approach

This commit is contained in:
Corey Butler
2022-10-31 18:55:01 -05:00
parent 9c2b3b4835
commit f31dd2ab90
3 changed files with 7 additions and 323 deletions

View File

@@ -943,7 +943,12 @@ func updateRootDir(path string) {
}
func elevatedRun(name string, arg ...string) (bool, error) {
return run(filepath.Join(env.root, "elevate.cmd"), append([]string{"cmd", "/C", name}, arg...)...)
ok, err := run("cmd", append([]string{"/C", name}, arg...)...)
if err != nil {
ok, err = run(filepath.Join(env.root, "elevate.cmd"), append([]string{"cmd", "/C", name}, arg...)...)
}
return ok, err
}
func run(name string, arg ...string) (bool, error) {