From 3e0e263b99e2d35459cb3b1b5d9e27d882850a2b Mon Sep 17 00:00:00 2001 From: Alphrag <34252790+Alphrag@users.noreply.github.com> Date: Sun, 18 Dec 2022 00:58:50 +0100 Subject: Fix issues with executable when using portable on windows (#850) * Fix startup executable for windows portable * Set folder name of unpacking for windows portable exe --- src/stores/AppStore.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/stores/AppStore.ts') diff --git a/src/stores/AppStore.ts b/src/stores/AppStore.ts index 2db90bfa0..02d616241 100644 --- a/src/stores/AppStore.ts +++ b/src/stores/AppStore.ts @@ -21,7 +21,12 @@ import TypedStore from './lib/TypedStore'; import Request from './lib/Request'; import { CHECK_INTERVAL, DEFAULT_APP_SETTINGS } from '../config'; import { cleanseJSObject } from '../jsUtils'; -import { isMac, electronVersion, osRelease } from '../environment'; +import { + isMac, + isWinPortable, + electronVersion, + osRelease, +} from '../environment'; import { ferdiumVersion, userDataPath, @@ -41,7 +46,11 @@ const debug = require('../preload-safe-debug')('Ferdium:AppStore'); const mainWindow = getCurrentWindow(); -const executablePath = isMac ? remoteProcess.execPath : process.execPath; +const executablePath = isMac + ? remoteProcess.execPath + : isWinPortable + ? process.env.PORTABLE_EXECUTABLE_FILE + : process.execPath; const autoLauncher = new AutoLaunch({ name: 'Ferdium', path: executablePath, @@ -279,7 +288,7 @@ export default class AppStore extends TypedStore { if (isMac && !localStorage.getItem(CATALINA_NOTIFICATION_HACK_KEY)) { debug('Triggering macOS Catalina notification permission trigger'); // eslint-disable-next-line no-new - new window.Notification('Welcome to Ferdium 5', { + new window.Notification('Welcome to Ferdium 6', { body: 'Have a wonderful day & happy messaging.', }); -- cgit v1.2.3-70-g09d2