2019-07-16 17:23:04 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Shelley Vohr <shelley.vohr@gmail.com>
|
|
|
|
Date: Thu, 13 Sep 2018 08:56:07 -0700
|
|
|
|
Subject: feat: initialize asar support
|
|
|
|
|
2020-02-24 21:02:04 +00:00
|
|
|
This patch initializes asar support in Node.js.
|
2019-07-16 17:23:04 +00:00
|
|
|
|
2022-11-10 21:31:20 +00:00
|
|
|
diff --git a/lib/internal/process/pre_execution.js b/lib/internal/process/pre_execution.js
|
2023-09-20 20:13:43 +00:00
|
|
|
index b4a24bbffb6c43638d13063e85b6cfba5c0cc9c7..fcbd9ee1af002bc176937e6bb5af55791b2f64b2 100644
|
2022-11-10 21:31:20 +00:00
|
|
|
--- a/lib/internal/process/pre_execution.js
|
|
|
|
+++ b/lib/internal/process/pre_execution.js
|
2023-09-20 20:13:43 +00:00
|
|
|
@@ -52,6 +52,8 @@ function prepareWorkerThreadExecution() {
|
2023-08-17 14:42:53 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+let processLinkedBinding = process._linkedBinding;
|
|
|
|
function prepareExecution(options) {
|
|
|
|
const { expandArgv1, initializeModules, isMainThread } = options;
|
|
|
|
|
2023-09-20 20:13:43 +00:00
|
|
|
@@ -130,12 +132,17 @@ function setupUserModules() {
|
2019-07-16 17:23:04 +00:00
|
|
|
loadPreloadModules();
|
2023-01-11 10:33:48 +00:00
|
|
|
// Need to be done after --require setup.
|
2019-10-14 22:46:10 +00:00
|
|
|
initializeFrozenIntrinsics();
|
2019-07-16 17:23:04 +00:00
|
|
|
+ setupAsarSupport();
|
|
|
|
}
|
|
|
|
|
2022-08-29 13:55:36 +00:00
|
|
|
function refreshRuntimeOptions() {
|
2022-11-10 21:31:20 +00:00
|
|
|
refreshOptions();
|
2019-07-16 17:23:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+function setupAsarSupport() {
|
2023-08-17 14:42:53 +00:00
|
|
|
+ processLinkedBinding('electron_common_asar').initAsarSupport(require);
|
2019-07-16 17:23:04 +00:00
|
|
|
+}
|
|
|
|
+
|
2022-11-10 21:31:20 +00:00
|
|
|
function patchProcessObject(expandArgv1) {
|
|
|
|
const binding = internalBinding('process_methods');
|
|
|
|
binding.patchProcessObject(process);
|