Skip to content

Commit

Permalink
优化管理员权限授权提示
Browse files Browse the repository at this point in the history
  • Loading branch information
Jrohy committed Jan 18, 2022
1 parent 565d73f commit d8a6f84
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion data.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,19 @@ func checkCfw() *cfwInfo {
ci.rootPath = strings.Trim(path.Dir(strings.Replace(info, "\\", "/", -1)), "\"")
info = strings.Replace(info, "\"", "", -1)
if !IsExists(info) {
exit("请尝试以管理员身份运行此程序")
exit("无法获取cfw信息, 请以管理员身份运行此程序")
}
ci.version = getExeVersion(info)
ci.process = item
if IsExists(fmt.Sprintf("%s/Uninstall Clash for Windows.exe", ci.rootPath)) {
ci.installVersion = true
updateCore = false
if f, err := os.Create(path.Join(ci.rootPath, "test")); err != nil {
exit(fmt.Sprintf("%s目录无权限写入, 请以管理员身份运行此程序", ci.rootPath))
} else {
f.Close()
os.Remove(path.Join(ci.rootPath, "test"))
}
}
break
}
Expand Down

0 comments on commit d8a6f84

Please sign in to comment.