mirror of
https://github.com/YuJunZhiXue/dsh-purge.git
synced 2026-11-28 10:40:22 +08:00
feat: 发布 1.1.19,支持官方桌面 EXE
官方客户端可以应用并自己重启;修掉重启弹窗、残留 PowerShell,以及更新时要手动还原再应用的问题。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
00ccf4a1f1
commit
fd8d47c00f
16 files changed
+973
-72
No files matched your search
+5
-1
@@ -2,6 +2,7 @@ import { createRequire, registerHooks } from "node:module";
|
||||
import { pathToFileURL } from "node:url";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import path from "node:path";
|
||||
import { isAsarSealedPath } from "./desktop.js";
|
||||
|
||||
const MARK = "__dshPurgeHideConsole";
|
||||
const IMPORT_MARK = "dsh-purge-hide-console";
|
||||
@@ -196,7 +197,9 @@ export function resolveDshBinRoot(hint, { fs, path: nodePath } = {}) {
|
||||
}
|
||||
for (const root of tries) {
|
||||
try {
|
||||
if (nodeFs.existsSync(p.join(root, "lib", "bin.js"))) return p.normalize(root);
|
||||
const binJs = p.join(root, "lib", "bin.js");
|
||||
if (isAsarSealedPath(root) || isAsarSealedPath(binJs)) continue;
|
||||
if (nodeFs.existsSync(binJs)) return p.normalize(root);
|
||||
} catch {}
|
||||
}
|
||||
return null;
|
||||
@@ -213,6 +216,7 @@ export function installHideConsoleIntoBin(aiBase, { fs, path: nodePath } = {}) {
|
||||
const binJs = p.join(root, "lib", "bin.js");
|
||||
const side = p.join(root, "lib", `${IMPORT_MARK}.js`);
|
||||
const facadeSide = p.join(root, "lib", "dsh-purge-child-process-hide.mjs");
|
||||
if (isAsarSealedPath(root) || isAsarSealedPath(binJs)) return "sealed_asar";
|
||||
|
||||
const facadeSrc = nodeFs.readFileSync(
|
||||
fileURLToPath(new URL("./child-process-hide.mjs", import.meta.url)),
|
||||
|
||||
Reference in new issue
Block a user