aboutsummaryrefslogtreecommitdiffstats
path: root/src/index.js
diff options
context:
space:
mode:
authorLibravatar Amine Mouafik <amine@mouafik.fr>2019-10-20 17:50:08 +0700
committerLibravatar Amine Mouafik <amine@mouafik.fr>2019-10-20 17:50:08 +0700
commita2d7d1e368a822422a1c88b0d8a514a1cf0dab41 (patch)
treecc289228f45941bc91c120b369baef98d364a0d3 /src/index.js
parent#105 FiLimit AppVor artifacts collection to tags/master (diff)
downloadferdium-app-a2d7d1e368a822422a1c88b0d8a514a1cf0dab41.tar.gz
ferdium-app-a2d7d1e368a822422a1c88b0d8a514a1cf0dab41.tar.zst
ferdium-app-a2d7d1e368a822422a1c88b0d8a514a1cf0dab41.zip
#87 Try using LOCALAPPDATA for win32 portable version
Diffstat (limited to 'src/index.js')
-rw-r--r--src/index.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/index.js b/src/index.js
index 4d7215d5e..d13ab35a0 100644
--- a/src/index.js
+++ b/src/index.js
@@ -9,12 +9,11 @@ import fs from 'fs-extra';
9import path from 'path'; 9import path from 'path';
10import windowStateKeeper from 'electron-window-state'; 10import windowStateKeeper from 'electron-window-state';
11 11
12// Set app directory before loading user modules 12if (process.platform == "win32") {
13if (process.env.FERDI_APPDATA_DIR || process.env.PORTABLE_EXECUTABLE_DIR) { 13 app.setPath("appData", process.env.LOCALAPPDATA);
14 const appDataPath = process.env.FERDI_APPDATA_DIR || process.env.PORTABLE_EXECUTABLE_DIR; 14 app.setPath("userData", path.join(process.env.LOCALAPPDATA, app.getName()));
15 app.setPath('appData', appDataPath);
16 app.setPath('userData', path.join(app.getPath('appData'), app.getName()));
17} 15}
16
18if (isDevMode) { 17if (isDevMode) {
19 app.setPath('userData', path.join(app.getPath('appData'), `${app.getName()}Dev`)); 18 app.setPath('userData', path.join(app.getPath('appData'), `${app.getName()}Dev`));
20} 19}