try to fix portable app config issue #645

pull/978/head
Mikael Finstad 5 years ago
parent 384d3ca697
commit 9ac1b1a086
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26

@ -47,7 +47,9 @@ async function getCustomStoragePath() {
const isWindows = os.platform() === 'win32'; const isWindows = os.platform() === 'win32';
if (!isWindows || process.windowsStore) return undefined; if (!isWindows || process.windowsStore) return undefined;
const customStoragePath = app.getAppPath(); // https://github.com/mifi/lossless-cut/issues/645#issuecomment-1001363314
// https://stackoverflow.com/questions/46307797/how-to-get-the-original-path-of-a-portable-electron-app
const customStoragePath = process.env.PORTABLE_EXECUTABLE_DIR || app.getAppPath();
const customConfigPath = join(customStoragePath, 'config.json'); const customConfigPath = join(customStoragePath, 'config.json');
if (await pathExists(customConfigPath)) return customStoragePath; if (await pathExists(customConfigPath)) return customStoragePath;
return undefined; return undefined;

Loading…
Cancel
Save