Skip to content

Commit d6ac547

Browse files
joaocgreisrvagg
authored andcommitted
build,win: fix node.exe resource version
When MSBuild invokes rc.exe, it passes NODE_TAG unstringified, but passes it correctly to cl.exe. Hence, this workaround was made to apply only to the resource file. Fixes: #2963 PR-URL: #3053 Reviewed-By: Alexis Campailla <[email protected]> Reviewed-By: Johan Bergström <[email protected]>
1 parent f92aee7 commit d6ac547

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/node_version.h

+9
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,21 @@
1818
# else
1919
# define NODE_TAG "-pre"
2020
# endif
21+
#else
22+
// NODE_TAG is passed without quotes when rc.exe is run from msbuild
23+
# define NODE_EXE_VERSION NODE_STRINGIFY(NODE_MAJOR_VERSION) "." \
24+
NODE_STRINGIFY(NODE_MINOR_VERSION) "." \
25+
NODE_STRINGIFY(NODE_PATCH_VERSION) \
26+
NODE_STRINGIFY(NODE_TAG)
2127
#endif
2228

2329
# define NODE_VERSION_STRING NODE_STRINGIFY(NODE_MAJOR_VERSION) "." \
2430
NODE_STRINGIFY(NODE_MINOR_VERSION) "." \
2531
NODE_STRINGIFY(NODE_PATCH_VERSION) \
2632
NODE_TAG
33+
#ifndef NODE_EXE_VERSION
34+
# define NODE_EXE_VERSION NODE_VERSION_STRING
35+
#endif
2736

2837
#define NODE_VERSION "v" NODE_VERSION_STRING
2938

src/res/node.rc

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ BEGIN
3232
VALUE "CompanyName", "Node.js"
3333
VALUE "ProductName", "Node.js"
3434
VALUE "FileDescription", "Node.js: Server-side JavaScript"
35-
VALUE "FileVersion", "NODE_VERSION_STRING"
36-
VALUE "ProductVersion", "NODE_VERSION_STRING"
35+
VALUE "FileVersion", NODE_EXE_VERSION
36+
VALUE "ProductVersion", NODE_EXE_VERSION
3737
VALUE "OriginalFilename", "node.exe"
3838
VALUE "InternalName", "node"
3939
VALUE "LegalCopyright", "Copyright Node.js contributors. MIT license."

0 commit comments

Comments
 (0)