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-08-17 14:42:53 +00:00
|
|
|
index 250a43c5455b4f9ff72dd3a34d5b0aa270f43cc6..4e7a9e7a7585fea2013ff70161672568477172b1 100644
|
2022-11-10 21:31:20 +00:00
|
|
|
--- a/lib/internal/process/pre_execution.js
|
|
|
|
+++ b/lib/internal/process/pre_execution.js
|
2023-08-17 14:42:53 +00:00
|
|
|
@@ -49,6 +49,8 @@ function prepareWorkerThreadExecution() {
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+let processLinkedBinding = process._linkedBinding;
|
|
|
|
function prepareExecution(options) {
|
|
|
|
const { expandArgv1, initializeModules, isMainThread } = options;
|
|
|
|
|
|
|
|
@@ -117,12 +119,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);
|