Skip to content

Create polished demo videos without editing skills. Mac/Windows/Linux

fix(windows): prevent cursor monitor ENOENT crash and build helper in release

webadderallf0f19817296a
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 1827b022..254352d7 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -119,6 +119,7 @@ jobs:
- name: Build Windows x64
shell: pwsh
run: |
+ npm run build:cursor-monitor
npx tsc
npx vite build
npx electron-builder --win nsis --x64 --publish never
diff --git a/electron/ipc/handlers.ts b/electron/ipc/handlers.ts
index 4228ab21..3c3430dc 100644
--- a/electron/ipc/handlers.ts
+++ b/electron/ipc/handlers.ts
@@ -1112,6 +1112,13 @@ async function startNativeCursorMonitor() {
let helperPath: string
if (process.platform === 'win32') {
helperPath = getCursorMonitorExePath()
+ try {
+ await fs.access(helperPath, fsConstants.X_OK)
+ } catch {
+ console.warn('Windows cursor monitor helper missing or not executable:', helperPath)
+ currentCursorVisualType = 'arrow'
+ return
+ }
} else {
helperPath = await ensureNativeCursorMonitorBinary()
}
@@ -1122,6 +1129,13 @@ async function startNativeCursorMonitor() {
stdio: ['pipe', 'pipe', 'pipe'],
})
+ nativeCursorMonitorProcess.once('error', (error) => {
+ console.warn('Native cursor monitor process error:', error)
+ nativeCursorMonitorProcess = null
+ nativeCursorMonitorOutputBuffer = ''
+ currentCursorVisualType = 'arrow'
+ })
+
nativeCursorMonitorProcess.stdout.on('data', handleCursorMonitorStdout)
nativeCursorMonitorProcess.once('close', () => {