diff options
author | Amine Mouafik <amine@mouafik.fr> | 2019-10-20 17:50:08 +0700 |
---|---|---|
committer | Amine Mouafik <amine@mouafik.fr> | 2019-10-20 17:50:08 +0700 |
commit | a2d7d1e368a822422a1c88b0d8a514a1cf0dab41 (patch) | |
tree | cc289228f45941bc91c120b369baef98d364a0d3 /src/index.js | |
parent | #105 FiLimit AppVor artifacts collection to tags/master (diff) | |
download | ferdium-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.js | 9 |
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'; | |||
9 | import path from 'path'; | 9 | import path from 'path'; |
10 | import windowStateKeeper from 'electron-window-state'; | 10 | import windowStateKeeper from 'electron-window-state'; |
11 | 11 | ||
12 | // Set app directory before loading user modules | 12 | if (process.platform == "win32") { |
13 | if (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 | |||
18 | if (isDevMode) { | 17 | if (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 | } |