From db40110acc52b648c78c41593ea7e2141f7af755 Mon Sep 17 00:00:00 2001 From: Freddy Kristiansen Date: Mon, 29 Apr 2024 15:40:45 +0200 Subject: [PATCH] regressions (#3524) Fixes #3522 Fixes #3523 Co-authored-by: freddydk --- AppHandling/Compile-AppInNavContainer.ps1 | 2 +- ContainerHandling/New-NavContainer.ps1 | 12 ++++++++++++ Misc/Copy-FileToNavContainer.ps1 | 1 + ReleaseNotes.txt | 5 ++++- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/AppHandling/Compile-AppInNavContainer.ps1 b/AppHandling/Compile-AppInNavContainer.ps1 index c2de295f4..9cb8cf083 100644 --- a/AppHandling/Compile-AppInNavContainer.ps1 +++ b/AppHandling/Compile-AppInNavContainer.ps1 @@ -499,7 +499,7 @@ try { if (Test-Path -Path $symbolsFile) { $addDependencies = Invoke-ScriptInBcContainer -containerName $containerName -ScriptBlock { Param($symbolsFile, $platformversion) # Wait for file to be accessible in container - While (-not (Test-Path $symbolsFile)) { Start-Sleep -Seconds 1 } + While (-not (Test-Path $symbolsFile)) { Start-Sleep -Milliseconds 100 } if ($platformversion.Major -ge 15) { Add-Type -AssemblyName System.IO.Compression.FileSystem diff --git a/ContainerHandling/New-NavContainer.ps1 b/ContainerHandling/New-NavContainer.ps1 index 51fad23ca..2d1367070 100644 --- a/ContainerHandling/New-NavContainer.ps1 +++ b/ContainerHandling/New-NavContainer.ps1 @@ -1794,6 +1794,18 @@ if (!(dotnet --list-runtimes | Where-Object { $_ -like "Microsoft.NetCore.App 1. ') | Add-Content -Path "$myfolder\HelperFunctions.ps1" } + if ($genericTag -lt [System.Version]"1.0.2.21") { + @' +# Patch Microsoft.PowerShell.Archive to use en-US UI Culture (see https://github.com/PowerShell/Microsoft.PowerShell.Archive/pull/46) +$psarchiveModule = 'C:\Windows\System32\WindowsPowerShell\v1.0\Modules\Microsoft.PowerShell.Archive\Microsoft.PowerShell.Archive.psm1' +if (Test-Path $psarchiveModule) { + $rule = New-Object System.Security.AccessControl.FileSystemAccessRule((whoami),'Modify', 'Allow') + $acl = Get-Acl -Path $psarchiveModule; $acl.AddAccessRule($rule); Set-Acl -Path $psarchiveModule -AclObject $acl + Set-Content -encoding utf8 -path $psarchiveModule -value (Get-Content -encoding utf8 -raw -path $psarchiveModule).Replace("`r`nImport-LocalizedData LocalizedData -filename ArchiveResources`r`n","`r`nImport-LocalizedData LocalizedData -filename ArchiveResources -UICulture 'en-US'`r`n") +} +'@ | Add-Content -Path "$myfolder\SetupVariables.ps1" + } + if ($updateHosts) { Copy-Item -Path (Join-Path $PSScriptRoot "updatehosts.ps1") -Destination (Join-Path $myfolder "updatehosts.ps1") -Force $parameters += "--volume ""c:\windows\system32\drivers\etc:C:\driversetc""" diff --git a/Misc/Copy-FileToNavContainer.ps1 b/Misc/Copy-FileToNavContainer.ps1 index d5e31c906..46ae3cae4 100644 --- a/Misc/Copy-FileToNavContainer.ps1 +++ b/Misc/Copy-FileToNavContainer.ps1 @@ -35,6 +35,7 @@ try { try { Copy-Item -Path $localPath -Destination $tempFile Invoke-ScriptInBcContainer -containerName $containerName -scriptblock { Param($tempFile, $containerPath) + While (-not (Test-Path $tempFile)) { Start-Sleep -Milliseconds 100 } if (Test-Path $containerPath -PathType Container) { throw "ContainerPath ($containerPath) already exists as a folder. Cannot copy file, ContainerPath needs to specify a filename." } diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 1712fd423..4021b0acf 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -1,5 +1,8 @@ 6.0.17 - +Issue 3518 If WinRm is not running on the host, a container couldn't be created +Issue 3519 New-BcContainer fails due to password complexity on some computers +Issue 3522 The 'Expand-Archive' command was found in the module 'Microsoft.PowerShell.Archive',... +Issue 3523 Copy-FileToBcContainer fails for BcContainerHelper 6.0.16 (added resilience) 6.0.16 Issue 3477 Regression: Error: App filenames must be unique