From b20ac2d4a6f4acab3a17bbe10e0ef74bb7e8d300 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sun, 12 Jan 2025 11:57:35 -0800 Subject: [PATCH] fix: app path --- src/utils/index.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/utils/index.ts b/src/utils/index.ts index 43374cf..6eaa3ea 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -30,8 +30,12 @@ export const logEmitter = new EventEmitter(); //////////////////////////////////////////////// export function getAppPath(): string { - let appDir = app.getAppPath(); - return appDir; + let appPath = app.getAppPath(); + if (app.isPackaged) { + appPath = path.dirname(appPath); + } + + return appPath; } export function getUserHomePath(): string { @@ -231,6 +235,9 @@ export async function installBundledPython(installationPath?: string) { const pythonTarPath = getBundledPythonTarPath(); console.log(installationPath, pythonTarPath); + logEmitter.emit('log', `Installing bundled Python to: ${installationPath}`); // Emit log + logEmitter.emit('log', `Python tarball path: ${pythonTarPath}`); // Emit log + if (!fs.existsSync(pythonTarPath)) { log.error('Python tarball not found'); logEmitter.emit('log', 'Python tarball not found'); // Emit log