|
27 | 27 | #include <VersionHelpers.h> |
28 | 28 | #include <WinError.h> |
29 | 29 |
|
| 30 | +#define SKIP_CHECK_VAR "NODE_SKIP_PLATFORM_CHECK" |
| 31 | +#define SKIP_CHECK_SIZE 1 |
| 32 | +#define SKIP_CHECK_VALUE "1" |
| 33 | + |
30 | 34 | int wmain(int argc, wchar_t* wargv[]) { |
31 | 35 | // Windows Server 2012 (not R2) is supported until 10/10/2023, so we allow it |
32 | 36 | // to run in the experimental support tier. |
| 37 | + char buf[SKIP_CHECK_SIZE + 1]; |
33 | 38 | if (!IsWindows8Point1OrGreater() && |
34 | | - !(IsWindowsServer() && IsWindows8OrGreater())) { |
35 | | - fprintf(stderr, "This application is only supported on Windows 8.1, " |
36 | | - "Windows Server 2012 R2, or higher."); |
| 39 | + !(IsWindowsServer() && IsWindows8OrGreater()) && |
| 40 | + (GetEnvironmentVariableA(SKIP_CHECK_VAR, buf, sizeof(buf)) != |
| 41 | + SKIP_CHECK_SIZE || |
| 42 | + strncmp(buf, SKIP_CHECK_VALUE, SKIP_CHECK_SIZE + 1) != 0)) { |
| 43 | + fprintf(stderr, "Node.js is only supported on Windows 8.1, Windows " |
| 44 | + "Server 2012 R2, or higher.\n" |
| 45 | + "Setting the " SKIP_CHECK_VAR " environment variable " |
| 46 | + "to 1 skips this\ncheck, but Node.js might not execute " |
| 47 | + "correctly. Any issues encountered on\nunsupported " |
| 48 | + "platforms will not be fixed."); |
37 | 49 | exit(ERROR_EXE_MACHINE_TYPE_MISMATCH); |
38 | 50 | } |
39 | 51 |
|
|
0 commit comments