From fc35a0607a857f2ded90e10a3e15d182a84288b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eren=20=C3=87akar?= Date: Sun, 31 May 2026 16:56:11 +0300 Subject: [PATCH] fix: use resources/bin/orca.cmd for packaged Windows CLI path (#4165) * feat(ui): add instruction hints to command and prompt dialogs Add helper text below prompt/description textareas in the quick command dialog, automation editor dialog, and create PR dialog to inform users about supported features like skills, file paths, and built-in commands. Closes #3998 * fix: use resources/bin/orca.cmd for packaged Windows CLI path resolveCommandPath() returned %LOCALAPPDATA%\\Programs\\Orca\\bin\\orca.cmd but the actual CLI after updates lives at resources\\bin\\orca.cmd. The bin\\orca.cmd shim is wiped on every update, breaking CLI access. * chore: keep windows cli path PR focused --------- Co-authored-by: Neil <4138956+nwparker@users.noreply.github.com> --- src/main/cli/cli-installer.test.ts | 25 +++++++++++++++++++++++++ src/main/cli/cli-installer.ts | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/main/cli/cli-installer.test.ts b/src/main/cli/cli-installer.test.ts index 4a7a12dcb..e9472d3bf 100644 --- a/src/main/cli/cli-installer.test.ts +++ b/src/main/cli/cli-installer.test.ts @@ -643,6 +643,31 @@ describe('CliInstaller', () => { } ) + it('resolves packaged Windows command path to resources/bin/orca.cmd', async () => { + const fixture = await makeFixture() + const localAppDataPath = fixture.root + const resourcesPath = join(fixture.root, 'resources') + await mkdir(join(resourcesPath, 'bin'), { recursive: true }) + await writeFile(join(resourcesPath, 'bin', 'orca.cmd'), '@echo off\n', 'utf8') + + const installer = new CliInstaller({ + platform: 'win32', + isPackaged: true, + resourcesPath, + localAppDataPath, + userDataPath: fixture.userDataPath, + execPath: join(localAppDataPath, 'Programs', 'Orca', 'Orca.exe'), + appPath: fixture.appPath, + userPathReader: async () => null, + userPathWriter: async () => {} + }) + + const status = await installer.getStatus() + expect(status.commandPath).toBe( + join(localAppDataPath, 'Programs', 'Orca', 'resources', 'bin', 'orca.cmd') + ) + }) + // Why: the arm64 fallback must apply for packaged builds, not just dev launchers. it.skipIf(process.platform === 'win32')( 'resolves to ~/.local/bin/orca on arm64 even when isPackaged is true', diff --git a/src/main/cli/cli-installer.ts b/src/main/cli/cli-installer.ts index f9c17d824..1480ad20b 100644 --- a/src/main/cli/cli-installer.ts +++ b/src/main/cli/cli-installer.ts @@ -280,7 +280,7 @@ export class CliInstaller { } if (this.platform === 'win32') { - return join(this.localAppDataPath, 'Programs', 'Orca', 'bin', 'orca.cmd') + return join(this.localAppDataPath, 'Programs', 'Orca', 'resources', 'bin', 'orca.cmd') } return null