From f372fba1fd346d86d6c6995bd5101d5faeb6a55f Mon Sep 17 00:00:00 2001 From: Alexis Svinartchouk Date: Tue, 5 Nov 2019 14:22:37 +0100 Subject: [PATCH] Don't use electron-is-running-in-asar, fix AppImage builds Change-type: patch --- lib/gui/app/modules/image-writer.js | 23 +---------------------- package.json | 1 - 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/lib/gui/app/modules/image-writer.js b/lib/gui/app/modules/image-writer.js index 7863b133..644a6b88 100644 --- a/lib/gui/app/modules/image-writer.js +++ b/lib/gui/app/modules/image-writer.js @@ -21,7 +21,6 @@ const _ = require('lodash') const path = require('path') const os = require('os') const ipc = require('node-ipc') -const isRunningInAsar = require('electron-is-running-in-asar') const electron = require('electron') const store = require('../models/store') const settings = require('../models/settings') @@ -41,26 +40,6 @@ const selectionState = require('../models/selection-state') */ const THREADS_PER_CPU = 16 -/** - * @summary Get application entry point - * @function - * @private - * - * @returns {String} entry point - * - * @example - * const entryPoint = imageWriter.getApplicationEntryPoint() - */ -const getApplicationEntryPoint = () => { - if (isRunningInAsar()) { - return path.join(process.resourcesPath, 'app.asar') - } - const relativeEntryPoint = _.last(electron.remote.process.argv) - - const PROJECT_ROOT = path.join(__dirname, '..', '..', '..', '..') - return path.resolve(PROJECT_ROOT, relativeEntryPoint) -} - /** * @summary Handle a flash error and log it to analytics * @function @@ -205,7 +184,7 @@ exports.performWrite = (image, drives, onProgress) => { }) const argv = _.attempt(() => { - let entryPoint = getApplicationEntryPoint() + let entryPoint = electron.remote.app.getAppPath() // AppImages run over FUSE, so the files inside the mount point // can only be accessed by the user that mounted the AppImage. diff --git a/package.json b/package.json index 070aff28..ec55f03f 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,6 @@ "color": "^2.0.1", "d3": "^4.13.0", "debug": "^3.1.0", - "electron-is-running-in-asar": "^1.0.0", "electron-updater": "4.0.6", "etcher-sdk": "^2.0.13", "flexboxgrid": "^6.3.0",