diff options
author | Alphrag <34252790+Alphrag@users.noreply.github.com> | 2022-12-18 00:58:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-17 23:58:50 +0000 |
commit | 3e0e263b99e2d35459cb3b1b5d9e27d882850a2b (patch) | |
tree | 7a7d114bb281d4d02bb6258eafd70158b47063c3 /src | |
parent | Upgrade 'pnpm' to '7.18.2' and npm modules (diff) | |
download | ferdium-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.ts | 1 | ||||
-rw-r--r-- | src/environment.ts | 1 | ||||
-rw-r--r-- | src/stores/AppStore.ts | 15 |
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'; | |||
5 | export const isMac = process.platform === 'darwin'; | 5 | export const isMac = process.platform === 'darwin'; |
6 | export const isWindows = process.platform === 'win32'; | 6 | export const isWindows = process.platform === 'win32'; |
7 | export const isLinux = process.platform === 'linux'; | 7 | export const isLinux = process.platform === 'linux'; |
8 | export const isWinPortable = process.env.PORTABLE_EXECUTABLE_FILE != null; | ||
8 | 9 | ||
9 | export const electronVersion: string = process.versions.electron ?? ''; | 10 | export const electronVersion: string = process.versions.electron ?? ''; |
10 | export const chromeVersion: string = process.versions.chrome ?? ''; | 11 | export 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'; | |||
21 | import Request from './lib/Request'; | 21 | import Request from './lib/Request'; |
22 | import { CHECK_INTERVAL, DEFAULT_APP_SETTINGS } from '../config'; | 22 | import { CHECK_INTERVAL, DEFAULT_APP_SETTINGS } from '../config'; |
23 | import { cleanseJSObject } from '../jsUtils'; | 23 | import { cleanseJSObject } from '../jsUtils'; |
24 | import { isMac, electronVersion, osRelease } from '../environment'; | 24 | import { |
25 | isMac, | ||
26 | isWinPortable, | ||
27 | electronVersion, | ||
28 | osRelease, | ||
29 | } from '../environment'; | ||
25 | import { | 30 | import { |
26 | ferdiumVersion, | 31 | ferdiumVersion, |
27 | userDataPath, | 32 | userDataPath, |
@@ -41,7 +46,11 @@ const debug = require('../preload-safe-debug')('Ferdium:AppStore'); | |||
41 | 46 | ||
42 | const mainWindow = getCurrentWindow(); | 47 | const mainWindow = getCurrentWindow(); |
43 | 48 | ||
44 | const executablePath = isMac ? remoteProcess.execPath : process.execPath; | 49 | const executablePath = isMac |
50 | ? remoteProcess.execPath | ||
51 | : isWinPortable | ||
52 | ? process.env.PORTABLE_EXECUTABLE_FILE | ||
53 | : process.execPath; | ||
45 | const autoLauncher = new AutoLaunch({ | 54 | const 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 | ||