Skip to content

Commit d649ac0

Browse files
author
Benjamin Pasero
committed
fix ASAR path again
1 parent 70df226 commit d649ac0

2 files changed

Lines changed: 3 additions & 18 deletions

File tree

src/bootstrap-window.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ exports.assign = function assign(destination, source) {
3636
exports.load = function (modulePaths, resultCallback, options) {
3737
// @ts-ignore
3838
const webFrame = require('electron').webFrame;
39-
const path = require('path');
4039

4140
const args = exports.parseURLQueryArgs();
4241
const configuration = JSON.parse(args['config'] || '{}') || {};
@@ -56,14 +55,7 @@ exports.load = function (modulePaths, resultCallback, options) {
5655
exports.assign(process.env, configuration.userEnv);
5756

5857
// Enable ASAR support
59-
// Note: On windows we have to be careful about the drive letter casing. If
60-
// the drive letter case is lowercase, we convert it to uppercase. DO NOT
61-
// CHANGE THIS logic or otherwise loading will fail in windows.
62-
let nodeModulesPath = path.join(configuration.appRoot, 'node_modules');
63-
if (process.platform === 'win32' && /[a-z]\:/.test(nodeModulesPath)) {
64-
nodeModulesPath = nodeModulesPath.charAt(0).toUpperCase() + nodeModulesPath.substr(1); // Make drive letter uppercase
65-
}
66-
bootstrap.enableASARSupport(nodeModulesPath);
58+
bootstrap.enableASARSupport();
6759

6860
// disable pinch zoom & apply zoom level early to avoid glitches
6961
const zoomLevel = configuration.zoomLevel;

src/bootstrap.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,11 @@ process.on('SIGPIPE', () => {
2121
//#endregion
2222

2323
//#region Add support for using node_modules.asar
24-
/**
25-
* @param {string=} nodeModulesPath
26-
*/
27-
exports.enableASARSupport = function (nodeModulesPath) {
24+
exports.enableASARSupport = function () {
2825
// @ts-ignore
2926
const Module = require('module');
3027
const path = require('path');
31-
let NODE_MODULES_PATH = nodeModulesPath;
32-
if (!NODE_MODULES_PATH) {
33-
NODE_MODULES_PATH = path.join(__dirname, '../node_modules');
34-
}
35-
28+
const NODE_MODULES_PATH = path.join(__dirname, '../node_modules');
3629
const NODE_MODULES_ASAR_PATH = NODE_MODULES_PATH + '.asar';
3730

3831
const originalResolveLookupPaths = Module._resolveLookupPaths;

0 commit comments

Comments
 (0)