diff --git a/news/3886.fixed.md b/news/3886.fixed.md new file mode 100644 index 0000000000..2285813f8b --- /dev/null +++ b/news/3886.fixed.md @@ -0,0 +1 @@ +(windows) Fixed build data generation on localized Windows installations. diff --git a/python/private/build_data_writer.ps1 b/python/private/build_data_writer.ps1 index 0074e69d38..05c49fef9c 100644 --- a/python/private/build_data_writer.ps1 +++ b/python/private/build_data_writer.ps1 @@ -21,7 +21,16 @@ $Utf8NoBom = New-Object System.Text.UTF8Encoding $False [System.IO.File]::WriteAllLines($OutputPath, $Lines, $Utf8NoBom) $Acl = Get-Acl $OutputPath -$AccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("Everyone", "Read", "Allow") +# We use WorldSid because the "Everyone" name is locale-dependent. +$EveryoneSid = New-Object System.Security.Principal.SecurityIdentifier( + [System.Security.Principal.WellKnownSidType]::WorldSid, + $null +) +$AccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule( + $EveryoneSid, + "Read", + "Allow" +) $Acl.SetAccessRule($AccessRule) Set-Acl $OutputPath $Acl