修复AGC在Windows上的启动失败
Project CI / Frontend tests (push) Failing after 25s
Project CI / Repository checks (push) Failing after 54s
Project CI / Backend tests (push) Successful in 4m54s
Project CI / Native shell tests (push) Failing after 7m35s

通过子进程私有环境变量传递DACL目标路径,避免PowerShell命令参数解析失败。
同步补充AI游戏创作实施方案和项目踩坑记录。
This commit is contained in:
2026-07-27 17:43:45 +08:00
parent b18b367382
commit 0ef5c2bb79
3 changed files with 11 additions and 5 deletions
@@ -31,8 +31,8 @@ const npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm';
const windowsPrivateAclScript = String.raw`
$ErrorActionPreference = 'Stop'
$target = [System.IO.Path]::GetFullPath($args[0])
$isDirectory = [System.Boolean]::Parse($args[1])
$target = [System.IO.Path]::GetFullPath($env:GENARRATIVE_AGC_PRIVATE_PATH)
$isDirectory = [System.Boolean]::Parse($env:GENARRATIVE_AGC_PRIVATE_IS_DIRECTORY)
$currentSid = [System.Security.Principal.WindowsIdentity]::GetCurrent().User
$inheritance = [System.Security.AccessControl.InheritanceFlags]::None
if ($isDirectory) {
@@ -297,9 +297,13 @@ export async function secureWindowsGameCreatorPathForCurrentUser(
'Bypass',
'-Command',
windowsPrivateAclScript,
targetPath,
String(isDirectory),
]);
], {
env: {
...process.env,
GENARRATIVE_AGC_PRIVATE_PATH: targetPath,
GENARRATIVE_AGC_PRIVATE_IS_DIRECTORY: String(isDirectory),
},
});
if (result.code !== 0 || result.signal) {
const detail = result.stderr.trim() || result.stdout.trim();
throw new Error(