From b2f42ec274953624a2c1f60bfb0cb0b6198ec58f Mon Sep 17 00:00:00 2001 From: Freddy Kristiansen Date: Tue, 26 Mar 2024 13:06:55 +0100 Subject: [PATCH] only install once (#3446) Co-authored-by: freddydk --- ContainerHandling/New-NavContainer.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ContainerHandling/New-NavContainer.ps1 b/ContainerHandling/New-NavContainer.ps1 index 039da1c35..d49ae658f 100644 --- a/ContainerHandling/New-NavContainer.ps1 +++ b/ContainerHandling/New-NavContainer.ps1 @@ -1733,7 +1733,7 @@ if (!(Get-Command "invoke-sqlcmd" -ErrorAction SilentlyContinue)) { try { Write- Write-Host "Patching container to install ASP.NET Core 1.1" Download-File -source "https://download.microsoft.com/download/6/F/B/6FB4F9D2-699B-4A40-A674-B7FF41E0E4D2/DotNetCore.1.0.7_1.1.4-WindowsHosting.exe" -destinationFile (Join-Path $myFolder "dotnetcore.exe") (' -if (Test-Path "c:\run\my\dotnetcore.exe") { Write-Host "Installing ASP.NET Core 1.1"; start-process -Wait -FilePath "c:\run\my\dotnetcore.exe" -ArgumentList /quiet } +if (!(dotnet --list-runtimes | Where-Object { $_ -like "Microsoft.NetCore.App 1.1.*" })) { Write-Host "Installing ASP.NET Core 1.1"; start-process -Wait -FilePath "c:\run\my\dotnetcore.exe" -ArgumentList /quiet } ') | Add-Content -Path "$myfolder\HelperFunctions.ps1" }