summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBrendan Allan <[email protected]>2025-12-23 18:14:16 +0800
committerBrendan Allan <[email protected]>2025-12-23 18:14:44 +0800
commitc20f2731abb480b2bf39b753158b25954f1d276f (patch)
treeec2fb9124e2851fcfbbff30f6795d9ee940a7fc4
parent01ca1a384a7f86e7fd93b928b8492a888ffb11f9 (diff)
downloadopencode-c20f2731abb480b2bf39b753158b25954f1d276f.tar.gz
opencode-c20f2731abb480b2bf39b753158b25954f1d276f.zip
desktop: kill_sidecar before update install on windows
-rw-r--r--packages/desktop/src/index.tsx1
-rw-r--r--packages/desktop/src/updater.ts2
2 files changed, 3 insertions, 0 deletions
diff --git a/packages/desktop/src/index.tsx b/packages/desktop/src/index.tsx
index 57c1fbe55..281b613d6 100644
--- a/packages/desktop/src/index.tsx
+++ b/packages/desktop/src/index.tsx
@@ -83,6 +83,7 @@ const platform: Platform = {
update: async () => {
if (!UPDATER_ENABLED || !update) return
+ if(ostype() === "windows") await invoke("kill_sidecar")
await update.install()
},
diff --git a/packages/desktop/src/updater.ts b/packages/desktop/src/updater.ts
index 0a14026e4..2c58322a4 100644
--- a/packages/desktop/src/updater.ts
+++ b/packages/desktop/src/updater.ts
@@ -2,6 +2,7 @@ import { check } from "@tauri-apps/plugin-updater"
import { relaunch } from "@tauri-apps/plugin-process"
import { ask, message } from "@tauri-apps/plugin-dialog"
import { invoke } from "@tauri-apps/api/core"
+import { type as ostype } from "@tauri-apps/plugin-os"
export const UPDATER_ENABLED = window.__OPENCODE__?.updaterEnabled ?? false
@@ -34,6 +35,7 @@ export async function runUpdater({ alertOnFail }: { alertOnFail: boolean }) {
if (!shouldUpdate) return
try {
+ if(ostype() === "windows") await invoke("kill_sidecar")
await update.install()
} catch {
await message("Failed to install update", { title: "Update Failed" })