mirror of
https://github.com/YuJunZhiXue/dsh-purge.git
synced 2026-11-28 13:20:22 +08:00
feat: 发布 1.1.20,官方桌面升级安装已下载的新版本
对准 dsh 0.1.7-rc.2,并保留 0.1.7-rc.1 的旧锚点。安装目录不写死盘符。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
fd8d47c00f
commit
978538f0ae
11 files changed
+494
-29
No files matched your search
+4
-1
@@ -3,6 +3,7 @@ import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { execFileSync, spawn } from "node:child_process";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { launchOfficialDesktopUpdate, pendingOfficialUpdate } from "./official-update.js";
|
||||
|
||||
/** 路径落在 `app.asar/...` 里面。`app.asar` 文件本身和 `app.asar.unpacked` 不算。 */
|
||||
export function isAsarSealedPath(p) {
|
||||
@@ -727,7 +728,7 @@ function officialRestartScript(exe, asar) {
|
||||
"function z(n) { return (n < 10 ? '0' : '') + n; }",
|
||||
"function stamp() { var d = new Date(); return d.getFullYear() + '-' + z(d.getMonth() + 1) + '-' + z(d.getDate()) + 'T' + z(d.getHours()) + ':' + z(d.getMinutes()) + ':' + z(d.getSeconds()); }",
|
||||
"function log(m) { var f = fso.OpenTextFile(logPath, 8, true); f.WriteLine(stamp() + ' ' + m); f.Close(); }",
|
||||
"function samePath(a, b) { return String(a || '').toLowerCase() === String(b || '').toLowerCase(); }",
|
||||
"function samePath(a, b) { return String(a || '').replace(/\\//g, '\\\\').toLowerCase() === String(b || '').replace(/\\//g, '\\\\').toLowerCase(); }",
|
||||
"function pids() { var out = []; var e = new Enumerator(wmi.ExecQuery(\"SELECT ProcessId, ExecutablePath FROM Win32_Process WHERE Name = 'DeepSeek Harness.exe'\")); for (; !e.atEnd(); e.moveNext()) { var p = e.item(); if (samePath(p.ExecutablePath, exe)) out.push(p.ProcessId); } return out; }",
|
||||
"log('begin');",
|
||||
"WScript.Sleep(800);",
|
||||
@@ -754,6 +755,8 @@ function officialRestartScript(exe, asar) {
|
||||
export function restartOfficialHarness() {
|
||||
const exe = officialExeFromProcess();
|
||||
if (!exe) return { restarting: false };
|
||||
const pending = pendingOfficialUpdate(exe);
|
||||
if (pending) return launchOfficialDesktopUpdate(exe, pending);
|
||||
const asar = path.join(path.dirname(exe), "resources", "app.asar");
|
||||
const script = path.join(os.tmpdir(), "dsh-purge-official-restart.js");
|
||||
const launcher = path.join(os.tmpdir(), "dsh-purge-official-restart.cmd");
|
||||
|
||||
Reference in new issue
Block a user