diff --git a/src/main/constants.ts b/src/main/constants.ts index 6045f40..9eef817 100644 --- a/src/main/constants.ts +++ b/src/main/constants.ts @@ -5,16 +5,21 @@ */ import { app } from "electron"; -import { existsSync, readdirSync, renameSync, rmdirSync } from "fs"; +import { existsSync, mkdirSync, readdirSync, renameSync, rmdirSync } from "fs"; import { dirname, join } from "path"; const vesktopDir = dirname(process.execPath); -export const PORTABLE = process.platform === "win32" && !readdirSync(vesktopDir).includes("Uninstall Vesktop.exe"); + +export const PORTABLE = + process.platform === "win32" && + !readdirSync(vesktopDir).includes("Uninstall Vesktop.exe") && + !process.execPath.endsWith("electron"); const LEGACY_DATA_DIR = join(app.getPath("appData"), "VencordDesktop", "VencordDesktop"); export const DATA_DIR = PORTABLE ? join(vesktopDir, "Data") : process.env.VENCORD_USER_DATA_DIR || join(app.getPath("userData")); +mkdirSync(DATA_DIR, { recursive: true }); // TODO: remove eventually if (existsSync(LEGACY_DATA_DIR)) { diff --git a/src/main/firstLaunch.ts b/src/main/firstLaunch.ts index 68c104c..cf0ec61 100644 --- a/src/main/firstLaunch.ts +++ b/src/main/firstLaunch.ts @@ -37,8 +37,6 @@ export function createFirstLaunchTour() { makeLinksOpenExternally(win); - if (PORTABLE && !existsSync(DATA_DIR)) mkdirSync(DATA_DIR); - win.loadFile(join(VIEW_DIR, "first-launch.html")); win.webContents.addListener("console-message", (_e, _l, msg) => { if (msg === "cancel") return app.exit();