mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-03-16 04:03:17 +08:00
🚸 显式调用uac
This commit is contained in:
@@ -733,10 +733,14 @@ async function tryLaunchGame(): Promise<void> {
|
||||
const isInAdmin = await isRunInAdmin();
|
||||
if (!isInAdmin) {
|
||||
showSnackbar.success(`成功获取ticket:${resp},正在启动应用...`);
|
||||
const cmd = Command.create("exec-sh", [`&"${gamePath}" login_auth_ticket=${resp}`], {
|
||||
cwd: gameDir.value,
|
||||
encoding: "utf-8",
|
||||
});
|
||||
const cmd = Command.create(
|
||||
"exec-sh",
|
||||
[
|
||||
"-Command",
|
||||
`Start-Process -FilePath '${gamePath}' -ArgumentList 'login_auth_ticket=${resp}' -Verb RunAs`,
|
||||
],
|
||||
{ cwd: gameDir.value, encoding: "utf-8" },
|
||||
);
|
||||
const result = await cmd.execute();
|
||||
if (result.stderr) {
|
||||
await TGLogger.Error(`[sidebar][tryLaunchGame] 启动游戏本体失败!`);
|
||||
|
||||
@@ -57,11 +57,14 @@ async function tryPlayGame(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
showSnackbar.success(`成功获取ticket:${resp},正在启动应用...`);
|
||||
const cmd = Command.create("exec-sh", [`&"${gamePath}" login_auth_ticket=${resp}`], {
|
||||
cwd: gameDir.value,
|
||||
encoding: "utf-8",
|
||||
});
|
||||
console.log(cmd);
|
||||
const cmd = Command.create(
|
||||
"exec-sh",
|
||||
[
|
||||
"-Command",
|
||||
`Start-Process -FilePath '${gamePath}' -ArgumentList 'login_auth_ticket=${resp}' -Verb RunAs`,
|
||||
],
|
||||
{ cwd: gameDir.value, encoding: "utf-8" },
|
||||
);
|
||||
const result = await cmd.execute();
|
||||
if (result.stderr) {
|
||||
await TGLogger.Error(`[config][gameBadge] 启动游戏本体失败!`);
|
||||
|
||||
Reference in New Issue
Block a user