From 0da6df03cb69ba8eb7fab806b8b71489c91adc06 Mon Sep 17 00:00:00 2001 From: MasterAcnolo Date: Wed, 28 Oct 2026 21:42:52 +0100 Subject: [PATCH] feat(path): enhance path resolution for resources and user themes based on app context --- server/helpers/path.helpers.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/server/helpers/path.helpers.js b/server/helpers/path.helpers.js index 18ee318..95f47de 100644 --- a/server/helpers/path.helpers.js +++ b/server/helpers/path.helpers.js @@ -16,10 +16,12 @@ const ext = isWindows ? '.exe' : '' /** Centralized resource paths */ const resourcesPath = config.devMode ? path.join(__dirname, "../../resources") - : process.resourcesPath; + : (process.resourcesPath || path.join(__dirname, "../../resources")); /** Default download folder (centralized) */ -const defaultDownloadFolder = path.join(app.getPath("downloads"), "Freedom Loader"); +const defaultDownloadFolder = app && typeof app.getPath === "function" + ? path.join(app.getPath("downloads"), "Freedom Loader") + : path.join(process.env.HOME || process.cwd(), "Downloads", "Freedom Loader"); /** * Current platform: @@ -149,7 +151,9 @@ const binaryPaths = { * - default themes come from app resources * - user themes are persisted in userData to survive updates */ -const userThemesPath = path.join(app.getPath("userData"), "themes"); +const userThemesPath = app && typeof app.getPath === "function" + ? path.join(app.getPath("userData"), "themes") + : path.join(process.env.HOME || process.cwd(), ".config", "Freedom Loader", "themes"); const defaultThemesSourcePath = path.join("theme"); /**