Tom Butcher ee35e12959
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good
Add farmcontrolinstaller logo and enhance Windows path handling
- Introduced a new logo file for the farmcontrol installer.
- Updated the `patch-electrobun-src.mjs` script to improve the resolution of the native wrapper path, ensuring compatibility across different execution contexts.
- Refactored the `index.js` file to utilize a new function for setting the working directory on Windows, enhancing application behavior.
- Added a new module in `windows-app-paths.js` to manage Windows-specific directory resolution and ensure the correct working directory is set before launching the application.
2026-08-02 23:32:27 +01:00

44 lines
1.0 KiB
JavaScript

import { ensureWindowsWorkingDirectory } from '../desktop/windows-app-paths.js'
import {
captureLaunchUrl,
closeSingleInstanceServer,
ensureSingleInstanceLock
} from '../desktop/single-instance.js'
ensureWindowsWorkingDirectory()
const launchUrl = captureLaunchUrl()
const gotSingleInstanceLock = await ensureSingleInstanceLock({ launchUrl })
if (!gotSingleInstanceLock) {
process.exit(0)
}
const { createAppRpc } = await import('../desktop/rpc.js')
const {
registerGlobalShortcuts,
unregisterGlobalShortcuts
} = await import('../desktop/spotlight.js')
const {
createMainWindow,
handleDeepLinkFromArgv,
setupDevAuthServer,
setupNavigationGestures,
setupWindowsDeepLinkHandling
} = await import('../desktop/window.js')
setupWindowsDeepLinkHandling()
const rpc = createAppRpc()
const mainWindow = await createMainWindow(rpc)
setupNavigationGestures(mainWindow)
registerGlobalShortcuts(rpc)
setupDevAuthServer()
handleDeepLinkFromArgv(launchUrl)
process.on('exit', () => {
unregisterGlobalShortcuts()
closeSingleInstanceServer()
})