Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoão Reis <reis@janeasystems.com>2020-04-30 22:19:52 +0300
committerRuben Bridgewater <ruben@bridgewater.de>2020-05-30 04:54:27 +0300
commit2c0a4fab11f8aa866056a857a42b55a1882391b6 (patch)
tree450e7e357546c16d2aaae93bce31ada889bf1a75 /src/node_main.cc
parentde35c030b5a1b86ad06bdd3e5cc4608fa67f4893 (diff)
win: allow skipping the supported platform check
Fixes: https://github.com/nodejs/node/issues/33034 PR-URL: https://github.com/nodejs/node/pull/33176 Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'src/node_main.cc')
-rw-r--r--src/node_main.cc18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/node_main.cc b/src/node_main.cc
index 00f3f2a4836..9f4ea22d12c 100644
--- a/src/node_main.cc
+++ b/src/node_main.cc
@@ -27,13 +27,25 @@
#include <VersionHelpers.h>
#include <WinError.h>
+#define SKIP_CHECK_VAR "NODE_SKIP_PLATFORM_CHECK"
+#define SKIP_CHECK_SIZE 1
+#define SKIP_CHECK_VALUE "1"
+
int wmain(int argc, wchar_t* wargv[]) {
// Windows Server 2012 (not R2) is supported until 10/10/2023, so we allow it
// to run in the experimental support tier.
+ char buf[SKIP_CHECK_SIZE + 1];
if (!IsWindows8Point1OrGreater() &&
- !(IsWindowsServer() && IsWindows8OrGreater())) {
- fprintf(stderr, "This application is only supported on Windows 8.1, "
- "Windows Server 2012 R2, or higher.");
+ !(IsWindowsServer() && IsWindows8OrGreater()) &&
+ (GetEnvironmentVariableA(SKIP_CHECK_VAR, buf, sizeof(buf)) !=
+ SKIP_CHECK_SIZE ||
+ strncmp(buf, SKIP_CHECK_VALUE, SKIP_CHECK_SIZE + 1) != 0)) {
+ fprintf(stderr, "Node.js is only supported on Windows 8.1, Windows "
+ "Server 2012 R2, or higher.\n"
+ "Setting the " SKIP_CHECK_VAR " environment variable "
+ "to 1 skips this\ncheck, but Node.js might not execute "
+ "correctly. Any issues encountered on\nunsupported "
+ "platforms will not be fixed.");
exit(ERROR_EXE_MACHINE_TYPE_MISMATCH);
}