Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ npm-debug.log.*
/extensions/test
/src/shared/version.ts
Data
ApplicationData

# Jest related files
/.coveralls.yml
Expand Down
11 changes: 11 additions & 0 deletions src/main/Main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import * as WebSocket from 'ws';
import * as Util from './Util';
import { Init } from './types';

const APPLICATION_DATA = path.join(Util.getMainFolderPath(), 'ApplicationData');
const TIMEOUT_DELAY = 60_000;

const ALLOWED_HOSTS = [
Expand Down Expand Up @@ -94,6 +95,16 @@ export function main(init: Init): void {
// -- Functions --

async function startup(opts: LaunchOptions) {
// Portable mode - Switch behavior only if the directory doesn't exist at the default location,
// which is only on fresh installs or if the user manually added an ApplicationData folder
if (!fs.existsSync(path.join(app.getPath('appData'), app.getName())) || fs.existsSync(APPLICATION_DATA)) {
if (process.platform === 'win32' || process.platform === 'linux') {
app.setPath('userData', APPLICATION_DATA);
app.setPath('crashDumps', path.join(APPLICATION_DATA, 'Crash Dumps'));
app.setAppLogsPath(path.join(APPLICATION_DATA, 'Logs'));
}
}

app.disableHardwareAcceleration();

// Single process
Expand Down