import { spawn } from "node:child_process"; import { existsSync } from "node:fs"; import log from 'electron-log' import path from "node:path"; export const getPacsPath = (platform: "macos" | "windows", isDevelopment: boolean): string => { const orthancExecFile = { macos: "orthanc-mac-24.8.1/Orthanc", windows: "orthanc-win64-1.12.4/Orthanc.exe" } const basePath = isDevelopment ? path.join(process.env.VITE_PUBLIC, "../extraResources") : path.join(process.resourcesPath, 'lib'); return path.join(basePath, orthancExecFile[platform]) } export const runOrthancServer = (pacsPath: string) => { if (existsSync(pacsPath)) { const child_process = spawn(pacsPath) child_process.stdout.on('data', data => log.info(data)) // child_process.stderr.on('data', data => log.error(data)) } else { console.error('pacsPath is a not exist') log.error('pacsPath is a not exist') } }