mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
Add SQL Server Data Tools extensions to VS2019 (#559)
* add extensions * add exe installation * change Reporting Services name * add switch to function, add validation * change install wdk to function * Fix template * fix scripts name * add quotes * more quotes * one more quotes * get rid of duplicate code * move quotes to function * small improvment to wix installation * add comment to validate extensions script
This commit is contained in:
@@ -1,51 +0,0 @@
|
||||
################################################################################
|
||||
## File: Install-WDK.ps1
|
||||
## Desc: Install the Windows Driver Kit
|
||||
################################################################################
|
||||
|
||||
# Version: 10.0.17763.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
|
||||
$winSdkUrl = "https://go.microsoft.com/fwlink/p/?LinkID=2023014"
|
||||
$wdkUrl = "https://go.microsoft.com/fwlink/?linkid=2026156"
|
||||
|
||||
# `winsdksetup.exe /features + /quiet` installs all features without showing the GUI
|
||||
$sdkExitCode = Install-EXE -Url $winSdkUrl -Name "winsdksetup.exe" -ArgumentList ("/features", "+", "/quiet")
|
||||
|
||||
if ($sdkExitCode -ne 0)
|
||||
{
|
||||
Write-Host "Failed to install the Windows SDK."
|
||||
exit $sdkExitCode
|
||||
}
|
||||
|
||||
# `wdksetup.exe /features + /quiet` installs all features without showing the GUI
|
||||
$wdkExitCode = Install-EXE -Url $wdkUrl -Name "wdksetup.exe" -ArgumentList ("/features", "+", "/quiet")
|
||||
|
||||
if ($wdkExitCode -ne 0)
|
||||
{
|
||||
Write-Host "Failed to install the Windows Driver Kit."
|
||||
exit $wdkExitCode
|
||||
}
|
||||
|
||||
# Need to install the VSIX to get the build targets when running VSBuild
|
||||
Write-Host "Installing WDK.vsix"
|
||||
$process = Start-Process `
|
||||
-FilePath "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VSIXInstaller.exe" `
|
||||
-ArgumentList ("/quiet", '"C:\Program Files (x86)\Windows Kits\10\Vsix\WDK.vsix"') `
|
||||
-Wait `
|
||||
-PassThru
|
||||
|
||||
$exitCode = $process.ExitCode
|
||||
|
||||
if ($exitCode -eq 0 -or $exitCode -eq 1001) # 1001 means the extension is already installed
|
||||
{
|
||||
Write-Host "WDK.vsix installed successfully"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Unsuccessful exit code returned by the installation process: $exitCode."
|
||||
}
|
||||
|
||||
exit $exitCode
|
||||
@@ -1,53 +0,0 @@
|
||||
################################################################################
|
||||
## File: Install-Wix.ps1
|
||||
## Desc: Install WIX.
|
||||
################################################################################
|
||||
function Install-VsixExtension
|
||||
{
|
||||
Param
|
||||
(
|
||||
[String]$Url,
|
||||
[String]$Name
|
||||
)
|
||||
|
||||
$exitCode = -1
|
||||
|
||||
try
|
||||
{
|
||||
Write-Host "Downloading $Name..."
|
||||
$FilePath = "${env:Temp}\$Name"
|
||||
|
||||
Invoke-WebRequest -Uri $Url -OutFile $FilePath
|
||||
|
||||
$ArgumentList = ('/quiet', $FilePath)
|
||||
|
||||
Write-Host "Starting Install $Name..."
|
||||
$process = Start-Process -FilePath 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VSIXInstaller.exe' -ArgumentList $ArgumentList -Wait -PassThru
|
||||
$exitCode = $process.ExitCode
|
||||
|
||||
if ($exitCode -eq 0 -or $exitCode -eq 3010)
|
||||
{
|
||||
Write-Host -Object 'Installation successful'
|
||||
return $exitCode
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host -Object "Non zero exit code returned by the installation process : $exitCode."
|
||||
return $exitCode
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Host -Object "Failed to install the Extension $Name"
|
||||
Write-Host -Object $_.Exception.Message
|
||||
return -1
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
choco install wixtoolset -y --force
|
||||
|
||||
#Installing VS extension 'Wix Toolset Visual Studio 2017 Extension'
|
||||
$exitCode = Install-VsixExtension -Url 'https://robmensching.gallerycdn.vsassets.io/extensions/robmensching/wixtoolsetvisualstudio2017extension/0.9.21.62588/1494013210879/250616/4/Votive2017.vsix' -Name 'Votive2017.vsix'
|
||||
|
||||
return $exitCode
|
||||
@@ -5,39 +5,13 @@
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
function Get-SSDTExtensionPackage {
|
||||
$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
|
||||
$SsdtPackage = $state.packages | where { $_.id -eq "SSDT" }
|
||||
return $SsdtPackage
|
||||
}
|
||||
|
||||
|
||||
$SsdtPackage = Get-SSDTExtensionPackage
|
||||
|
||||
if($SsdtPackage){
|
||||
Write-Host "SSDT version" $SsdtPackage.version "installed"
|
||||
}
|
||||
else {
|
||||
Write-Host "SSDT is not installed"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$SSDTPackageVersion = Get-VSExtensionVersion -packageName "SSDT"
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "SQL Server Data Tools for VS 2017"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $($SsdtPackage.version)<br/>
|
||||
_Version:_ $SSDTPackageVersion<br/>
|
||||
|
||||
The following components are installed:
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
################################################################################
|
||||
## File: Validate-WDK.ps1
|
||||
## Desc: Validate the installation of the Windows Driver Kit
|
||||
################################################################################
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Windows Driver Kit"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ 10.0.17763.0<br/>
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
@@ -1,62 +0,0 @@
|
||||
################################################################################
|
||||
## File: Validate-Wix.ps1
|
||||
## Desc: Validate WIX.
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
function Get-WixVersion {
|
||||
$regKey = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
|
||||
$installedApplications = Get-ItemProperty -Path $regKey
|
||||
$Version = ($installedApplications | Where-Object { $_.DisplayName -and $_.DisplayName.toLower().Contains("wix") } | Select-Object -First 1).DisplayVersion
|
||||
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.Dev15" }
|
||||
return $WixPackage
|
||||
}
|
||||
|
||||
$WixToolSetVersion = Get-WixVersion
|
||||
|
||||
if($WixToolSetVersion) {
|
||||
Write-Host "Wix Toolset version" $WixPackage.version "installed"
|
||||
}
|
||||
else {
|
||||
Write-Host "Wix Toolset is not installed"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$WixPackage = Get-WixExtensionPackage
|
||||
|
||||
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
|
||||
$SoftwareName = "WIX Tools"
|
||||
|
||||
$Description = @"
|
||||
_Toolset Version:_ $WixToolSetVersion<br/>
|
||||
_WIX Toolset Studio 2017 Extension Version:_ $($WixPackage.version)<br/>
|
||||
_Environment:_
|
||||
* WIX: Installation root of WIX
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
Reference in New Issue
Block a user