microsoft / navcontainerhelper

Official Microsoft repository for BcContainerHelper, a PowerShell module, which makes it easier to work with Business Central Containers on Docker.
MIT License
389 stars 248 forks source link

Create Container with Insider build 25.2 #3777

Closed RonKoppelaar closed 9 hours ago

RonKoppelaar commented 10 hours ago

When creating container using Insider build 25.2 I noticed the installation folder has changed from C:\Program Files\Microsoft Dynamics NAV\250\Service

into

C:\Program Files\Microsoft Dynamics NAV\252\Service

Is this by design or a bug in BC25.2? The folder structure has been like with major only since NAV forever?

freddydk commented 10 hours ago

I didn't notice, but I would assume that this is on purpose.

RonKoppelaar commented 10 hours ago

Well in that case I change my internal cmdlet. It was copy this file on creation of container: Where fileversion used to be majorVersion + 0 (eg: 250) Will change it into "Major + Minor"

            $SetupAddinsScript = @"
# Invoke default behavior
. (Join-Path `$runPath `$MyInvocation.MyCommand.Name)
Copy-Item -Path "C:\Test Assemblies\Mock Assemblies\*" -Destination "C:\Program Files\Microsoft Dynamics NAV\$FileVersion\Service\Add-ins" -Recurse
"@
RonKoppelaar commented 9 hours ago

However, I noticed this is no longer needed as BCContainer is also copying this artifacts today. Probably for very log time....

Starting line 2237 (New-NavContainer.ps1)

            $mockAssembliesPath = "C:\Test Assemblies\Mock Assemblies"
            if (Test-Path $mockAssembliesPath -PathType Container) {
                $paths += $mockAssembliesPath
            }
freddydk commented 9 hours ago

The safest way (and what I use all over) is:

$ServiceTierFolder = (Get-Item -Path 'C:\Program Files\Microsoft Dynamics NAV\*\Service').FullName

That will break when they move away from Microsoft Dynamics NAV :-)