diff --git a/main.js b/main.js index c690b5e..daa1923 100644 --- a/main.js +++ b/main.js @@ -11,6 +11,13 @@ const { startRPC } = require("./server/discordRPC"); let mainWindow; const logsFolderPath = logDir; + +const basePath = config.localMode + ? path.join(__dirname, "config") + : path.join(path.dirname(process.execPath), "resources"); + +const configFolderPath = path.join(basePath, "config.json"); + const defaultDownloadPath = path.join(os.homedir(), "Downloads", "Freedom Loader"); app.setAppUserModelId("com.masteracnolo.freedomloader"); // pour notifications Windows @@ -176,6 +183,9 @@ ipcMain.on("open-website", () => { ipcMain.on("open-wiki", () => { shell.openExternal("https://masteracnolo.github.io/FreedomLoader/pages/wiki.html"); }); +ipcMain.on("open-config", () => { + if (configFolderPath) shell.openPath(configFolderPath); +}); // App ready diff --git a/preload.js b/preload.js index 150ec42..aacdf74 100644 --- a/preload.js +++ b/preload.js @@ -17,5 +17,6 @@ contextBridge.exposeInMainWorld("topbarAPI", { openDevTools: () => ipcRenderer.send("open-devtools"), openLogs: () => ipcRenderer.send("open-logs"), openWebsite: () => ipcRenderer.send("open-website"), - openWiki: () => ipcRenderer.send("open-wiki") + openWiki: () => ipcRenderer.send("open-wiki"), + openConfig: () => ipcRenderer.send("open-config") }); diff --git a/public/index.html b/public/index.html index ebafd10..d517673 100644 --- a/public/index.html +++ b/public/index.html @@ -23,6 +23,7 @@ +