diff --git a/images/win/scripts/Installers/Install-Wix.ps1 b/images/win/scripts/Installers/Install-Wix.ps1 index 192c19b4..60d3e0e6 100644 --- a/images/win/scripts/Installers/Install-Wix.ps1 +++ b/images/win/scripts/Installers/Install-Wix.ps1 @@ -5,24 +5,4 @@ Choco-Install -PackageName wixtoolset -ArgumentList "--force" -if (Test-IsWin19) -{ - $extensionUrl = "https://wixtoolset.gallerycdn.vsassets.io/extensions/wixtoolset/wixtoolsetvisualstudio2019extension/1.0.0.4/1563296438961/Votive2019.vsix" - $VSver = "2019" -} -elseif (Test-IsWin16) -{ - $extensionUrl = "https://robmensching.gallerycdn.vsassets.io/extensions/robmensching/wixtoolsetvisualstudio2017extension/0.9.21.62588/1494013210879/250616/4/Votive2017.vsix" - $VSver = "2017" -} -else -{ - throw "Invalid version of Visual Studio is found. Either 2017 or 2019 are required" -} - -$extensionName = "Votive$VSver.vsix" - -#Installing VS extension 'Wix Toolset Visual Studio Extension' -Install-VsixExtension -Url $extensionUrl -Name $extensionName -VSversion $VSver - -Invoke-PesterTests -TestFile "Wix" +Invoke-PesterTests -TestFile "Tools" -TestName "WiX" diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index d6fcbf75..69537a43 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -121,6 +121,7 @@ $toolsList = @( (Get-VSWhereVersion), (Get-SwigVersion), (Get-WinAppDriver), + (Get-WixVersion), (Get-ZstdVersion), (Get-YAMLLintVersion) ) diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 index 185c0b67..9456bf56 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 @@ -156,6 +156,12 @@ function Get-WinAppDriver { return "WinAppDriver $winAppDriverVersion" } +function Get-WixVersion { + $regKey = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" + $installedApplications = Get-ItemProperty -Path $regKey + return ($installedApplications | Where-Object { $_.BundleCachePath -imatch ".*\\WiX\d*\.exe$" } | Select-Object -First 1).DisplayName +} + function Get-ZstdVersion { $(zstd --version) -match "v(?\d+\.\d+\.\d+)" | Out-Null $zstdVersion = $Matches.Version diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.VisualStudio.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.VisualStudio.psm1 index 341c5dc4..37a88255 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.VisualStudio.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.VisualStudio.psm1 @@ -13,12 +13,6 @@ function Get-SDKVersion { ($installedApplications | Where-Object { $_.DisplayName -eq 'Windows SDK' } | Select-Object -First 1).DisplayVersion } -function Get-WixVersion { - $regKey = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" - $installedApplications = Get-ItemProperty -Path $regKey - ($installedApplications | Where-Object { $_.DisplayName -match "wix" } | Select-Object -First 1).DisplayVersion -} - function Get-WDKVersion { $regKey = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" $installedApplications = Get-ItemProperty -Path $regKey @@ -67,14 +61,6 @@ function Get-VisualStudioExtensions { } if ((Test-IsWin16) -or (Test-IsWin19)) { - # Wix - $wixPackageVersion = Get-WixVersion - $wixExtensionVersion = ($vsPackages | Where-Object {$_.Id -match 'WixToolset.VisualStudioExtension.Dev' -and $_.type -eq 'vsix'}).Version - $wixPackages = @( - @{Package = 'WIX Toolset'; Version = $wixPackageVersion} - @{Package = "WIX Toolset Studio $vs Extension"; Version = $wixExtensionVersion} - ) - # WDK $wdkPackageVersion = Get-VSExtensionVersion -packageName 'Microsoft.Windows.DriverKit' $wdkExtensionVersion = Get-WDKVersion @@ -89,7 +75,6 @@ function Get-VisualStudioExtensions { $vsixs $ssdtPackages $sdkPackages - $wixPackages $wdkPackages ) diff --git a/images/win/scripts/Tests/Tools.Tests.ps1 b/images/win/scripts/Tests/Tools.Tests.ps1 index 5bf24fb5..c5578bff 100644 --- a/images/win/scripts/Tests/Tools.Tests.ps1 +++ b/images/win/scripts/Tests/Tools.Tests.ps1 @@ -187,6 +187,12 @@ Describe "WebPlatformInstaller" -Skip:(Test-IsWin22) { } } +Describe "WiX" { + It "WiX directory exists" { + $env:WIX | Should -Exist + } +} + Describe "Zstd" { It "zstd" { "zstd -V" | Should -ReturnZeroExitCode diff --git a/images/win/scripts/Tests/Wix.Tests.ps1 b/images/win/scripts/Tests/Wix.Tests.ps1 deleted file mode 100644 index ed9bed38..00000000 --- a/images/win/scripts/Tests/Wix.Tests.ps1 +++ /dev/null @@ -1,23 +0,0 @@ -Describe "Wix" -Skip:(Test-IsWin22) { - BeforeAll { - $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 - } - - It "Wix Toolset version from registry" { - $version | Should -Not -BeNullOrEmpty - } - - It "Wix Toolset version from system" { - if (Test-IsWin19) - { - $exVersion = Get-VSExtensionVersion -packageName "WixToolset.VisualStudioExtension.Dev16" - } - else - { - $exVersion = Get-VSExtensionVersion -packageName "WixToolset.VisualStudioExtension.Dev15" - } - $exVersion | Should -Not -BeNullOrEmpty - } -} diff --git a/images/win/windows2022.json b/images/win/windows2022.json index 69068512..334e4b7e 100644 --- a/images/win/windows2022.json +++ b/images/win/windows2022.json @@ -168,6 +168,7 @@ { "type": "powershell", "scripts": [ + "{{ template_dir }}/scripts/Installers/Install-Wix.ps1", "{{ template_dir }}/scripts/Installers/Install-Vsix.ps1", "{{ template_dir }}/scripts/Installers/Install-AzureCli.ps1", "{{ template_dir }}/scripts/Installers/Install-AzureDevOpsCli.ps1",