回滚动态UAC

This commit is contained in:
2023-11-13 22:52:40 +08:00
parent 2594f85f25
commit b6f0728e2c
7 changed files with 12 additions and 93 deletions

View File

@ -162,9 +162,6 @@ class HomeUIModel extends BaseUIModel {
VoidCallback? doCheck() {
if (isChecking) return null;
return () async {
if (!AppConf.isRunningAdmin) {
await showToast(context!, "因微软商店版本权限限制,若功能异常请 关闭盒子,右键 '以管理员身份运行'。");
}
isChecking = true;
lastScreenInfo = "正在分析...";
await _statCheck();
@ -299,8 +296,7 @@ class HomeUIModel extends BaseUIModel {
return;
case "no_live_path":
try {
SystemHelper.powershellAdminRun(
['New-Item -ItemType Directory -Path "${item.value}" -Force']);
await Directory(item.value).create(recursive: true);
showToast(context!, "创建文件夹成功,请尝试继续下载游戏!");
checkResult?.remove(item);
notifyListeners();
@ -329,8 +325,8 @@ class HomeUIModel extends BaseUIModel {
final Map eacJson = json.decode(utf8.decode(eacJsonData));
final eacID = eacJson["productid"];
try {
var result = await SystemHelper.powershellAdminRun(
["${item.value}\\EasyAntiCheat_EOS_Setup.exe", "install", eacID]);
var result = await Process.run(
"${item.value}\\EasyAntiCheat_EOS_Setup.exe", ["install", eacID]);
dPrint("${item.value}\\EasyAntiCheat_EOS_Setup.exe install $eacID");
if (result.stderr == "") {
showToast(context!, "修复成功,请尝试启动游戏。(若问题无法解决,请使用工具箱的 《重装 EAC》");
@ -370,9 +366,6 @@ class HomeUIModel extends BaseUIModel {
showToast(context!, "该功能需要一个有效的安装位置");
return;
}
if (!AppConf.isRunningAdmin) {
await showToast(context!, "因微软商店版本权限限制,若功能异常请 关闭盒子,右键 '以管理员身份运行'。");
}
showDialog(
context: context!,
dismissWithEsc: false,
@ -387,9 +380,6 @@ class HomeUIModel extends BaseUIModel {
showToast(context!, "该功能需要一个有效的安装位置");
return;
}
if (!AppConf.isRunningAdmin) {
await showToast(context!, "因微软商店版本权限限制,若功能异常请 关闭盒子,右键 '以管理员身份运行'。");
}
AnalyticsApi.touch("performance_launch");
BaseUIContainer(
uiCreate: () => PerformanceUI(),