win: prevent node from running on Windows Vista or earlier

Ref: https://github.com/nodejs/node/issues/3804

PR-URL: https://github.com/nodejs/node/pull/5167
Reviewed-By: rvagg - Rod Vagg <rod@vagg.org>
Reviewed-By: joaocgreis - João Reis <reis@janeasystems.com>
This commit is contained in:
Alexis Campailla 2016-02-10 16:34:56 +01:00
parent 55db19074d
commit 1cf26c036d

View File

@ -1,7 +1,15 @@
#include "node.h"
#ifdef _WIN32
#include <VersionHelpers.h>
int wmain(int argc, wchar_t *wargv[]) {
if (!IsWindows7OrGreater()) {
fprintf(stderr, "This application is only supported on Windows 7, "
"Windows Server 2008 R2, or higher.");
exit(1);
}
// Convert argv to to UTF8
char** argv = new char*[argc];
for (int i = 0; i < argc; i++) {