Merge pull request #431 from miketimofeev/v-mitim/win19_wdk_fix
WDK installation fix for win19
This commit is contained in:
@@ -154,12 +154,6 @@
|
|||||||
"{{ template_dir }}/scripts/Installers/Windows2019/Update-DockerImages.ps1"
|
"{{ template_dir }}/scripts/Installers/Windows2019/Update-DockerImages.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "powershell",
|
|
||||||
"scripts": [
|
|
||||||
"{{ template_dir }}/scripts/Installers/Windows2019/Install-WDK.ps1"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "powershell",
|
"type": "powershell",
|
||||||
"valid_exit_codes": [
|
"valid_exit_codes": [
|
||||||
@@ -188,6 +182,12 @@
|
|||||||
"{{ template_dir }}/scripts/Installers/Install-NET48.ps1"
|
"{{ template_dir }}/scripts/Installers/Install-NET48.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "powershell",
|
||||||
|
"scripts": [
|
||||||
|
"{{ template_dir }}/scripts/Installers/Windows2019/Install-WDK.ps1"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "powershell",
|
"type": "powershell",
|
||||||
"scripts":[
|
"scripts":[
|
||||||
|
|||||||
@@ -18,4 +18,5 @@ Export-ModuleMember -Function @(
|
|||||||
'Add-SoftwareDetailsToMarkdown'
|
'Add-SoftwareDetailsToMarkdown'
|
||||||
'Stop-SvcWithErrHandling'
|
'Stop-SvcWithErrHandling'
|
||||||
'Set-SvcWithErrHandling'
|
'Set-SvcWithErrHandling'
|
||||||
|
'Get-VS19ExtensionVersion'
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -160,3 +160,30 @@ Hashtable for service arguments
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Get-VS19ExtensionVersion
|
||||||
|
{
|
||||||
|
param (
|
||||||
|
[string] [Parameter(Mandatory=$true)] $packageName
|
||||||
|
)
|
||||||
|
|
||||||
|
$instanceFolders = Get-ChildItem -Path "C:\ProgramData\Microsoft\VisualStudio\Packages\_Instances"
|
||||||
|
|
||||||
|
if ($instanceFolders -is [array])
|
||||||
|
{
|
||||||
|
Write-Host "More than one instance installed"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
$stateContent = Get-Content -Path (Join-Path $instanceFolders '\state.packages.json')
|
||||||
|
$state = $stateContent | ConvertFrom-Json
|
||||||
|
$packageVersion = ($state.packages | Where-Object { $_.id -eq $packageName }).version
|
||||||
|
|
||||||
|
if (!$packageVersion)
|
||||||
|
{
|
||||||
|
Write-Host "installed package $packageName for Visual Studio 2019 was not found"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
return $packageVersion
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,10 +3,6 @@
|
|||||||
## Desc: Install the Windows Driver Kit
|
## Desc: Install the Windows Driver Kit
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
# Version: 10.0.18362.0
|
|
||||||
# Update Validate-WDK.ps1 if the version changes!
|
|
||||||
# There doesn't seem to be any way to check the version programmatically
|
|
||||||
|
|
||||||
# Requires Windows SDK with the same version number as the WDK
|
# Requires Windows SDK with the same version number as the WDK
|
||||||
$winSdkUrl = "https://go.microsoft.com/fwlink/p/?linkid=2083338"
|
$winSdkUrl = "https://go.microsoft.com/fwlink/p/?linkid=2083338"
|
||||||
$wdkUrl = "https://go.microsoft.com/fwlink/?linkid=2085767"
|
$wdkUrl = "https://go.microsoft.com/fwlink/?linkid=2085767"
|
||||||
@@ -31,11 +27,21 @@ if ($wdkExitCode -ne 0)
|
|||||||
|
|
||||||
# Need to install the VSIX to get the build targets when running VSBuild
|
# Need to install the VSIX to get the build targets when running VSBuild
|
||||||
# Write-Host "Installing WDK.vsix"
|
# Write-Host "Installing WDK.vsix"
|
||||||
$process = Start-Process `
|
try
|
||||||
|
{
|
||||||
|
$process = Start-Process `
|
||||||
-FilePath "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\VSIXInstaller.exe" `
|
-FilePath "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\VSIXInstaller.exe" `
|
||||||
-ArgumentList ("/quiet", '"C:\Program Files (x86)\Windows Kits\10\Vsix\VS2019\WDK.vsix"') `
|
-ArgumentList ("/quiet", '"C:\Program Files (x86)\Windows Kits\10\Vsix\VS2019\WDK.vsix"') `
|
||||||
-Wait `
|
-Wait `
|
||||||
-PassThru
|
-PassThru
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
Write-Host "There is an error during WDK.vsix installation"
|
||||||
|
$_
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$exitCode = $process.ExitCode
|
$exitCode = $process.ExitCode
|
||||||
|
|
||||||
|
|||||||
@@ -3,11 +3,30 @@
|
|||||||
## Desc: Validate the installation of the Windows Driver Kit
|
## Desc: Validate the installation of the Windows Driver Kit
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
Import-Module -Name ImageHelpers -Force
|
||||||
|
|
||||||
|
function Get-WDKVersion
|
||||||
|
{
|
||||||
|
$WDKVersion = (Get-WmiObject Win32_Product -Filter "Name = 'Windows Driver Kit'").version
|
||||||
|
|
||||||
|
if (!$WDKVersion)
|
||||||
|
{
|
||||||
|
Write-Host "WDK was not found"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
return $WDKVersion
|
||||||
|
}
|
||||||
|
|
||||||
|
$WDKVersion = Get-WDKVersion
|
||||||
|
$WDKPackageVersion = Get-VS19ExtensionVersion -packageName "Microsoft.Windows.DriverKit"
|
||||||
|
|
||||||
# Adding description of the software to Markdown
|
# Adding description of the software to Markdown
|
||||||
$SoftwareName = "Windows Driver Kit"
|
$SoftwareName = "Windows Driver Kit"
|
||||||
|
|
||||||
$Description = @"
|
$Description = @"
|
||||||
_Version:_ 10.0.18362.0<br/>
|
_WDK Version:_ $WDKVersion<br/>
|
||||||
|
_WDK Visual Studio Extension Version:_ $WDKPackageVersion<br/>
|
||||||
"@
|
"@
|
||||||
|
|
||||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||||
|
|||||||
@@ -11,23 +11,6 @@ function Get-WixVersion {
|
|||||||
return $Version
|
return $Version
|
||||||
}
|
}
|
||||||
|
|
||||||
#Gets the extension details from state.json
|
|
||||||
function Get-WixExtensionPackage {
|
|
||||||
$vsProgramData = Get-Item -Path "C:\ProgramData\Microsoft\VisualStudio\Packages\_Instances"
|
|
||||||
$instanceFolders = Get-ChildItem -Path $vsProgramData.FullName
|
|
||||||
|
|
||||||
if($instanceFolders -is [array])
|
|
||||||
{
|
|
||||||
Write-Host "More than one instance installed"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
$stateContent = Get-Content -Path ($instanceFolders.FullName + '\state.packages.json')
|
|
||||||
$state = $stateContent | ConvertFrom-Json
|
|
||||||
$WixPackage = $state.packages | where { $_.id -eq "WixToolset.VisualStudioExtension.Dev16" }
|
|
||||||
return $WixPackage
|
|
||||||
}
|
|
||||||
|
|
||||||
$WixToolSetVersion = Get-WixVersion
|
$WixToolSetVersion = Get-WixVersion
|
||||||
|
|
||||||
if($WixToolSetVersion) {
|
if($WixToolSetVersion) {
|
||||||
@@ -38,22 +21,14 @@ else {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
$WixPackage = Get-WixExtensionPackage
|
$WixPackageVersion = Get-VS19ExtensionVersion -packageName "WixToolset.VisualStudioExtension.Dev16"
|
||||||
|
|
||||||
if($WixPackage) {
|
|
||||||
Write-Host "Wix Extension version" $WixPackage.version "installed"
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Write-Host "Wix Extension is not installed"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# Adding description of the software to Markdown
|
# Adding description of the software to Markdown
|
||||||
$SoftwareName = "WIX Tools"
|
$SoftwareName = "WIX Tools"
|
||||||
|
|
||||||
$Description = @"
|
$Description = @"
|
||||||
_Toolset Version:_ $WixToolSetVersion<br/>
|
_Toolset Version:_ $WixToolSetVersion<br/>
|
||||||
_WIX Toolset Visual Studio Extension Version:_ $($WixPackage.version)<br/>
|
_WIX Toolset Visual Studio Extension Version:_ $WixPackageVersion<br/>
|
||||||
_Environment:_
|
_Environment:_
|
||||||
* WIX: Installation root of WIX
|
* WIX: Installation root of WIX
|
||||||
"@
|
"@
|
||||||
|
|||||||
Reference in New Issue
Block a user