stabilize runtime state on native Windows

This commit is contained in:
Sinabina
2026-07-17 14:21:10 -07:00
parent 9b3188e74b
commit 9bb382f2ee
8 changed files with 129 additions and 33 deletions
+2 -1
View File
@@ -531,7 +531,8 @@ export async function validateRuntimeBundle(directory, context = {}) {
const stat = await fs.lstat(absolute).catch(() => null);
if (!stat?.isFile()) throw installError(`Runtime bundle file is missing: ${relative}`, "INSTALL_VALIDATION_FAILED");
const digest = await sha256File(absolute);
if (digest !== file.sha256 || stat.size !== file.size || (stat.mode & 0o777) !== file.mode) {
const modeMatches = (context.platform ?? process.platform) === "win32" || (stat.mode & 0o777) === file.mode;
if (digest !== file.sha256 || stat.size !== file.size || !modeMatches) {
throw installError(`Runtime bundle file failed integrity validation: ${relative}`, "INSTALL_VALIDATION_FAILED");
}
}