From 76e709ec63b04d5b0bb8320f4d796e034e9fd806 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Fri, 2 Jul 2021 18:22:20 +0100 Subject: [PATCH 1/2] win,msi: use localized "Authenticated Users" name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Well known user account names are localized on Windows. Look up the "Authenticated Users" user by its security identifier to get the localized name. PR-URL: https://github.com/nodejs/node/pull/39241 Fixes: https://github.com/nodejs/node/issues/39224 Refs: https://github.com/nodejs/node/commit/e817ba70f56c4bfd5d4a68dce8b165142312e7b6 Refs: https://hackerone.com/reports/1211160 Reviewed-By: Michaƫl Zasso Reviewed-By: Beth Griggs --- tools/msvs/msi/custom_actions.cc | 31 +++++++++++++++++++++++++++++++ tools/msvs/msi/custom_actions.def | 1 + tools/msvs/msi/product.wxs | 9 +++++++-- 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/tools/msvs/msi/custom_actions.cc b/tools/msvs/msi/custom_actions.cc index 8a8417ea0b2929..32811dcb19469d 100644 --- a/tools/msvs/msi/custom_actions.cc +++ b/tools/msvs/msi/custom_actions.cc @@ -3,6 +3,8 @@ #include #include #include +#include +#include #define GUID_BUFFER_SIZE 39 // {8-4-4-4-12}\0 @@ -96,6 +98,35 @@ extern "C" UINT WINAPI BroadcastEnvironmentUpdate(MSIHANDLE hInstall) { return WcaFinalize(er); } +#define AUTHENTICATED_USERS_SID L"S-1-5-11" + +extern "C" UINT WINAPI GetLocalizedUserNames(MSIHANDLE hInstall) { + HRESULT hr = S_OK; + UINT er = ERROR_SUCCESS; + TCHAR userName[UNLEN + 1] = {0}; + DWORD userNameSize = UNLEN + 1; + TCHAR domain[DNLEN + 1] = {0}; + DWORD domainSize = DNLEN + 1; + PSID sid; + SID_NAME_USE nameUse; + + hr = WcaInitialize(hInstall, "GetLocalizedUserNames"); + ExitOnFailure(hr, "Failed to initialize"); + + er = ConvertStringSidToSidW(AUTHENTICATED_USERS_SID, &sid); + ExitOnLastError(er, "Failed to convert security identifier"); + + er = LookupAccountSidW(NULL, sid, userName, &userNameSize, domain, &domainSize, &nameUse); + ExitOnLastError(er, "Failed to lookup security identifier"); + + MsiSetProperty(hInstall, L"AUTHENTICATED_USERS", userName); + ExitOnWin32Error(er, hr, "Failed to set localized Authenticated User name"); + +LExit: + er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; + LocalFree(sid); + return WcaFinalize(er); +} extern "C" BOOL WINAPI DllMain(HINSTANCE hInst, ULONG ulReason, VOID* dummy) { switch (ulReason) { diff --git a/tools/msvs/msi/custom_actions.def b/tools/msvs/msi/custom_actions.def index 5f6b25fc423492..93f2a28f45e45e 100644 --- a/tools/msvs/msi/custom_actions.def +++ b/tools/msvs/msi/custom_actions.def @@ -3,3 +3,4 @@ LIBRARY "custom_actions" EXPORTS SetInstallScope BroadcastEnvironmentUpdate +GetLocalizedUserNames diff --git a/tools/msvs/msi/product.wxs b/tools/msvs/msi/product.wxs index 1aaa11d5ac4c55..ed062c3d74729b 100755 --- a/tools/msvs/msi/product.wxs +++ b/tools/msvs/msi/product.wxs @@ -47,8 +47,6 @@ - - @@ -329,6 +327,12 @@ Execute="immediate" Return="check" /> + + @@ -338,6 +342,7 @@ + From 8d1d31178e4e5e44454c03e8a71d129fa0d90e9d Mon Sep 17 00:00:00 2001 From: Beth Griggs Date: Mon, 5 Jul 2021 14:11:14 +0100 Subject: [PATCH 2/2] 2021-07-05, Version 16.4.2 (Current) Notable changes: Node.js 16.4.1 introduced a regression in the Windows installer on non-English locales that is being fixed in this release. There is no need to download this release if you are not using the Windows installer. PR-URL: https://github.com/nodejs/node/pull/39270 --- CHANGELOG.md | 3 ++- doc/changelogs/CHANGELOG_V16.md | 15 +++++++++++++++ src/node_version.h | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75d1601e18f58b..e204dea1cb261b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,7 +32,8 @@ release. -16.4.1
+16.4.2
+16.4.1
16.4.0
16.3.0
16.2.0
diff --git a/doc/changelogs/CHANGELOG_V16.md b/doc/changelogs/CHANGELOG_V16.md index 5b2310b6379bbc..1195cb9e726c9e 100644 --- a/doc/changelogs/CHANGELOG_V16.md +++ b/doc/changelogs/CHANGELOG_V16.md @@ -10,6 +10,7 @@ +16.4.2
16.4.1
16.4.0
16.3.0
@@ -38,6 +39,20 @@ * [io.js](CHANGELOG_IOJS.md) * [Archive](CHANGELOG_ARCHIVE.md) + +## 2021-07-05, Version 16.4.2 (Current), @BethGriggs + +### Notable Changes + +Node.js 16.4.1 introduced a regression in the Windows installer on +non-English locales that is being fixed in this release. There is no +need to download this release if you are not using the Windows +installer. + +### Commits + +* [[`76e709ec63`](https://github.com/nodejs/node/commit/76e709ec63)] - **win,msi**: use localized "Authenticated Users" name (Richard Lau) [#39241](https://github.com/nodejs/node/pull/39241) + ## 2021-07-01, Version 16.4.1 (Current), @BethGriggs diff --git a/src/node_version.h b/src/node_version.h index b4d1d3fea60040..102f9f59e15baa 100644 --- a/src/node_version.h +++ b/src/node_version.h @@ -29,7 +29,7 @@ #define NODE_VERSION_IS_LTS 0 #define NODE_VERSION_LTS_CODENAME "" -#define NODE_VERSION_IS_RELEASE 0 +#define NODE_VERSION_IS_RELEASE 1 #ifndef NODE_STRINGIFY #define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n)