Skip to content

Commit

Permalink
Dotnet8 (#3273)
Browse files Browse the repository at this point in the history
latest ALC.EXE has a dependency on dotnet 8.0.0
This PR will JIT install that.

---------

Co-authored-by: freddydk <freddydk@users.noreply.github.com>
  • Loading branch information
freddydk and freddydk committed Dec 17, 2023
1 parent 84a4a6c commit 943df1d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
15 changes: 14 additions & 1 deletion ContainerHandling/New-NavContainer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1733,12 +1733,25 @@ Get-NavServerUser -serverInstance $ServerInstance -tenant default |? LicenseType
') | Set-Content -Path "$myfolder\HelperFunctions.ps1"
}
Write-Host "Patching container to install dotnet 6.0.13"
Download-File -source "https://bcartifacts.blob.core.windows.net/prerequisites/dotnet-hosting-6.0.13-win.exe" -destinationFile (Join-Path $myFolder "dotnet-win.exe")
Download-File -source "https://download.visualstudio.microsoft.com/download/pr/0cb3c095-c4f4-4d55-929b-3b4888a7b5f1/4156664d6bfcb46b63916a8cd43f8305/dotnet-hosting-6.0.13-win.exe" -destinationFile (Join-Path $myFolder "dotnet-win.exe")
('
if (Test-Path "c:\run\my\dotnet-win.exe") { Write-Host "Generic image is 1.0.2.13 or below, installing dotnet 6.0.13"; start-process -Wait -FilePath "c:\run\my\dotnet-win.exe" -ArgumentList /quiet; Remove-Item "c:\run\my\dotnet-win.exe" -Force }
') | Add-Content -Path "$myfolder\HelperFunctions.ps1"
}

if ($version.Major -ge 24 -and $genericTag -le [System.Version]"1.0.2.14") {
if (!(Test-Path -Path "$myfolder\HelperFunctions.ps1")) {
('# Invoke default behavior
. (Join-Path $runPath $MyInvocation.MyCommand.Name)
') | Set-Content -Path "$myfolder\HelperFunctions.ps1"
}
Write-Host "Patching container to install dotnet 8.0.0"
Download-File -source "https://download.visualstudio.microsoft.com/download/pr/2a7ae819-fbc4-4611-a1ba-f3b072d4ea25/32f3b931550f7b315d9827d564202eeb/dotnet-hosting-8.0.0-win.exe" -destinationFile (Join-Path $myFolder "dotnet-win8.exe")
('
if (Test-Path "c:\run\my\dotnet-win8.exe") { Write-Host "Generic image is 1.0.2.14 or below, installing dotnet 8.0.0"; start-process -Wait -FilePath "c:\run\my\dotnet-win8.exe" -ArgumentList /quiet; Remove-Item "c:\run\my\dotnet-win8.exe" -Force }
') | Add-Content -Path "$myfolder\HelperFunctions.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"""
Expand Down
10 changes: 8 additions & 2 deletions ContainerHandling/New-NavImage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -476,11 +476,17 @@ try {
$myscripts += @( "https://raw.githubusercontent.com/microsoft/nav-docker/master/generic/Run/210-new/SetupConfiguration.ps1" )
Write-Host "Patching prompt.ps1 due to issue #2891"
$myScripts += @( "https://raw.githubusercontent.com/microsoft/nav-docker/master/generic/Run/Prompt.ps1" )
$myScripts += @( "https://bcartifacts.blob.core.windows.net/prerequisites/dotnet-hosting-6.0.13-win.exe" )
$myScripts += @( "https://download.visualstudio.microsoft.com/download/pr/0cb3c095-c4f4-4d55-929b-3b4888a7b5f1/4156664d6bfcb46b63916a8cd43f8305/dotnet-hosting-6.0.13-win.exe" )
Write-Host "Base image is generic image 1.0.2.13 or below, installing dotnet 6.0.13"
$InstallDotNet = 'RUN start-process -Wait -FilePath "c:\run\dotnet-hosting-6.0.13-win.exe" -ArgumentList /quiet'
}


if ($genericTag -le [Version]"1.0.2.14" -and [Version]$appManifest.Version -ge [Version]"24.0.0.0") {
$myScripts += @( "https://download.visualstudio.microsoft.com/download/pr/2a7ae819-fbc4-4611-a1ba-f3b072d4ea25/32f3b931550f7b315d9827d564202eeb/dotnet-hosting-8.0.0-win.exe" )
Write-Host "Base image is generic image 1.0.2.14 or below, installing dotnet 8.0.0"
$InstallDotNet = 'RUN start-process -Wait -FilePath "c:\run\dotnet-hosting-8.0.0-win.exe" -ArgumentList /quiet'
}

$myScripts | ForEach-Object {
if ($_ -is [string]) {
if ($_.StartsWith("https://", "OrdinalIgnoreCase") -or $_.StartsWith("http://", "OrdinalIgnoreCase")) {
Expand Down
1 change: 1 addition & 0 deletions ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
6.0.3
Just-In-Time install dotnet 8.0.0 for Business Central version 24 or above (needed by alc.exe)

6.0.2
Compile-AppInBcContainer: When checking whether symbol download is needed, the Application dependency wasn't checked for version number
Expand Down

0 comments on commit 943df1d

Please sign in to comment.