diff --git a/electron/main.js b/electron/main.js index 2648641c..430716c9 100644 --- a/electron/main.js +++ b/electron/main.js @@ -15,6 +15,14 @@ const updater = require('./updater'); const fs = require("fs"); const path = require('path'); +// If 'data' folder exists in Hamsket's folder, set userdata, logs, and usercache path to there +var basepath = app.getAppPath(); +if (fs.existsSync(path.join(basepath, 'data'))) { + app.setPath('userData', path.join(basepath, 'data', 'data')); + app.setPath('logs', path.join(basepath, 'data', 'logs')); + app.setPath('userCache', path.join(basepath, 'data', 'cache')); +} + // Initial Config const config = new Config({ defaults: {