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>
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user