mirror of
https://github.com/YuJunZhiXue/dsh-purge.git
synced 2026-11-28 01:20:22 +08:00
fix(desktop): PowerShell asar-swap restart 加 asar-missing guard — 修启动闪屏+慢
asar 已被 unpack 挪走后(desktop 常态), restartOfficialHarness 的 PowerShell 分支仍无条件 schedule 一次 kill-and-swap: fs.rename ENOENT, 但 Electron 已被 PowerShell 杀一遍 → 用户看到启动闪屏 + 多拉一次 Electron 启动慢。 此分支加 asarArchiveIsFile(asar) 前置守卫, 与 wscript 分支的 1406 行 守卫对齐; asar 不在时 early-return, 让宿主自然起 unpacked /app/。 同时在 D:\DeepSeek Harness\.dsh\profiles\desktop\cordis.patch.yml 加 compaction-basic disabled:false override: desktop 单 preset 下 web-app 的 disabled 把 base 的 compaction-basic 关了, 原设计 host plane 另装, 不装就 command-compact 永远 pending → host crash dialog。
This commit is contained in:
1 parent
2595360b79
commit
3ad257e5a7
1 file changed
+8
@@ -1444,6 +1444,14 @@ export function restartOfficialHarness(options = {}) {
|
||||
try { fs.unlinkSync(inflight); } catch { /* 没有残留标记 */ }
|
||||
}
|
||||
if (plan.kind === "powershell") {
|
||||
// [dsh-purge-fix 2026-10-09] asar 已被挪走(unpacked 模式常态)时,再 schedule
|
||||
// 一次 PowerShell kill+swap 没意义:fs.rename ENOENT,但 PowerShell 已经 kill
|
||||
// Electron 一次 → 用户看到启动闪屏 + 启动慢 (多拉一次 Electron)。此处 early-
|
||||
// return,让宿主自然启动走 unpacked /app/,不再多 kill 一次。
|
||||
if (!asar || !asarArchiveIsFile(asar)) {
|
||||
console.warn("[dsh-purge] asar 已不存在(unpacked 模式),跳过 PowerShell swap restart");
|
||||
return { restarting: false, asarMissing: true };
|
||||
}
|
||||
console.warn("[dsh-purge] wscript 不能执行 .js,改用 PowerShell 挪开 app.asar");
|
||||
try {
|
||||
scheduleAsarSwapRestart({
|
||||
|
||||
Reference in new issue
Block a user