动态 UAC

This commit is contained in:
2023-11-10 21:58:29 +08:00
parent 4776aa5647
commit 52591f4899
9 changed files with 69 additions and 41 deletions

View File

@ -18,6 +18,7 @@ class MDContentDialogUI extends BaseUI<MDContentDialogUIModel> {
padding: const EdgeInsets.only(left: 12, right: 12),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: makeMarkdownView(model.data ?? ""),
),
),

View File

@ -296,7 +296,8 @@ class HomeUIModel extends BaseUIModel {
return;
case "no_live_path":
try {
await Directory(item.value).create(recursive: true);
SystemHelper.powershellAdminRun(
['New-Item -ItemType Directory -Path "${item.value}" -Force']);
showToast(context!, "创建文件夹成功,请尝试继续下载游戏!");
checkResult?.remove(item);
notifyListeners();
@ -325,8 +326,8 @@ class HomeUIModel extends BaseUIModel {
final Map eacJson = json.decode(utf8.decode(eacJsonData));
final eacID = eacJson["productid"];
try {
var result = await Process.run(
"${item.value}\\EasyAntiCheat_EOS_Setup.exe", ["install", eacID]);
var result = await SystemHelper.powershellAdminRun(
["${item.value}\\EasyAntiCheat_EOS_Setup.exe", "install", eacID]);
dPrint("${item.value}\\EasyAntiCheat_EOS_Setup.exe install $eacID");
if (result.stderr == "") {
showToast(context!, "修复成功,请尝试启动游戏。(若问题无法解决,请使用工具箱的 《重装 EAC》");