aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Alphrag <34252790+Alphrag@users.noreply.github.com>2022-12-18 00:58:50 +0100
committerLibravatar GitHub <noreply@github.com>2022-12-17 23:58:50 +0000
commit3e0e263b99e2d35459cb3b1b5d9e27d882850a2b (patch)
tree7a7d114bb281d4d02bb6258eafd70158b47063c3 /src
parentUpgrade 'pnpm' to '7.18.2' and npm modules (diff)
downloadferdium-app-3e0e263b99e2d35459cb3b1b5d9e27d882850a2b.tar.gz
ferdium-app-3e0e263b99e2d35459cb3b1b5d9e27d882850a2b.tar.zst
ferdium-app-3e0e263b99e2d35459cb3b1b5d9e27d882850a2b.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/@types/ferdium.types.ts1
-rw-r--r--src/environment.ts1
-rw-r--r--src/stores/AppStore.ts15
3 files changed, 14 insertions, 3 deletions
diff --git a/src/@types/ferdium.types.ts b/src/@types/ferdium.types.ts
index db8711cd3..70306f5fb 100644
--- a/src/@types/ferdium.types.ts
+++ b/src/@types/ferdium.types.ts
@@ -8,6 +8,7 @@ declare global {
8 GITHUB_AUTH_TOKEN: string; 8 GITHUB_AUTH_TOKEN: string;
9 NODE_ENV: 'development' | 'production'; 9 NODE_ENV: 'development' | 'production';
10 FERDIUM_APPDATA_DIR?: string; 10 FERDIUM_APPDATA_DIR?: string;
11 PORTABLE_EXECUTABLE_FILE?: string;
11 PORTABLE_EXECUTABLE_DIR?: string; 12 PORTABLE_EXECUTABLE_DIR?: string;
12 ELECTRON_IS_DEV?: string; 13 ELECTRON_IS_DEV?: string;
13 APPDATA?: string; 14 APPDATA?: string;
diff --git a/src/environment.ts b/src/environment.ts
index 5838f1d53..0ba7774cd 100644
--- a/src/environment.ts
+++ b/src/environment.ts
@@ -5,6 +5,7 @@ import { arch, release } from 'os';
5export const isMac = process.platform === 'darwin'; 5export const isMac = process.platform === 'darwin';
6export const isWindows = process.platform === 'win32'; 6export const isWindows = process.platform === 'win32';
7export const isLinux = process.platform === 'linux'; 7export const isLinux = process.platform === 'linux';
8export const isWinPortable = process.env.PORTABLE_EXECUTABLE_FILE != null;
8 9
9export const electronVersion: string = process.versions.electron ?? ''; 10export const electronVersion: string = process.versions.electron ?? '';
10export const chromeVersion: string = process.versions.chrome ?? ''; 11export const chromeVersion: string = process.versions.chrome ?? '';
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';
21import Request from './lib/Request'; 21import Request from './lib/Request';
22import { CHECK_INTERVAL, DEFAULT_APP_SETTINGS } from '../config'; 22import { CHECK_INTERVAL, DEFAULT_APP_SETTINGS } from '../config';
23import { cleanseJSObject } from '../jsUtils'; 23import { cleanseJSObject } from '../jsUtils';
24import { isMac, electronVersion, osRelease } from '../environment'; 24import {
25 isMac,
26 isWinPortable,
27 electronVersion,
28 osRelease,
29} from '../environment';
25import { 30import {
26 ferdiumVersion, 31 ferdiumVersion,
27 userDataPath, 32 userDataPath,
@@ -41,7 +46,11 @@ const debug = require('../preload-safe-debug')('Ferdium:AppStore');
41 46
42const mainWindow = getCurrentWindow(); 47const mainWindow = getCurrentWindow();
43 48
44const executablePath = isMac ? remoteProcess.execPath : process.execPath; 49const executablePath = isMac
50 ? remoteProcess.execPath
51 : isWinPortable
52 ? process.env.PORTABLE_EXECUTABLE_FILE
53 : process.execPath;
45const autoLauncher = new AutoLaunch({ 54const autoLauncher = new AutoLaunch({
46 name: 'Ferdium', 55 name: 'Ferdium',
47 path: executablePath, 56 path: executablePath,
@@ -279,7 +288,7 @@ export default class AppStore extends TypedStore {
279 if (isMac && !localStorage.getItem(CATALINA_NOTIFICATION_HACK_KEY)) { 288 if (isMac && !localStorage.getItem(CATALINA_NOTIFICATION_HACK_KEY)) {
280 debug('Triggering macOS Catalina notification permission trigger'); 289 debug('Triggering macOS Catalina notification permission trigger');
281 // eslint-disable-next-line no-new 290 // eslint-disable-next-line no-new
282 new window.Notification('Welcome to Ferdium 5', { 291 new window.Notification('Welcome to Ferdium 6', {
283 body: 'Have a wonderful day & happy messaging.', 292 body: 'Have a wonderful day & happy messaging.',
284 }); 293 });
285 294