diff --git a/packages/app-builder-lib/src/targets/AppImageTarget.ts b/packages/app-builder-lib/src/targets/AppImageTarget.ts index ecc7e8f4a7b..74d579c17da 100644 --- a/packages/app-builder-lib/src/targets/AppImageTarget.ts +++ b/packages/app-builder-lib/src/targets/AppImageTarget.ts @@ -2,6 +2,7 @@ import { Arch, serializeToYaml } from "builder-util" import { outputFile } from "fs-extra" import { Lazy } from "lazy-val" import * as path from "path" +import * as semver from "semver" import { AppImageOptions } from ".." import { Target } from "../core" import { LinuxPackager } from "../linuxPackager" @@ -19,7 +20,7 @@ export default class AppImageTarget extends Target { constructor(ignored: string, private readonly packager: LinuxPackager, private readonly helper: LinuxTargetHelper, readonly outDir: string) { super("appImage") - this.desktopEntry = new Lazy(() => helper.computeDesktopEntry(this.options, "AppRun %U", { + this.desktopEntry = new Lazy(() => helper.computeDesktopEntry(this.options, "AppRun --no-sandbox %U", { "X-AppImage-Version": `${packager.appInfo.buildVersion}`, })) } diff --git a/packages/app-builder-lib/src/targets/snap.ts b/packages/app-builder-lib/src/targets/snap.ts index 0b6323c1d6c..6c74e0203a6 100644 --- a/packages/app-builder-lib/src/targets/snap.ts +++ b/packages/app-builder-lib/src/targets/snap.ts @@ -32,8 +32,8 @@ export default class SnapTarget extends Target { } private async createDescriptor(arch: Arch): Promise { - if (!this.isElectronVersionGreaterOrEqualThen("4.0.0")) { - if (!this.isElectronVersionGreaterOrEqualThen("2.0.0-beta.1")) { + if (!this.isElectronVersionGreaterOrEqualThan("4.0.0")) { + if (!this.isElectronVersionGreaterOrEqualThan("2.0.0-beta.1")) { throw new InvalidConfigurationError("Electron 2 and higher is required to build Snap") } @@ -194,7 +194,7 @@ export default class SnapTarget extends Target { Icon: "${SNAP}/meta/gui/icon.png" }) - if (this.isElectronVersionGreaterOrEqualThen("5.0.0") && !isBrowserSandboxAllowed(snap)) { + if (this.isElectronVersionGreaterOrEqualThan("5.0.0") && !isBrowserSandboxAllowed(snap)) { args.push("--extraAppArgs=--no-sandbox") if (this.isUseTemplateApp) { args.push("--exclude", "chrome-sandbox") @@ -227,7 +227,7 @@ export default class SnapTarget extends Target { }) } - private isElectronVersionGreaterOrEqualThen(version: string) { + private isElectronVersionGreaterOrEqualThan(version: string) { return semver.gte(this.packager.config.electronVersion || "7.0.0", version) } } diff --git a/test/snapshots/linux/linuxPackagerTest.js.snap b/test/snapshots/linux/linuxPackagerTest.js.snap index fc4687bce18..8f90823e823 100644 --- a/test/snapshots/linux/linuxPackagerTest.js.snap +++ b/test/snapshots/linux/linuxPackagerTest.js.snap @@ -3,7 +3,7 @@ exports[`AppImage - default icon, custom executable and custom desktop 1`] = ` "[Desktop Entry] Name=Test App ßW -Exec=AppRun %U +Exec=AppRun --no-sandbox %U Terminal=true Type=Application Icon=Foo