|
28 | 28 | #include <WinError.h>
|
29 | 29 |
|
30 | 30 | #define SKIP_CHECK_VAR "NODE_SKIP_PLATFORM_CHECK"
|
| 31 | +#define SKIP_CHECK_SIZE 1 |
| 32 | +#define SKIP_CHECK_VALUE "1" |
31 | 33 |
|
32 | 34 | int wmain(int argc, wchar_t* wargv[]) {
|
33 | 35 | // Windows Server 2012 (not R2) is supported until 10/10/2023, so we allow it
|
34 | 36 | // to run in the experimental support tier.
|
| 37 | + char buf[SKIP_CHECK_SIZE + 1]; |
35 | 38 | if (!IsWindows8Point1OrGreater() &&
|
36 | 39 | !(IsWindowsServer() && IsWindows8OrGreater()) &&
|
37 |
| - GetEnvironmentVariableA(SKIP_CHECK_VAR, nullptr, 0) == 0) { |
| 40 | + (GetEnvironmentVariableA(SKIP_CHECK_VAR, buf, sizeof(buf)) != |
| 41 | + SKIP_CHECK_SIZE || |
| 42 | + strncmp(buf, SKIP_CHECK_VALUE, SKIP_CHECK_SIZE + 1) != 0)) { |
38 | 43 | fprintf(stderr, "This application is only supported on Windows 8.1, "
|
39 |
| - "Windows Server 2012 R2, or higher.\n" |
40 |
| - "If the environment varaible " SKIP_CHECK_VAR |
41 |
| - " is defined this check is skipped, but Node.js might " |
42 |
| - "not execute correctly."); |
| 44 | + "Windows Server 2012 R2, or\nhigher.\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."); |
43 | 49 | exit(ERROR_EXE_MACHINE_TYPE_MISMATCH);
|
44 | 50 | }
|
45 | 51 |
|
|
0 commit comments