Skip to content

Commit

Permalink
R11BRT-777 .NET 8 Hosting Bundle (#123)
Browse files Browse the repository at this point in the history
Upgrade the hosting bundle to .NET 8.0
  • Loading branch information
ajps28 authored Jan 17, 2024
1 parent 869f33f commit 3135a75
Show file tree
Hide file tree
Showing 7 changed files with 520 additions and 59 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# OutSystems.SetupTools Release History

## 3.16.3.0
## 3.17.0.0

- Upgrade the hosting bundle to .NET 8.0

## 3.16.3.0

- Added CentralizedPlatformLogs extension to installer arguments for versions above 11.18.1

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 3.16.3.{build}
version: 3.17.0.{build}

only_commits:
files:
Expand Down
50 changes: 50 additions & 0 deletions src/Outsystems.SetupTools/Functions/Get-OSServerPreReqs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,16 @@ function Get-OSServerPreReqs
$requireDotNetCoreHostingBundle2 = $true
$requireDotNetCoreHostingBundle3 = $true
$requireDotNetHostingBundle6 = $true
$requireDotNetHostingBundle8 = $true
}
elseif ($fullVersion -ge [version]"11.25.1.0") # TODO: DECIDE WHICH VERSION!!!!!
{
# Here means that minor and patch version were specified and we are equal or above version 11.25.1.0
# We install .NET 8.0 only
$requireDotNetCoreHostingBundle2 = $false
$requireDotNetCoreHostingBundle3 = $false
$requireDotNetHostingBundle6 = $false
$requireDotNetHostingBundle8 = $true
}
elseif ($fullVersion -ge [version]"11.17.1.0")
{
Expand Down Expand Up @@ -314,6 +324,46 @@ function Get-OSServerPreReqs
}


return $(CreateResult -Status $Status -IISStatus $IISStatus -OKMessages $OKMessages -NOKMessages $NOKMessages)
}
}

if ($requireDotNetHostingBundle8) {
$RequirementStatuses += CreateRequirementStatus -Title ".NET 8.0 Windows Server Hosting" `
-ScriptBlock `
{
$Status = $False
foreach ($version in GetDotNetHostingBundleVersions)
{
# Check version 8.0
if (([version]$version).Major -eq 8 -and ([version]$version) -ge [version]$script:OSDotNetCoreHostingBundleReq['8']['Version']) {
$Status = $True
}
}
$OKMessages = @("Minimum .NET 8.0.0 Windows Server Hosting found.")
$NOKMessages = @("Minimum .NET 8.0.0 Windows Server Hosting not found.")
$IISStatus = $True

if (Get-Command Get-WebGlobalModule -errorAction SilentlyContinue)
{
$aspModules = Get-WebGlobalModule | Where-Object { $_.Name -eq "aspnetcoremodulev2" }
if ($Status)
{
# Check if IIS can find ASP.NET modules
if ($aspModules.Count -lt 1)
{
$Status = $False
$IISStatus = $False
$NOKMessages = @("IIS can't find ASP.NET modules")
}
else
{
$IISStatus = $True
}
}
}


return $(CreateResult -Status $Status -IISStatus $IISStatus -OKMessages $OKMessages -NOKMessages $NOKMessages)
}
}
Expand Down
80 changes: 80 additions & 0 deletions src/Outsystems.SetupTools/Functions/Install-OSServerPreReqs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,17 @@ function Install-OSServerPreReqs
$installDotNetCoreHostingBundle2 = $true
$installDotNetCoreHostingBundle3 = $true
$installDotNetHostingBundle6 = $true
$installDotNetHostingBundle8 = $true
}
elseif ($fullVersion -ge [version]"11.25.1.0") # TODO: DECIDE WHICH VERSION!!!!!
{
# Here means that minor and patch version were specified and we are equal or above version 11.25.1.0
# We install .NET 8.0 only
$installDotNetCoreHostingBundle2 = $false
$installDotNetCoreHostingBundle3 = $false
$installDotNetHostingBundle6 = $false
$installDotNetHostingBundle8 = $true
$mostRecentHostingBundleVersion = [version]$script:OSDotNetCoreHostingBundleReq['8']['Version']
}
elseif ($fullVersion -ge [version]"11.17.1.0")
{
Expand All @@ -177,6 +188,7 @@ function Install-OSServerPreReqs
$installDotNetCoreHostingBundle2 = $false
$installDotNetCoreHostingBundle3 = $false
$installDotNetHostingBundle6 = $true
$installDotNetHostingBundle8 = $false
$mostRecentHostingBundleVersion = [version]$script:OSDotNetCoreHostingBundleReq['6']['Version']
}
elseif ($fullVersion -ge [version]"11.12.2.0")
Expand All @@ -186,6 +198,7 @@ function Install-OSServerPreReqs
$installDotNetCoreHostingBundle2 = $false
$installDotNetCoreHostingBundle3 = $true
$installDotNetHostingBundle6 = $false
$installDotNetHostingBundle8 = $false
$mostRecentHostingBundleVersion = [version]$script:OSDotNetCoreHostingBundleReq['3']['Version']
}
else
Expand All @@ -195,6 +208,7 @@ function Install-OSServerPreReqs
$installDotNetCoreHostingBundle2 = $true
$installDotNetCoreHostingBundle3 = $false
$installDotNetHostingBundle6 = $false
$installDotNetHostingBundle8 = $false
$mostRecentHostingBundleVersion = [version]$script:OSDotNetCoreHostingBundleReq['2']['Version']
}

Expand All @@ -216,6 +230,10 @@ function Install-OSServerPreReqs
if (([version]$version).Major -eq 6 -and ([version]$version) -ge [version]$script:OSDotNetCoreHostingBundleReq['6']['Version']) {
$installDotNetHostingBundle6 = $false
}
# Check .NET 8.0
if (([version]$version).Major -eq 8 -and ([version]$version) -ge [version]$script:OSDotNetCoreHostingBundleReq['8']['Version']) {
$installDotNetHostingBundle8 = $false
}
}

if ($installDotNetCoreHostingBundle2) {
Expand All @@ -227,6 +245,9 @@ function Install-OSServerPreReqs
if ($installDotNetHostingBundle6) {
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message "Minimum .NET Windows Server Hosting version 6.0.6 for OutSystems $MajorVersion not found. We will try to download and install the latest .NET Windows Server Hosting bundle"
}
if ($installDotNetHostingBundle8) {
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message "Minimum .NET Windows Server Hosting version 8.0.0 for OutSystems $MajorVersion not found. We will try to download and install the latest .NET Windows Server Hosting bundle"
}
}
}

Expand Down Expand Up @@ -521,6 +542,65 @@ function Install-OSServerPreReqs
}
}

# Install .NET Windows Server Hosting bundle version 8
if ($installDotNetHostingBundle8)
{
try
{
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message "Installing .NET 8.0 Windows Server Hosting bundle"
$exitCode = InstallDotNetCoreHostingBundle -MajorVersion '8' -Sources $SourcePath -SkipRuntimePackages $SkipRuntimePackages
}
catch [System.IO.FileNotFoundException]
{
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Exception $_.Exception -Stream 3 -Message ".NET 8.0 installer not found"
WriteNonTerminalError -Message ".NET 8.0 installer not found"

$installResult.Success = $false
$installResult.ExitCode = -1
$installResult.Message = '.NET 8.0 installer not found'

return $installResult
}
catch
{
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Exception $_.Exception -Stream 3 -Message "Error downloading or starting the .NET 8.0 installation"
WriteNonTerminalError -Message "Error downloading or starting the .NET 8.0 installation"

$installResult.Success = $false
$installResult.ExitCode = -1
$installResult.Message = 'Error downloading or starting the .NET 8.0 installation'

return $installResult
}

switch ($exitCode)
{
0
{
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message ".NET 8.0 Windows Server Hosting bundle successfully installed."
}

{ $_ -in 3010, 3011 }
{
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message ".NET 8.0 Windows Server Hosting bundle successfully installed but a reboot is needed. Exit code: $exitCode"
$installResult.RebootNeeded = $true
}

default
{
LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 3 -Message "Error installing .NET 8.0 Windows Server Hosting bundle. Exit code: $exitCode"
WriteNonTerminalError -Message "Error installing .NET 8.0 Windows Server Hosting bundle. Exit code: $exitCode"

$installResult.Success = $false
$installResult.ExitCode = $exitCode
$installResult.Message = 'Error installing .NET 8.0 Windows Server Hosting bundle'

return $installResult
}
}
}


if ($mostRecentHostingBundleVersion -and $RemovePreviousHostingBundlePackages)
{
$isInstalled = IsDotNetCoreUninstallToolInstalled
Expand Down
5 changes: 5 additions & 0 deletions src/Outsystems.SetupTools/Lib/Constants.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ $OSDotNetCoreHostingBundleReq = @{
ToInstallDownloadURL = 'https://download.visualstudio.microsoft.com/download/pr/0d000d1b-89a4-4593-9708-eb5177777c64/cfb3d74447ac78defb1b66fd9b3f38e0/dotnet-hosting-6.0.6-win.exe'
InstallerName = 'DotNet_WindowsHosting_6.exe'
}
'8' = @{
Version = '8.0.0'
ToInstallDownloadURL = 'https://download.visualstudio.microsoft.com/download/pr/2a7ae819-fbc4-4611-a1ba-f3b072d4ea25/32f3b931550f7b315d9827d564202eeb/dotnet-hosting-8.0.0-win.exe'
InstallerName = 'DotNet_WindowsHosting_8.exe'
}
}

# .NET Core Uninstall Tool related
Expand Down
2 changes: 1 addition & 1 deletion src/Outsystems.SetupTools/OutSystems.SetupTools.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'OutSystems.SetupTools.psm1'

# Version number of this module.
ModuleVersion = '3.16.3.0'
ModuleVersion = '3.17.0.0'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
Loading

0 comments on commit 3135a75

Please sign in to comment.