mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Fix the prerequisite check of MSI package (#5070)
* Skip check 'vsruntime140.dll' on Win10 * Make the precheck accurate * Update windows installation prerequisites * Change 'higher' to 'above' * Address comments * Address more comments * Address some more comments * [Feature] Update the installer test
This commit is contained in:
committed by
Aditya Patwardhan
parent
cd7ac4d436
commit
f7bab36f5d
@@ -1,28 +1,24 @@
|
||||
$thisTestFolder = Split-Path $MyInvocation.MyCommand.Path -Parent
|
||||
$wixProductFile = Join-Path $thisTestFolder "..\..\..\assets\Product.wxs"
|
||||
|
||||
Describe "Windows Installer" -Tags "Scenario" {
|
||||
|
||||
BeforeAll {
|
||||
$originalDefaultParameterValues = $PSDefaultParameterValues.Clone()
|
||||
if ( ! $IsWindows ) {
|
||||
$PSDefaultParameterValues["it:skip"] = $true
|
||||
}
|
||||
$preRequisitesLink = 'https://aka.ms/pscore6-prereq'
|
||||
$linkCheckTestCases = @(
|
||||
@{ Name = "Universal C Runtime"; Url = $preRequisitesLink }
|
||||
@{ Name = "WMF 4.0"; Url = "https://www.microsoft.com/download/details.aspx?id=40855" }
|
||||
@{ Name = "WMF 5.0"; Url = "https://www.microsoft.com/download/details.aspx?id=50395" }
|
||||
@{ Name = "WMF 5.1"; Url = "https://www.microsoft.com/download/details.aspx?id=54616" }
|
||||
)
|
||||
}
|
||||
|
||||
AfterAll {
|
||||
$global:PSDefaultParameterValues = $originalDefaultParameterValues
|
||||
}
|
||||
|
||||
$preRequisitesLink = 'https://github.com/PowerShell/PowerShell/blob/master/docs/installation/windows.md#prerequisites'
|
||||
|
||||
It "WiX (Windows Installer XML) file contains pre-requisites link $preRequisitesLink" {
|
||||
$wixProductFile = Join-Path -Path $PSScriptRoot -ChildPath "..\..\..\assets\Product.wxs"
|
||||
(Get-Content $wixProductFile -Raw).Contains($preRequisitesLink) | Should Be $true
|
||||
}
|
||||
|
||||
It "Pre-Requisistes link $preRequisitesLink is reachable" -TestCases $downloadLinks -Test {
|
||||
It "Pre-Requisistes link for '<Name>' is reachable" -TestCases $linkCheckTestCases -Test {
|
||||
param ($Url)
|
||||
|
||||
# Because an outdated link 'https://www.microsoft.com/download/details.aspx?id=504100000' would still return a 200 reponse (due to a redirection to an error page), it only checks that it returns something
|
||||
(Invoke-WebRequest $preRequisitesLink -UseBasicParsing) | Should Not Be $null
|
||||
(Invoke-WebRequest $Url -UseBasicParsing) | Should Not Be $null
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user