diff --git a/main.js b/main.js index 6c7bbdf31..c76474c8a 100644 --- a/main.js +++ b/main.js @@ -1,10 +1,14 @@ const path = require('path'); const url = require('url'); const os = require('os'); +const fs = require('fs'); const _ = require('lodash'); +const pify = require('pify'); const electron = require('electron'); +const getRealPath = pify(fs.realpath); + const { app, BrowserWindow, @@ -440,9 +444,9 @@ function showAbout() { // initialization and is ready to create browser windows. // Some APIs can only be used after this event occurs. let ready = false; -app.on('ready', () => { - const userDataPath = app.getPath('userData'); - const installPath = app.getAppPath(); +app.on('ready', async () => { + const userDataPath = await getRealPath(app.getPath('userData')); + const installPath = await getRealPath(app.getAppPath()); if (process.env.NODE_ENV !== 'test' && process.env.NODE_ENV !== 'test-lib') { installFileHandler({