mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
adjusted server lookup path
This commit is contained in:
parent
e221637394
commit
470503eb5c
1 changed files with 6 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
||||||
import { app, BrowserWindow, shell, ipcMain } from "electron";
|
import { app, BrowserWindow, shell, ipcMain } from "electron";
|
||||||
import { release, platform } from "node:os";
|
import { release, platform } from "os";
|
||||||
import { join, dirname } from "node:path";
|
import { join, dirname } from "path";
|
||||||
import { existsSync } from "fs";
|
import { existsSync } from "fs";
|
||||||
import { spawn } from "child_process";
|
import { spawn } from "child_process";
|
||||||
|
|
||||||
|
@ -98,8 +98,10 @@ app.whenReady().then(() => {
|
||||||
var serverPath = "";
|
var serverPath = "";
|
||||||
console.log(process.env)
|
console.log(process.env)
|
||||||
|
|
||||||
// Attempt to use PWD; if undefined, use INIT_CWD and adjust accordingly
|
// Attempt to find Installation Folder
|
||||||
var basePath = path.join(process.env.PWD, '..') || path.join(process.env.INIT_CWD, '..');
|
console.log(app.getAppPath())
|
||||||
|
console.log(join(app.getAppPath(), '..', '..'))
|
||||||
|
var basePath = join(app.getAppPath(), '..', '..') || join(process.env.PWD, '..') || join(process.env.INIT_CWD, '..') || join(process.env.DIST, '..', '..', '..');
|
||||||
|
|
||||||
switch (platform().toLowerCase()) {
|
switch (platform().toLowerCase()) {
|
||||||
//case "darwin":
|
//case "darwin":
|
||||||
|
@ -108,8 +110,6 @@ app.whenReady().then(() => {
|
||||||
// serverPath = join(process.resourcesPath, "modem", "freedata-server");
|
// serverPath = join(process.resourcesPath, "modem", "freedata-server");
|
||||||
// break;
|
// break;
|
||||||
case "win32":
|
case "win32":
|
||||||
|
|
||||||
|
|
||||||
serverPath = join(basePath, "freedata-server", "freedata-server.exe");
|
serverPath = join(basePath, "freedata-server", "freedata-server.exe");
|
||||||
|
|
||||||
case "win64":
|
case "win64":
|
||||||
|
|
Loading…
Reference in a new issue