mirror of
https://github.com/Microsoft/vscode
synced 2024-08-25 03:56:03 +00:00
Fixes #126533: Make sure the ASAR path is always added for renderer processes
This commit is contained in:
parent
ed237e1138
commit
1dab1072ff
2
src/bootstrap-fork.js
vendored
2
src/bootstrap-fork.js
vendored
|
@ -16,7 +16,7 @@ const bootstrapNode = require('./bootstrap-node');
|
|||
bootstrapNode.removeGlobalNodeModuleLookupPaths();
|
||||
|
||||
// Enable ASAR in our forked processes
|
||||
bootstrap.enableASARSupport(undefined);
|
||||
bootstrap.enableASARSupport(undefined, false);
|
||||
|
||||
if (process.env['VSCODE_INJECT_NODE_MODULE_LOOKUP_PATH']) {
|
||||
bootstrapNode.injectNodeModuleLookupPath(process.env['VSCODE_INJECT_NODE_MODULE_LOOKUP_PATH']);
|
||||
|
|
2
src/bootstrap-window.js
vendored
2
src/bootstrap-window.js
vendored
|
@ -82,7 +82,7 @@
|
|||
}
|
||||
|
||||
// Enable ASAR support
|
||||
globalThis.MonacoBootstrap.enableASARSupport(configuration.appRoot);
|
||||
globalThis.MonacoBootstrap.enableASARSupport(configuration.appRoot, true);
|
||||
|
||||
// Get the nls configuration into the process.env as early as possible
|
||||
const nlsConfig = globalThis.MonacoBootstrap.setupNLS();
|
||||
|
|
8
src/bootstrap.js
vendored
8
src/bootstrap.js
vendored
|
@ -43,8 +43,9 @@
|
|||
|
||||
/**
|
||||
* @param {string | undefined} appRoot
|
||||
* @param {boolean} alwaysAddASARPath
|
||||
*/
|
||||
function enableASARSupport(appRoot) {
|
||||
function enableASARSupport(appRoot, alwaysAddASARPath) {
|
||||
if (!path || !Module || typeof process === 'undefined') {
|
||||
console.warn('enableASARSupport() is only available in node.js environments'); // TODO@sandbox ASAR is currently non-sandboxed only
|
||||
return;
|
||||
|
@ -69,12 +70,17 @@
|
|||
Module._resolveLookupPaths = function (request, parent) {
|
||||
const paths = originalResolveLookupPaths(request, parent);
|
||||
if (Array.isArray(paths)) {
|
||||
let asarPathAdded = false;
|
||||
for (let i = 0, len = paths.length; i < len; i++) {
|
||||
if (paths[i] === NODE_MODULES_PATH) {
|
||||
asarPathAdded = true;
|
||||
paths.splice(i, 0, NODE_MODULES_ASAR_PATH);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (alwaysAddASARPath && !asarPathAdded) {
|
||||
paths.push(NODE_MODULES_ASAR_PATH);
|
||||
}
|
||||
}
|
||||
|
||||
return paths;
|
||||
|
|
|
@ -17,7 +17,7 @@ bootstrap.avoidMonkeyPatchFromAppInsights();
|
|||
bootstrapNode.configurePortable(product);
|
||||
|
||||
// Enable ASAR support
|
||||
bootstrap.enableASARSupport(undefined);
|
||||
bootstrap.enableASARSupport(undefined, false);
|
||||
|
||||
// Signal processes that we got launched as CLI
|
||||
process.env['VSCODE_CLI'] = '1';
|
||||
|
|
|
@ -33,7 +33,7 @@ app.allowRendererProcessReuse = false;
|
|||
const portable = bootstrapNode.configurePortable(product);
|
||||
|
||||
// Enable ASAR support
|
||||
bootstrap.enableASARSupport(undefined);
|
||||
bootstrap.enableASARSupport(undefined, false);
|
||||
|
||||
// Set userData path before app 'ready' event
|
||||
const args = parseCLIArgs();
|
||||
|
|
Loading…
Reference in a new issue