diff --git a/images/win/scripts/Installers/Install-BizTalkBuildComponent.ps1 b/images/win/scripts/Installers/Install-BizTalkBuildComponent.ps1 new file mode 100644 index 00000000..8f446296 --- /dev/null +++ b/images/win/scripts/Installers/Install-BizTalkBuildComponent.ps1 @@ -0,0 +1,83 @@ +################################################################################ +## File: Install-BizTalkBuildComponent.ps1 +## Desc: Install BizTalk Project Build Component +################################################################################ + +function Install-Msi +{ + <# + .SYNOPSIS + A helper function to install executables. + + .DESCRIPTION + install .exe or .msi binaries from specified Path. + + .PARAMETER MsiPath + Msi or exe path. Required parameter. + + .PARAMETER LogPath + The log file path where installation will write log to. Required parameter. + + .EXAMPLE + Install-Msi -MsiPath "c:\temp\abc.msi" -LogPath "c:\abc.log" + #> + + Param + ( + [Parameter(Mandatory)] + [String] $MsiPath, + [Parameter(Mandatory)] + [String] $LogPath + ) + + try + { + $filePath = "msiexec.exe" + + Write-Host "Starting Install $MsiPath..." + $ArgumentList = ('/i', $MsiPath, '/QN', '/norestart', "/l*v",$LogPath) + $process = Start-Process -FilePath $filePath -ArgumentList $ArgumentList -Wait -PassThru -Verb runAs + + $exitCode = $process.ExitCode + if ($exitCode -eq 0 -or $exitCode -eq 3010) + { + Write-Host "Installation for $MsiPath is successful." + } + else + { + Write-Host "Non zero exit code returned by $MsiPath installation process: $exitCode" + Get-Content $LogPath | Write-Host + exit $exitCode + } + } + catch + { + Write-Host "Failed to install $MsiPath : $($_.Exception.Message)" + exit 1 + } +} + +$bizTalkBuildComponentUri = "https://aka.ms/BuildComponentSetup.EN" + +# Download +Write-Host "BizTalk Project Build Component download..." +$setupZipFile = Start-DownloadWithRetry -Url $bizTalkBuildComponentUri -Name "BuildComponentSetup.EN.zip" + +# Unzip +$setupPath = "C:\BizTalkBuildComponent" +if (-not (Test-Path -Path $setupPath)) { + $null = New-Item -Path $setupPath -ItemType Directory -Force +} + +Write-Host "Unzip $setupZipFile to $setupPath..." +Extract-7Zip -Path $setupZipFile -DestinationPath $setupPath +Remove-Item $setupZipFile + +# Install +Install-Msi -MsiPath "$setupPath\Bootstrap.msi" -LogPath "$setupPath\bootstrap.log" +Install-Msi -MsiPath "$setupPath\BuildComponentSetup.msi" -LogPath "$setupPath\buildComponentSetup.log" + +Remove-Item $setupPath -Recurse -Force + +# Test +Invoke-PesterTests -TestFile "BizTalk" -TestName "BizTalk Build Component Setup" \ No newline at end of file diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 index be9603f6..adf6bb37 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 @@ -286,6 +286,11 @@ function Get-YAMLLintVersion { yamllint --version } +function Get-BizTalkVersion { + $bizTalkReg = Get-ItemProperty "HKLM:\SOFTWARE\WOW6432Node\Microsoft\BizTalk Server\3.0" + return "- $($bizTalkReg.ProductName) $($bizTalkReg.ProductVersion) " +} + function Get-PipxVersion { $pipxVersion = pipx --version return "Pipx $pipxVersion" diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index 9918a606..d7589d94 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -139,6 +139,15 @@ $markdown += New-MDList -Style Unordered -Lines @( $markdown += New-MDHeader "MSYS2" -Level 3 $markdown += Get-PacmanVersion $markdown += New-MDNewLine + +if(Test-IsWin19) +{ + $markdown += New-MDHeader "BizTalk Server" -Level 3 + $markdown += Get-BizTalkVersion + $markdown += New-MDNewLine +} + +$markdown += New-MDHeader "Notes:" -Level 5 $markdown += @' ``` Location: C:\msys64 diff --git a/images/win/scripts/Tests/BizTalk.Tests.ps1 b/images/win/scripts/Tests/BizTalk.Tests.ps1 new file mode 100644 index 00000000..efe79216 --- /dev/null +++ b/images/win/scripts/Tests/BizTalk.Tests.ps1 @@ -0,0 +1,19 @@ +################################################################################ +## File: BizTalk.Tests.ps1 +## Desc: Test BizTalk project build component installed. +################################################################################ + +Describe "BizTalk Build Component Setup" -Skip:(Test-IsWin16) { + It "BizTalk Registry Check" { + Test-Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\BizTalk Server\3.0" | Should -BeTrue + } + + It "BizTalk Folder Check" { + "${env:ProgramFiles(x86)}\Microsoft BizTalk Server" | Should -Exist + } + + It "BizTalk Build Targets files Check" { + "${env:ProgramFiles(x86)}\MSBuild\Microsoft\BizTalk\BizTalkC.targets" | Should -Exist + "${env:ProgramFiles(x86)}\MSBuild\Microsoft\BizTalk\BizTalkCommon.targets" | Should -Exist + } +} \ No newline at end of file diff --git a/images/win/toolsets/toolset-2019.json b/images/win/toolsets/toolset-2019.json index 71725614..2cabda47 100644 --- a/images/win/toolsets/toolset-2019.json +++ b/images/win/toolsets/toolset-2019.json @@ -281,6 +281,11 @@ "name": "Microsoft.VisualStudio.Installer.Projects.vsix", "url": "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/VisualStudioClient/vsextensions/MicrosoftVisualStudio2017InstallerProjects/latest/vspackage", "id": "VSInstallerProjects" + }, + { + "name": "BizTalkVsix.vsix", + "url": "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ms-biztalk/vsextensions/BizTalk/3.13.2.0/vspackage", + "id": "BizTalkProjectSystem.BD1D0FA0-E48A-4270-995F-F110DD9F7838" } ] }, diff --git a/images/win/windows2019.json b/images/win/windows2019.json index c1c19073..43567f36 100644 --- a/images/win/windows2019.json +++ b/images/win/windows2019.json @@ -313,6 +313,12 @@ "{{ template_dir }}/scripts/Installers/Install-CodeQLBundle.ps1" ] }, + { + "type": "powershell", + "scripts": [ + "{{ template_dir }}/scripts/Installers/Install-BizTalkBuildComponent.ps1" + ] + }, { "type": "powershell", "scripts": [