Skip to content

Commit

Permalink
Issue #2678
Browse files Browse the repository at this point in the history
  • Loading branch information
freddydk committed Sep 19, 2022
1 parent f737ff5 commit 7800ab9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
12 changes: 9 additions & 3 deletions ContainerHandling/New-NavContainer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2248,7 +2248,7 @@ if (-not `$restartingInstance) {
New-Item -Path $dotnetAssembliesFolder -ItemType Directory -ErrorAction Ignore | Out-Null

Write-Host "Creating .net Assembly Reference Folder for VS Code"
Invoke-ScriptInBcContainer -containerName $containerName -scriptblock { Param($dotnetAssembliesFolder)
Invoke-ScriptInBcContainer -containerName $containerName -scriptblock { Param($dotnetAssembliesFolder, [System.Version] $Version)

$serviceTierFolder = (Get-Item "C:\Program Files\Microsoft Dynamics NAV\*\Service").FullName

Expand All @@ -2262,7 +2262,9 @@ if (-not `$restartingInstance) {
if (Test-Path $mockAssembliesPath -PathType Container) {
$paths += $mockAssembliesPath
}
$paths += "C:\Program Files (x86)\Open XML SDK"
if ($version.Major -lt 21) {
$paths += "C:\Program Files (x86)\Open XML SDK"
}

$paths | % {
$localPath = Join-Path $dotnetAssembliesFolder ([System.IO.Path]::GetFileName($_))
Expand All @@ -2283,7 +2285,11 @@ if (-not `$restartingInstance) {
new-item -itemtype symboliclink -path $ServiceTierAddInsFolder -name "RTC" -value (Get-Item $RtcFolder).FullName | Out-Null
}
}
} -argumentList (Get-BcContainerPath -containerName $containerName -path $dotnetAssembliesFolder)

if ($version.Major -ge 21) {
Remove-Item -Path (Join-Path $dotnetAssembliesFolder 'assembly\DocumentFormat.OpenXml.dll') -Force -ErrorAction SilentlyContinue
}
} -argumentList (Get-BcContainerPath -containerName $containerName -path $dotnetAssembliesFolder), $version
}

if ($customConfig.ServerInstance) {
Expand Down
3 changes: 2 additions & 1 deletion Misc/Download-Artifacts.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,9 @@ try {
$prerequisiteComponents = Get-Content $prerequisiteComponentsFile | ConvertFrom-Json
Write-Host "Downloading Prerequisite Components"
$prerequisiteComponents.PSObject.Properties | % {
$skip = ($_.Name -eq "Prerequisite Components\Open XML SDK 2.5 for Microsoft Office\OpenXMLSDKv25.msi") -and (([System.Version]$appManifest.Version).Major -ge 21)
$path = Join-Path $platformArtifactPath $_.Name
if (-not (Test-Path $path)) {
if ((-not $skip) -and (-not (Test-Path $path))) {
$dirName = [System.IO.Path]::GetDirectoryName($path)
$filename = [System.IO.Path]::GetFileName($path)
if (-not (Test-Path $dirName)) {
Expand Down

0 comments on commit 7800ab9

Please sign in to comment.