forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresolveHelperPath.ts
More file actions
21 lines (20 loc) · 788 Bytes
/
Copy pathresolveHelperPath.ts
File metadata and controls
21 lines (20 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { app } from 'electron'
import { join } from 'path'
import { existsSync } from 'fs'
/**
* Resolve the on-disk path to the bundled win-automation-helper.exe.
* Mirrors src/main/ocr/resolveHelperPath.ts (packaged-unpacked, extraResources,
* dev). Returns the dev path last so the bridge surfaces a clear "not found".
*/
export function resolveHelperPath(): string {
const exe = 'win-automation-helper.exe'
const candidates = [
join(process.resourcesPath, 'app.asar.unpacked', 'resources', 'win-automation-helper', exe),
join(process.resourcesPath, 'win-automation-helper', exe),
join(app.getAppPath(), 'resources', 'win-automation-helper', exe)
]
for (const c of candidates) {
if (existsSync(c)) return c
}
return candidates[candidates.length - 1]
}