Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #2691

Merged
merged 5 commits into from
Sep 19, 2022
Merged

Dev #2691

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
36 changes: 26 additions & 10 deletions CreateScript.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -367,14 +367,16 @@ $script:wizardStep++

switch ($script:thisStep) {
$Step.BcContainerHelper {
# ____ _____ _ _ _ _ _
# | _ \ / ____| | | (_) | | | | | |
# | |_) | ___| | ___ _ __ | |_ __ _ _ _ __ ___ _ __| |__| | ___| |_ __ ___ _ __
# | _ < / __| | / _ \| '_ \| __/ _` | | '_ \ / _ \ '__| __ |/ _ \ | '_ \ / _ \ '__|
# | |_) | (__| |____ (_) | | | | |_ (_| | | | | | __/ | | | | | __/ | |_) | __/ |
# |____/ \___|\_____\___/|_| |_|\__\__,_|_|_| |_|\___|_| |_| |_|\___|_| .__/ \___|_|
# | |
# |_|
Write-Host -ForegroundColor Yellow @'
____ _____ _ _ _ _ _
| _ \ / ____| | | (_) | | | | | |
| |_) | ___| | ___ _ __ | |_ __ _ _ _ __ ___ _ __| |__| | ___| |_ __ ___ _ __
| _ < / __| | / _ \| '_ \| __/ _` | | '_ \ / _ \ '__| __ |/ _ \ | '_ \ / _ \ '__|
| |_) | (__| |____ (_) | | | | |_ (_| | | | | | __/ | | | | | __/ | |_) | __/ |
|____/ \___|\_____\___/|_| |_|\__\__,_|_|_| |_|\___|_| |_| |_|\___|_| .__/ \___|_|
| |
|_|
'@
if (!$skipContainerHelperCheck) {
$module = Get-InstalledModule -Name "BcContainerHelper" -ErrorAction SilentlyContinue
if (!($module)) {
Expand All @@ -386,6 +388,10 @@ $Step.BcContainerHelper {
Write-Host -ForegroundColor Red "Use 'Install-Module BcContainerHelper -force' to install in PowerShell"
return
}
elseif ($module.Version -eq "0.0") {
Write-Host -ForegroundColor Green "You are running BcContainerHelper developer version"
Write-Host
}
else {
$myVersion = $module.Version.ToString()
$prerelease = $myVersion.Contains("-preview")
Expand Down Expand Up @@ -525,8 +531,9 @@ $Step.Version {
-options ([ordered]@{
"LatestSandbox" = "Latest Business Central Sandbox"
"LatestOnPrem" = "Latest Business Central OnPrem"
"Public Preview" = "Public Preview of Business Central Sandbox is typically available one month before we ship next major"
"Next Major" = "Insider Business Central Sandbox for Next Major release (requires insider SAS token from http://aka.ms/collaborate)"
"Next Minor" = "InsiderBusiness Central Sandbox for Next Minor release (requires insider SAS token from http://aka.ms/collaborate)"
"Next Minor" = "Insider Business Central Sandbox for Next Minor release (requires insider SAS token from http://aka.ms/collaborate)"
"SpecificSandbox" = "Specific Business Central Sandbox build (requires version number)"
"SpecificOnPrem" = "Specific Business Central OnPrem build (requires version number)"
"NAV2018" = "Specific NAV 2018 version"
Expand Down Expand Up @@ -576,6 +583,12 @@ $Step.Version2 {
$type = $predef.Substring(6)
$version = ''
}
elseif ($predef -like "Public Preview") {
$type = "Sandbox"
$version = ''
$storageAccount = "bcpublicpreview"
$select = 'latest'
}
elseif ($predef -like "Next*") {
$type = "Sandbox"
$version = ''
Expand Down Expand Up @@ -694,7 +707,10 @@ $Step.Country {

$versionno = $version
if ($versionno -eq "") {
$versionno = (Get-BcArtifactUrl -storageAccount $storageAccount -type $type -country "$(if ($type -eq 'sandbox') {"at"} else {"us"})" -sasToken $sasToken).split('/')[4]
$searchCountry = "us"
if ($type -eq 'sandbox') { "at" }
$aurl = Get-BcArtifactUrl -storageAccount $storageAccount -type $type -country $searchCountry -sasToken $sasToken -select $select
$versionno = $aurl.split('/')[4]
}
$majorVersion = [int]($versionno.Split('.')[0])
$countries = @()
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
2 changes: 1 addition & 1 deletion Misc/Get-BCArtifactUrl.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ try {
Write-Host -ForegroundColor Yellow 'On-premises build for 17.14 was replaced by 17.15.35135.0, using this version number instead'
$version = '17.15.35135.0'
}
elseif ($version -like '16.19*') {
elseif ($version -like '16.18*') {
Write-Host -ForegroundColor Yellow 'On-premises build for 16.18 was replaced by 16.19.35126.0, using this version number instead'
$version = '16.19.35126.0'
}
Expand Down
3 changes: 3 additions & 0 deletions ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
4.0.3
Support for specifying STANDARD or EXTENDED in UploadImportAndApply-ConfigPackageInBcContainer
Issue #2685 Typo in Get-BcArtifactUrl
Issue #2681 New-BcContainerWizard doesn't seem to support Public Preview Versions
Issue #2678 Compiling baseapp 21.x causes a compile error on .Net types

4.0.2
Issue #2664 Image rebuild forced by different tags of a generic dev image
Expand Down