Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v16.4.2 proposal #39270

Merged
merged 2 commits into from
Jul 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ release.
</tr>
<tr>
<td valign="top">
<b><a href="doc/changelogs/CHANGELOG_V16.md#16.4.1">16.4.1</a></b><br/>
<b><a href="doc/changelogs/CHANGELOG_V16.md#16.4.2">16.4.2</a></b><br/>
<a href="doc/changelogs/CHANGELOG_V16.md#16.4.1">16.4.1</a><br/>
<a href="doc/changelogs/CHANGELOG_V16.md#16.4.0">16.4.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V16.md#16.3.0">16.3.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V16.md#16.2.0">16.2.0</a><br/>
Expand Down
15 changes: 15 additions & 0 deletions doc/changelogs/CHANGELOG_V16.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
</tr>
<tr>
<td>
<a href="#16.4.2">16.4.2</a><br/>
<a href="#16.4.1">16.4.1</a><br/>
<a href="#16.4.0">16.4.0</a><br/>
<a href="#16.3.0">16.3.0</a><br/>
Expand Down Expand Up @@ -38,6 +39,20 @@
* [io.js](CHANGELOG_IOJS.md)
* [Archive](CHANGELOG_ARCHIVE.md)

<a id="16.4.2"></a>
## 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)

<a id="16.4.1"></a>
## 2021-07-01, Version 16.4.1 (Current), @BethGriggs

Expand Down
2 changes: 1 addition & 1 deletion src/node_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
31 changes: 31 additions & 0 deletions tools/msvs/msi/custom_actions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <windows.h>
#include <msiquery.h>
#include <wcautil.h>
#include <sddl.h>
#include <Lmcons.h>

#define GUID_BUFFER_SIZE 39 // {8-4-4-4-12}\0

Expand Down Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions tools/msvs/msi/custom_actions.def
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ LIBRARY "custom_actions"
EXPORTS
SetInstallScope
BroadcastEnvironmentUpdate
GetLocalizedUserNames
9 changes: 7 additions & 2 deletions tools/msvs/msi/product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"/>

<!-- PropertyRef of the account users for setting InstallDir permission explicitly -->
<Property Id="AUTHENTICATED_USERS" Value="Authenticated Users"/>

<PropertyRef Id="WIX_ACCOUNT_LOCALSYSTEM" />
<PropertyRef Id="WIX_ACCOUNT_USERS" />
<PropertyRef Id="WIX_ACCOUNT_ADMINISTRATORS" />
Expand Down Expand Up @@ -329,6 +327,12 @@
Execute="immediate"
Return="check" />

<CustomAction Id="GetLocalizedUserNames"
BinaryKey="CustomActionsDLL"
DllEntry="GetLocalizedUserNames"
Execute="immediate"
Return="check" />

<Property Id="WixShellExecTarget" Value="[#InstallToolsBat]" />
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" />

Expand All @@ -338,6 +342,7 @@

<InstallExecuteSequence>
<Custom Action='SetInstallScope' Before='FindRelatedProducts'/>
<Custom Action='GetLocalizedUserNames' After='SetInstallScope'/>
<Custom Action='BroadcastEnvironmentUpdate' After='InstallFinalize'/>
</InstallExecuteSequence>

Expand Down