Skip to content

Commit 8e33c9e

Browse files
authored
Version number fixes (plus a few small bugs) (#3700)
Three version number fixes: - Bump version - As minimum, always use the generic tag version which was available when shipping BcContainerHelper - Add awareness of Windows 11 24H2 - Issue 3697 Running tests fails with 401 when running on a BC25 sandbox container with AAD authentication Fixes #3694 Fixes #3697 --------- Co-authored-by: freddydk <[email protected]>
1 parent a776b3a commit 8e33c9e

8 files changed

+27
-7
lines changed

.github/workflows/CI.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ jobs:
199199
$modulePath = Join-Path $ENV:GITHUB_WORKSPACE "BcContainerHelper.psm1"
200200
Import-Module $modulePath -DisableNameChecking
201201
202+
$labels = Get-BcContainerImageLabels -imageName 'mcr.microsoft.com/businesscentral:ltsc2022'
203+
Set-Content -Path (Join-Path $path 'LatestGenericTagVersion.txt') -value $labels.tag
204+
202205
$functionsToExport = (get-module -Name BcContainerHelper).ExportedFunctions.Keys | Sort-Object
203206
$aliasesToExport = (get-module -Name BcContainerHelper).ExportedAliases.Keys | Sort-Object
204207

ContainerHandling/New-NavContainer.ps1

+9-3
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,10 @@ try {
426426

427427
$isServerHost = $os.ProductType -eq 3
428428

429-
if ($os.BuildNumber -eq 22631) {
429+
if ($os.BuildNumber -eq 26100) {
430+
$hostOs = "24H2"
431+
}
432+
elseif ($os.BuildNumber -eq 22631) {
430433
$hostOs = "23H2"
431434
}
432435
elseif ($os.BuildNumber -eq 22621) {
@@ -781,7 +784,7 @@ try {
781784
$imageName = $bestImageName
782785
if ($artifactUrl) {
783786
$genericTagVersion = [Version](Get-BcContainerGenericTag -containerOrImageName $imageName)
784-
if ($genericTagVersion -lt [Version]"1.0.2.20") {
787+
if ($genericTagVersion -lt [Version]$LatestGenericTagVersion) {
785788
Write-Host "Generic image is version $genericTagVersion - pulling a newer image"
786789
$pullit = $true
787790
}
@@ -1310,7 +1313,7 @@ try {
13101313
}
13111314
Write-Host "Using $isolation isolation"
13121315

1313-
if ($isolation -eq "process" -and !$isServerHost -and ($os.BuildNumber -eq 22621 -or $os.BuildNumber -eq 22631) -and $useSSL) {
1316+
if ($isolation -eq "process" -and !$isServerHost -and ($os.BuildNumber -eq 22621 -or $os.BuildNumber -eq 22631 -or $os.BuildNumber -eq 26100) -and $useSSL) {
13141317
Write-Host -ForegroundColor Red "WARNING: Using SSL when running Windows 11 with process isolation might not work due to a bug in Windows 11. Please use HyperV isolation or disable SSL."
13151318
}
13161319

@@ -1566,6 +1569,9 @@ try {
15661569
$AadTenantId = $AadTenant
15671570
if (!$AadTenantId) { $AadTenantId = "Common" }
15681571
$customWebSettings += @("AadApplicationId=$AadAppId","AadAuthorityUri=https://login.microsoftonline.com/$AADTenantId")
1572+
if ($version.Major -ge 25) {
1573+
$customWebSettings += @("AadValidAudience=https://api.businesscentral.dynamics.com")
1574+
}
15691575
}
15701576
}
15711577

ContainerHandling/New-NavImage.ps1

+4-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,10 @@ try {
138138
$baseImage = $bestGenericImageName
139139
}
140140

141-
if ($os.BuildNumber -eq 22631) {
141+
if ($os.BuildNumber -eq 26100) {
142+
$hostOs = "24H2"
143+
}
144+
elseif ($os.BuildNumber -eq 22631) {
142145
$hostOs = "23H2"
143146
}
144147
elseif ($os.BuildNumber -eq 22621) {

HelperFunctions.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ function GetAppInfo {
11241124
"application" = "$(if($manifest.PSObject.Properties.Name -eq 'application'){$manifest.application})"
11251125
"platform" = "$(if($manifest.PSObject.Properties.Name -eq 'platform'){$manifest.Platform})"
11261126
"propagateDependencies" = ($manifest.PSObject.Properties.Name -eq 'PropagateDependencies') -and $manifest.PropagateDependencies
1127-
"dependencies" = @(if($manifest.PSObject.Properties.Name -eq 'dependencies'){$manifest.dependencies | ForEach-Object { @{ "id" = $_.id; "name" = $_.name; "publisher" = $_.publisher; "version" = $_.version }}})
1127+
"dependencies" = @(if($manifest.PSObject.Properties.Name -eq 'dependencies'){$manifest.dependencies | ForEach-Object { if ($_.PSObject.Properties.Name -eq 'id') { $id = $_.id } else { $id = $_.AppId }; @{ "id" = $id; "name" = $_.name; "publisher" = $_.publisher; "version" = $_.version }}})
11281128
}
11291129
Write-Host " (succeeded using altool)"
11301130
}

InitializeModule.ps1

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ else {
3737
$isAdministrator = ((id -u) -eq 0)
3838
}
3939

40-
$BcContainerHelperVersion = Get-Content (Join-Path $PSScriptRoot "Version.txt")
40+
$BcContainerHelperVersion = (Get-Content (Join-Path $PSScriptRoot "Version.txt")).Trim()
41+
$LatestGenericTagVersion = (Get-Content (Join-Path $PSScriptRoot "LatestGenericTagVersion.txt")).Trim()
4142
if (!$silent) {
4243
Write-Host "$($moduleName.SubString(0,$moduleName.Length-5)) version $BcContainerHelperVersion"
4344
}

LatestGenericTagVersion.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.0.2.46

ReleaseNotes.txt

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
6.0.26
2+
As minimum, always use the generic tag version which was available when shipping BcContainerHelper
3+
Add awareness of Windows 11 24H2
4+
Issue #3697 Running tests fails with 401 when running on a BC25 sandbox container with AAD authentication
5+
Issue #3701 Compile-AppWithBcCompilerFolder, ALTool returns dependencies.appId for older apps
6+
17
6.0.25
28
Fix issue where generateDependencyArtifact doesn't result in dependencies if useCompilerFolder is true or filesonly containers are used in Run-AlPipeline
39
Issue 3686 PowerShell container shortcuts for >= BC24 using wrong PowerShell version

Version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.0.25-dev
1+
6.0.26-dev

0 commit comments

Comments
 (0)