mirror of
https://github.com/YuJunZhiXue/dsh-purge.git
synced 2026-11-28 10:30:24 +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
+5
-5
@@ -68,7 +68,7 @@ function writeAppliedStamp(sha) {
|
||||
* 先把宿主文件从备份还原,再按当前这份插件的补丁重写。
|
||||
* 低版本带着自己的补丁列表,高版本带着自己的;回退到哪一版就打哪一版。
|
||||
*/
|
||||
export async function reapplyInstalled() {
|
||||
export async function reapplyInstalled(options = {}) {
|
||||
core.applyRuntimeEnv();
|
||||
let aiBase = null;
|
||||
let handoff = null;
|
||||
@@ -78,10 +78,10 @@ export async function reapplyInstalled() {
|
||||
} catch (e) {
|
||||
return { ok: false, error: String(e && e.message ? e.message : e) };
|
||||
}
|
||||
if (!aiBase) {
|
||||
if (!aiBase || options.forceExtract === true) {
|
||||
try {
|
||||
const opened = await core.openSealedDesktopHost();
|
||||
aiBase = opened.aiBase;
|
||||
const opened = await core.openSealedDesktopHost({ forceExtract: options.forceExtract === true });
|
||||
if (opened.aiBase) aiBase = opened.aiBase;
|
||||
if (opened.swapAsar) handoff = opened;
|
||||
} catch (e) {
|
||||
return { ok: false, error: String(e && e.message ? e.message : e) };
|
||||
@@ -97,7 +97,7 @@ export async function reapplyInstalled() {
|
||||
await core.patchAllShims();
|
||||
const flash = core.silenceCmdFlash(aiBase);
|
||||
let renamed = false;
|
||||
if (handoff?.asar) {
|
||||
if (handoff?.asar && options.scheduleSwap !== false) {
|
||||
const swapped = core.scheduleSealedDesktopRestart(handoff);
|
||||
renamed = Boolean(swapped?.renamed);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user