refactor: update dev orthanc directory

This commit is contained in:
mozzie 2024-09-10 17:10:31 +08:00
parent f436a65409
commit a4a1198402
2 changed files with 25 additions and 22 deletions

View File

@ -14,10 +14,9 @@ import { getMachineId } from "./core/auth";
import registerIpcMainHandlers from "./ipcMainHandlers";
import { spawn } from "node:child_process";
import { ChildProcessWithoutNullStreams } from "child_process";
import log from 'electron-log';
import log from "electron-log";
import { existsSync } from "node:fs";
// const require = createRequire(import.meta.url);
const __dirname = path.dirname(fileURLToPath(import.meta.url));
@ -68,8 +67,6 @@ function createWindow() {
});
});
if (VITE_DEV_SERVER_URL) {
win.loadURL(VITE_DEV_SERVER_URL);
registerIpcMainHandlers(win);
@ -77,16 +74,20 @@ function createWindow() {
const pacsPath =
platform !== "macos"
? path.join(
process.env.VITE_PUBLIC!,
"../extraResources",
"orthanc-win64-1.12.4",
"Orthanc.exe"
)
: path.join(process.env.VITE_PUBLIC!, '../extraResources', "orthanc-mac-24.8.1", "Orthanc");
process.env.APP_ROOT!,
"extraResources",
"orthanc-win64-1.12.4",
"Orthanc.exe"
)
: path.join(
process.env.APP_ROOT!,
"extraResources",
"orthanc-mac-24.8.1",
"Orthanc"
);
spawn(pacsPath);
if (platform !== "macos") {
python_process = spawn(path.join(process.env.VITE_PUBLIC!, "main.exe"));
}
@ -95,22 +96,24 @@ function createWindow() {
// python_process = spawn(path.join(process.env.VITE_PUBLIC!, "main.exe"));
// }
const pacsPath =
platform !== "macos"
? path.join(
process.resourcesPath, 'lib',
"orthanc-win64-1.12.4",
"Orthanc.exe"
)
: path.join(process.resourcesPath, 'lib', "orthanc-mac-24.8.1", "Orthanc");
process.resourcesPath,
"lib",
"orthanc-win64-1.12.4",
"Orthanc.exe"
)
: path.join(
process.resourcesPath,
"lib",
"orthanc-mac-24.8.1",
"Orthanc"
);
console.log(pacsPath)
console.log(pacsPath);
log.info(pacsPath);
if (existsSync(pacsPath))
spawn(pacsPath);
if (existsSync(pacsPath)) spawn(pacsPath);
win.loadFile(path.join(RENDERER_DIST, "index.html")).then(() => {
if (process.argv.length >= 2) {

0
apps/desktop/extraResources/orthanc-mac-24.8.1/Orthanc Normal file → Executable file
View File