Skip to content

Commit

Permalink
build,win: fix node.exe resource version
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
joaocgreis authored and rvagg committed Oct 2, 2015
1 parent f92aee7 commit d6ac547
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/node_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,21 @@
# else
# define NODE_TAG "-pre"
# endif
#else
// NODE_TAG is passed without quotes when rc.exe is run from msbuild
# define NODE_EXE_VERSION NODE_STRINGIFY(NODE_MAJOR_VERSION) "." \
NODE_STRINGIFY(NODE_MINOR_VERSION) "." \
NODE_STRINGIFY(NODE_PATCH_VERSION) \
NODE_STRINGIFY(NODE_TAG)
#endif

# define NODE_VERSION_STRING NODE_STRINGIFY(NODE_MAJOR_VERSION) "." \
NODE_STRINGIFY(NODE_MINOR_VERSION) "." \
NODE_STRINGIFY(NODE_PATCH_VERSION) \
NODE_TAG
#ifndef NODE_EXE_VERSION
# define NODE_EXE_VERSION NODE_VERSION_STRING
#endif

#define NODE_VERSION "v" NODE_VERSION_STRING

Expand Down
4 changes: 2 additions & 2 deletions src/res/node.rc
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ BEGIN
VALUE "CompanyName", "Node.js"
VALUE "ProductName", "Node.js"
VALUE "FileDescription", "Node.js: Server-side JavaScript"
VALUE "FileVersion", "NODE_VERSION_STRING"
VALUE "ProductVersion", "NODE_VERSION_STRING"
VALUE "FileVersion", NODE_EXE_VERSION
VALUE "ProductVersion", NODE_EXE_VERSION
VALUE "OriginalFilename", "node.exe"
VALUE "InternalName", "node"
VALUE "LegalCopyright", "Copyright Node.js contributors. MIT license."
Expand Down

0 comments on commit d6ac547

Please sign in to comment.