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:
Dongbo Wang 2017-10-10 16:40:07 -07:00 committed by Aditya Patwardhan
parent cd7ac4d436
commit f7bab36f5d
3 changed files with 25 additions and 25 deletions

View file

@ -59,7 +59,7 @@
<Publish Dialog="MyExitDialog" Control="Finish" Order="1" Event="DoAction" Value="LaunchApplication">LAUNCHAPPONEXIT</Publish>
</UI>
<!-- Prerequisites -->
<Condition Message="Supported only on Win8 and above">
<Condition Message="Supported only on Windows 7 and above">
<![CDATA[ Installed OR $(var.MinOSVersionSupported) ]]>
</Condition>
<!-- Information About When Older Versions Are Trying To Be Installed-->
@ -74,7 +74,7 @@
<ComponentRef Id="ProductVersionFolder"/>
<ComponentRef Id="ApplicationProgramsMenuShortcut"/>
</Feature>
<!--We need to show EULA, and provide option to customize download location-->
<!-- We need to show EULA, and provide option to customize download location -->
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
<!-- Prerequisite check for Windows Universal C runtime -->
<Property Id="UNIVERSAL_C_RUNTIME_INSTALLED" Secure="yes">
@ -84,17 +84,17 @@
</DirectorySearch>
</DirectorySearch>
</Property>
<Condition Message="$(env.ProductName) requires the Universal C Runtime to be installed. You can find a download link to it here: https://github.com/PowerShell/PowerShell/blob/master/docs/installation/windows.md#prerequisites">
<Condition Message="$(env.ProductName) requires the Universal C Runtime to be installed to enable remoting over WinRM. You can find a download link to it here: https://aka.ms/pscore6-prereq">
<![CDATA[Installed OR UNIVERSAL_C_RUNTIME_INSTALLED]]>
</Condition>
<!-- Prerequisite check for Visual Studio 2015 C++ redistributables -->
<Property Id="VISUAL_CPP_RUNTIME_INSTALLED" Secure="yes">
<!-- Prerequisite check for Windows Management Framework -->
<Property Id="PWRSHPLUGIN_VERSION" Secure="yes">
<DirectorySearchRef Id="System32" Parent="WindowsDirectory" Path="System32">
<FileSearch Id="vcruntime140" Name="vcruntime140.dll"/>
<FileSearch Id="pwrshplugin" Name="pwrshplugin.dll" MinVersion="6.3.9600.16383"/>
</DirectorySearchRef>
</Property>
<Condition Message="$(env.ProductName) requires the Visual Studio 2015 C++ redistributables to be installed. You can find a download link to it here: https://github.com/PowerShell/PowerShell/blob/master/docs/installation/windows.md#prerequisites">
<![CDATA[Installed OR VISUAL_CPP_RUNTIME_INSTALLED]]>
<Condition Message="$(env.ProductName) requires the Windows Management Framework 4.0 or newer to be installed to enable remoting over WinRM. You can find download links here: https://aka.ms/pscore6-prereq">
<![CDATA[Installed OR PWRSHPLUGIN_VERSION ]]>
</Condition>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="$(var.ProductProgFilesDir)">

View file

@ -14,10 +14,14 @@ There is a shortcut placed in the Start Menu upon installation.
### Prerequisites
To enable PowerShell remoting over WinRM, the following prerequisites need to be met:
* Install the [Universal C Runtime](https://www.microsoft.com/download/details.aspx?id=50410) on Windows versions prior to Windows 10.
It is available via direct download or Windows Update.
Fully patched (including optional packages), supported systems will already have this installed.
* Install the [Visual C++ Redistributable](https://www.microsoft.com/download/details.aspx?id=48145) for VS2015.
* Install the Windows Management Framework (WMF) [4.0](https://www.microsoft.com/download/details.aspx?id=40855)
or newer ([5.0](https://www.microsoft.com/download/details.aspx?id=50395),
[5.1](https://www.microsoft.com/download/details.aspx?id=54616)) on Windows 7.
## Deploying on Nano Server

View file

@ -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
}
}