mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Make MSI installer perform pre-requisite checks (#4602)
* #4458 MSI installer checks that the Windows C Runtime and VS Studio 2015 C++ redistributables are present and returns error message if not. Includes tests to check that the Wix file contains the download URLs and those URLs are not dead.
This commit is contained in:
committed by
Travis Plunk
parent
f6208f3c42
commit
54e892ab06
@@ -60,6 +60,30 @@
|
||||
|
||||
<!--We need to show EULA, and provide option to customize download location-->
|
||||
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
|
||||
|
||||
<!-- Prerequisites check for Windows Universal C time and Visual Studio 2015 C++ redistributables -->
|
||||
<Property Id="UCRTINSTALLED" Secure="yes">
|
||||
<DirectorySearch Id="Windows_System32" Path="[WindowsFolder]System32" Depth="0">
|
||||
<FileSearch Name="ucrtbase.dll"/>
|
||||
</DirectorySearch>
|
||||
</Property>
|
||||
<Property Id="VCREDISTINSTALLEDX64" Secure="yes">
|
||||
<RegistrySearch Id="VCRedist_RegSearch_x64" Root="HKLM" Name="Version" Type="raw" Win64="yes"
|
||||
Key="SOFTWARE\Microsoft\DevDiv\VC\Servicing\14.0\RuntimeMinimum"/>
|
||||
</Property>
|
||||
<Property Id="VCREDISTINSTALLEDX86" Secure="yes">
|
||||
<RegistrySearch Id="VCRedist_RegSearch_x86" Root="HKLM" Name="Version" Type="raw" Win64="no"
|
||||
Key="SOFTWARE\Microsoft\DevDiv\VC\Servicing\14.0\RuntimeMinimum"/>
|
||||
</Property>
|
||||
<Condition Message="$(env.ProductName) requires the Universal C Runtime to be installed. You can download it here: https://www.microsoft.com/download/details.aspx?id=50410">
|
||||
<![CDATA[Installed OR UCRTINSTALLED]]>
|
||||
</Condition>
|
||||
<Condition Message="$(env.ProductName) requires the Visual Studio C++ 2015 x64 redistributables to be installed. You can download it here: https://www.microsoft.com/download/details.aspx?id=48145">
|
||||
<![CDATA[Installed OR ("$(var.ProductTargetArchitecture)" = "x64" AND VCREDISTINSTALLEDX64 AND VCREDISTINSTALLEDX64 >= "14.0.23918")]]>
|
||||
</Condition>
|
||||
<Condition Message="$(env.ProductName) requires the Visual Studio C++ 2015 x86 redistributables to be installed. You can download it here: https://www.microsoft.com/download/details.aspx?id=48145">
|
||||
<![CDATA[Installed OR (VCREDISTINSTALLEDX86 AND VCREDISTINSTALLEDX86 >= "14.0.23918")]]>
|
||||
</Condition>
|
||||
|
||||
<Directory Id="TARGETDIR" Name="SourceDir">
|
||||
<Directory Id="$(var.ProductProgFilesDir)">
|
||||
|
||||
@@ -14,14 +14,14 @@ There is a shortcut placed in the Start Menu upon installation.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
* Install the [Universal C Runtime](https://www.microsoft.com/en-us/download/details.aspx?id=50410) on Windows versions prior to Windows 10.
|
||||
* 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://my.visualstudio.com/Downloads?pid=2082) for VS2015.
|
||||
* Install the [Visual C++ Redistributable](https://www.microsoft.com/download/details.aspx?id=48145) for VS2015.
|
||||
|
||||
## Deploying on Nano Server
|
||||
|
||||
These instructions assume that Windows PowerShell is running on the Nano Server image and that it has been generated by the [Nano Server Image Builder](https://technet.microsoft.com/en-us/windows-server-docs/get-started/deploy-nano-server).
|
||||
These instructions assume that Windows PowerShell is running on the Nano Server image and that it has been generated by the [Nano Server Image Builder](https://technet.microsoft.com/windows-server-docs/get-started/deploy-nano-server).
|
||||
Nano Server is a "headless" OS and deployment of PowerShell Core binaries can happen in two different ways:
|
||||
|
||||
1. Offline - Mount the Nano Server VHD and unzip the contents of the zip file to your chosen location within the mounted image.
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
$thisTestFolder = Split-Path $MyInvocation.MyCommand.Path -Parent
|
||||
$wixProductFile = Join-Path $thisTestFolder "..\..\..\assets\Product.wxs"
|
||||
|
||||
Describe "Windows Installer" -Tags "Scenario" {
|
||||
|
||||
Context "Universal C Runtime Download Link" {
|
||||
$universalCRuntimeDownloadLink = 'https://www.microsoft.com/download/details.aspx?id=50410'
|
||||
It "Wix file should have download link about Universal C runtime" {
|
||||
(Get-Content $wixProductFile -Raw).Contains($universalCRuntimeDownloadLink) | Should Be $true
|
||||
}
|
||||
It "Should have download link about Universal C runtime that is reachable" {
|
||||
(Invoke-WebRequest $universalCRuntimeDownloadLink.Replace("https://",'http://')) | Should Not Be $null
|
||||
}
|
||||
}
|
||||
|
||||
Context "Visual Studio C++ Redistributables Link" {
|
||||
$visualStudioCPlusPlusRedistributablesDownloadLink = 'https://www.microsoft.com/download/details.aspx?id=48145'
|
||||
It "WiX file should have documentation about Visual Studio C++ redistributables" {
|
||||
(Get-Content $wixProductFile -Raw).Contains($visualStudioCPlusPlusRedistributablesDownloadLink) | Should Be $true
|
||||
}
|
||||
It "Should have download link about Universal C runtime that is reachable" {
|
||||
(Invoke-WebRequest $visualStudioCPlusPlusRedistributablesDownloadLink.Replace("https://",'http://')) | Should Not Be $null
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user