From 111226e81041d8f753c2ee925f7fbc1f43e17ffa Mon Sep 17 00:00:00 2001 From: Samuel J Voeller Date: Mon, 27 Apr 2020 14:13:17 -0500 Subject: [PATCH 1/9] src,win,msi: changed exit on unsupported version to extended warning of limited support --- src/node_main.cc | 8 ++++---- tools/msvs/msi/product.wxs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/node_main.cc b/src/node_main.cc index 00f3f2a4836818..0c7faee65c3cdb 100644 --- a/src/node_main.cc +++ b/src/node_main.cc @@ -28,13 +28,13 @@ #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. + // Display deprecation banner without exiting application for unsupported versions. 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); + "Windows Server 2012 R2, or higher. Node.js will not" + "accept bug reports or patches while using unsupported" + "versions of Windows."); } // Convert argv to UTF8 diff --git a/tools/msvs/msi/product.wxs b/tools/msvs/msi/product.wxs index 8a278637e600a1..f008ea7f9adff7 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)]]> From 22e91a04d77b6d166753ac817054d49057d263f3 Mon Sep 17 00:00:00 2001 From: Samuel J Voeller Date: Mon, 27 Apr 2020 16:35:03 -0500 Subject: [PATCH 2/9] src: fix spacing for deprecation banner --- src/node_main.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/node_main.cc b/src/node_main.cc index 0c7faee65c3cdb..474768df4c2faf 100644 --- a/src/node_main.cc +++ b/src/node_main.cc @@ -32,9 +32,9 @@ int wmain(int argc, wchar_t* wargv[]) { if (!IsWindows8Point1OrGreater() && !(IsWindowsServer() && IsWindows8OrGreater())) { fprintf(stderr, "This application 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."); + "Windows Server 2012 R2, or higher. Node.js will not " + "accept bug reports or patches while using unsupported " + "versions of Windows.\n\n\n"); } // Convert argv to UTF8 From 7869c2fa1cdf68f7dae3322e9af84e43c752a593 Mon Sep 17 00:00:00 2001 From: Samuel J Voeller Date: Mon, 27 Apr 2020 17:15:23 -0500 Subject: [PATCH 3/9] fix: multiline comment for C++ linter --- src/node_main.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node_main.cc b/src/node_main.cc index 474768df4c2faf..8b472a1ec1adeb 100644 --- a/src/node_main.cc +++ b/src/node_main.cc @@ -28,7 +28,8 @@ #include int wmain(int argc, wchar_t* wargv[]) { - // Display deprecation banner without exiting application for unsupported versions. + // Display deprecation banner without exiting + // the application for unsupported versions of Windows. if (!IsWindows8Point1OrGreater() && !(IsWindowsServer() && IsWindows8OrGreater())) { fprintf(stderr, "This application is only supported on Windows 8.1, " From 6ee8998b3b4ba80eb592a836b2323658fb309d25 Mon Sep 17 00:00:00 2001 From: Samuel J Voeller Date: Mon, 27 Apr 2020 17:45:28 -0500 Subject: [PATCH 4/9] msi: adjust message for official support --- tools/msvs/msi/product.wxs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/msvs/msi/product.wxs b/tools/msvs/msi/product.wxs index f008ea7f9adff7..2431f6887691b5 100755 --- a/tools/msvs/msi/product.wxs +++ b/tools/msvs/msi/product.wxs @@ -23,7 +23,7 @@ Compressed="yes" InstallScope="perMachine"/> - + = 601)]]> From 55bcf517e1bbdaa517cf5aa87bc6dbb1fa869682 Mon Sep 17 00:00:00 2001 From: Samuel J Voeller Date: Mon, 27 Apr 2020 23:44:44 -0500 Subject: [PATCH 5/9] src,win: relocate unsupported os warning to node.cc to allow --no-warnings flag --- src/node.cc | 23 +++++++++++++++++++++++ src/node_main.cc | 11 ----------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/node.cc b/src/node.cc index 649ac43fbe7f80..06e6e9d2a477e2 100644 --- a/src/node.cc +++ b/src/node.cc @@ -117,6 +117,14 @@ #include #include +// =========== windows headers ============ + +#ifdef _WIN32 +#include +#include +#include +#endif + namespace node { using native_module::NativeModuleEnv; @@ -742,6 +750,21 @@ int ProcessGlobalArgs(std::vector* args, "--abort_on_uncaught_exception") != v8_args.end()) { env_opts->abort_on_uncaught_exception = true; } + +#ifdef _WIN32 + // Displace warning while using 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 diff --git a/src/node_main.cc b/src/node_main.cc index 8b472a1ec1adeb..13d8a71191cc60 100644 --- a/src/node_main.cc +++ b/src/node_main.cc @@ -24,20 +24,9 @@ #ifdef _WIN32 #include -#include #include int wmain(int argc, wchar_t* wargv[]) { - // Display deprecation banner without exiting - // the application for unsupported versions of Windows. - if (!IsWindows8Point1OrGreater() && - !(IsWindowsServer() && IsWindows8OrGreater())) { - fprintf(stderr, "This application 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\n"); - } - // Convert argv to UTF8 char** argv = new char*[argc + 1]; for (int i = 0; i < argc; i++) { From f6c4c8b708951ada78966629d707007b0e3cce58 Mon Sep 17 00:00:00 2001 From: Samuel J Voeller Date: Mon, 27 Apr 2020 23:50:55 -0500 Subject: [PATCH 6/9] fix: remove the two whitespace linting error... --- src/node.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node.cc b/src/node.cc index 06e6e9d2a477e2..2957972dc70ca9 100644 --- a/src/node.cc +++ b/src/node.cc @@ -750,7 +750,7 @@ int ProcessGlobalArgs(std::vector* args, "--abort_on_uncaught_exception") != v8_args.end()) { env_opts->abort_on_uncaught_exception = true; } - + #ifdef _WIN32 // Displace warning while using unsupported version of Windows. // Hide with --no-warnings options. From a01b275fbb888917252065be321ebca2c0ac7520 Mon Sep 17 00:00:00 2001 From: Samuel Voeller Date: Tue, 28 Apr 2020 13:32:28 -0500 Subject: [PATCH 7/9] comment: remove unnecessary comment for windows Co-Authored-By: James M Snell --- src/node.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/node.cc b/src/node.cc index 2957972dc70ca9..cc03b7fa88f081 100644 --- a/src/node.cc +++ b/src/node.cc @@ -117,8 +117,6 @@ #include #include -// =========== windows headers ============ - #ifdef _WIN32 #include #include From 63e62c887254a2ddf23628ffba30a96a97ecf6ad Mon Sep 17 00:00:00 2001 From: Samuel Voeller Date: Tue, 28 Apr 2020 13:32:53 -0500 Subject: [PATCH 8/9] comment: corrected grammar mistake Co-Authored-By: Bartosz Sosnowski --- src/node.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node.cc b/src/node.cc index cc03b7fa88f081..defdca4aa371fe 100644 --- a/src/node.cc +++ b/src/node.cc @@ -750,7 +750,7 @@ int ProcessGlobalArgs(std::vector* args, } #ifdef _WIN32 - // Displace warning while using unsupported version of Windows. + // 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() && From 329279fc840c2ed80b7fdfa056bf45988364db27 Mon Sep 17 00:00:00 2001 From: Samuel Voeller Date: Wed, 29 Apr 2020 16:07:08 -0500 Subject: [PATCH 9/9] Update tools/msvs/msi/product.wxs msi: grammar correction Co-Authored-By: Rich Trott --- tools/msvs/msi/product.wxs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/msvs/msi/product.wxs b/tools/msvs/msi/product.wxs index 2431f6887691b5..dd5cc3ff769be2 100755 --- a/tools/msvs/msi/product.wxs +++ b/tools/msvs/msi/product.wxs @@ -23,7 +23,7 @@ Compressed="yes" InstallScope="perMachine"/> - + = 601)]]>