diff --git a/src/node.cc b/src/node.cc index 649ac43fbe7f80..defdca4aa371fe 100644 --- a/src/node.cc +++ b/src/node.cc @@ -117,6 +117,12 @@ #include #include +#ifdef _WIN32 +#include +#include +#include +#endif + namespace node { using native_module::NativeModuleEnv; @@ -743,6 +749,21 @@ int ProcessGlobalArgs(std::vector* args, env_opts->abort_on_uncaught_exception = true; } +#ifdef _WIN32 + // Display a warning while using an unsupported version of Windows. + // Hide with --no-warnings options. + if (!per_process::cli_options->per_isolate->per_env->no_warnings) { + if (!IsWindows8Point1OrGreater() && + !(IsWindowsServer() && IsWindows8OrGreater())) { + fprintf(stderr, "Node.js is only supported on Windows 8.1, " + "Windows Server 2012 R2, or higher. " + "Node.js will not accept bug reports " + "or patches while using unsupported " + "versions of Windows.\n\n"); + } + } +#endif + // TODO(bnoordhuis) Intercept --prof arguments and start the CPU profiler // manually? That would give us a little more control over its runtime // behavior but it could also interfere with the user's intentions in ways diff --git a/src/node_main.cc b/src/node_main.cc index 00f3f2a4836818..13d8a71191cc60 100644 --- a/src/node_main.cc +++ b/src/node_main.cc @@ -24,19 +24,9 @@ #ifdef _WIN32 #include -#include #include 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. - if (!IsWindows8Point1OrGreater() && - !(IsWindowsServer() && IsWindows8OrGreater())) { - fprintf(stderr, "This application is only supported on Windows 8.1, " - "Windows Server 2012 R2, or higher."); - exit(ERROR_EXE_MACHINE_TYPE_MISMATCH); - } - // Convert argv to UTF8 char** argv = new char*[argc + 1]; for (int i = 0; i < argc; i++) { diff --git a/tools/msvs/msi/product.wxs b/tools/msvs/msi/product.wxs index 8a278637e600a1..dd5cc3ff769be2 100755 --- a/tools/msvs/msi/product.wxs +++ b/tools/msvs/msi/product.wxs @@ -23,8 +23,8 @@ Compressed="yes" InstallScope="perMachine"/> - - = 603) OR (VersionNT >= 602 AND MsiNTProductType <> 1)]]> + + = 601)]]>