Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions .github/workflows/update-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ jobs:

# Uninstall existing VcRedists
- name: Uninstall VcRedists
shell: powershell
shell: pwsh
run: |
Import-Module ${{ github.workspace }}\VcRedist -Force
Get-InstalledVcRedist | Uninstall-VcRedist -Confirm:$False -Verbose

# Validate VcRedist 2017 and update the manifest
- name: Validate VcRedist 2017
shell: powershell
shell: pwsh
run: |
$Release = "2017"
Import-Module "${{ github.workspace }}\VcRedist" -Force
Expand All @@ -61,7 +61,7 @@ jobs:

# Validate VcRedist 2019 and update the manifest
- name: Validate VcRedist 2019
shell: powershell
shell: pwsh
run: |
$Release = "2019"
Import-Module "${{ github.workspace }}\VcRedist" -Force
Expand All @@ -76,7 +76,7 @@ jobs:

# Validate VcRedist 2022 and update the manifest
- name: Validate VcRedist 2022
shell: powershell
shell: pwsh
run: |
$Release = "2022"
Import-Module "${{ github.workspace }}\VcRedist" -Force
Expand All @@ -92,7 +92,7 @@ jobs:
# Format the date number for the commit message
- name: Get date
id: get-date
shell: powershell
shell: pwsh
run: |
echo "date=$(Get-Date -Format "yyyy-MM-dd")" >> $GITHUB_STATE

Expand Down Expand Up @@ -123,6 +123,12 @@ jobs:
ref: development
token: ${{ secrets.GITHUB_TOKEN }}

# Pull latest changes from validate-amd64 job
- name: Pull latest changes
shell: pwsh
run: |
git pull origin development

# Import GPG key so that we can sign the commit
- name: Import GPG key
id: import_gpg
Expand All @@ -140,14 +146,14 @@ jobs:

# Uninstall existing VcRedists
- name: Uninstall VcRedists
shell: powershell
shell: pwsh
run: |
Import-Module ${{ github.workspace }}\VcRedist -Force
Get-InstalledVcRedist | Uninstall-VcRedist -Confirm:$False -Verbose

# Validate VcRedist 2022 and update the manifest
- name: Validate VcRedist 2022
shell: powershell
shell: pwsh
run: |
$Release = "2022"
$Architecture = "arm64"
Expand All @@ -165,7 +171,7 @@ jobs:
# Format the date number for the commit message
- name: Get date
id: get-date
shell: powershell
shell: pwsh
run: |
echo "date=$(Get-Date -Format "yyyy-MM-dd")" >> $GITHUB_STATE

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/update-module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:
uses: potatoqualitee/psmodulecache@v6.2.1
with:
modules-to-cache: MarkdownPS
shell: powershell
shell: pwsh

# Update the version number in the module manifest
- name: Update module version number
id: update-version
shell: powershell
shell: pwsh
run: |
$modulePath = "${{ github.workspace }}\VcRedist"
$manifestPath = "${{ github.workspace }}\VcRedist\VcRedist.psd1"
Expand All @@ -51,7 +51,7 @@ jobs:
# Update the change log with the new version number
- name: Update CHANGELOG.md
id: update-changelog
shell: powershell
shell: pwsh
run: |
$changeLog = "${{ github.workspace }}\docs\changelog.md"
$replaceString = "^## VERSION$"
Expand All @@ -66,7 +66,7 @@ jobs:
# Update the docs with the new version number and supported VcRedists
- name: Update VERSIONS.md
id: update-versions
shell: powershell
shell: pwsh
run: |
Import-Module "${{ github.workspace }}\VcRedist" -Force
$VcRedists = Get-Vclist -Export All | `
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/validate-module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
paths:
- 'VcRedist/**'
- 'tests/**'
branches-ignore:
- main
pull_request:
Expand Down Expand Up @@ -66,14 +67,14 @@ jobs:
with:
files: "${{ github.workspace }}//tests//TestResults-${{ matrix.os }}.xml"

- name: Upload to Codecov
id: codecov
if: always()
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./CodeCoverage-${{ matrix.os }}.xml
verbose: true
# - name: Upload to Codecov
# id: codecov
# if: always()
# uses: codecov/codecov-action@v5
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# files: ./CodeCoverage-${{ matrix.os }}.xml
# verbose: true

update-module-version:
name: Update module version
Expand All @@ -88,10 +89,10 @@ jobs:
uses: potatoqualitee/psmodulecache@v6.2.1
with:
modules-to-cache: BuildHelpers
shell: powershell
shell: pwsh

- name: Update module version
shell: powershell
shell: pwsh
working-directory: "${{ github.workspace }}"
run: |
Import-Module -Name BuildHelpers
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## About

VcRedist is a PowerShell module for lifecycle management of the [Microsoft Visual C++ Redistributables](https://support.microsoft.com/en-au/help/2977003/the-latest-supported-visual-c-downloads). VcRedist downloads the supported (and unsupported) Redistributables, for local install, gold image deployment or importing as applications into the Microsoft Deployment Toolkit, Microsoft Configuration Manager or Microsoft Intune. Supports passive and silent installs and uninstalls of the Visual C++ Redistributables.
VcRedist is a PowerShell module for lifecycle management of the [Microsoft Visual C++ Redistributables](https://learn.microsoft.com/en-au/cpp/windows/latest-supported-vc-redist). VcRedist downloads the supported (and unsupported) Redistributables, for local install, gold image deployment or importing as applications into the Microsoft Deployment Toolkit, Microsoft Configuration Manager or Microsoft Intune. Supports passive and silent installs and uninstalls of the Visual C++ Redistributables.

[![validate-module](https://github.com/aaronparker/vcredist/actions/workflows/validate-module.yml/badge.svg)](https://github.com/aaronparker/vcredist/actions/workflows/validate-module.yml) [![codecov](https://codecov.io/gh/aaronparker/vcredist/branch/main/graph/badge.svg?token=0AUlPVPhiQ)](https://codecov.io/gh/aaronparker/vcredist)

Expand Down
2 changes: 1 addition & 1 deletion VcRedist/Private/Get-InstalledSoftware.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function Get-InstalledSoftware {
@{n = "ProductCode"; e = { $_.PSChildName } },
@{n = "BundleCachePath"; e = { $_.GetValue("BundleCachePath") } },
@{n = "Architecture"; e = { if ($_.GetValue("DisplayName") -like "*x64*") { "x64" } else { "x86" } } },
@{n = "Release"; e = { if ($_.GetValue("DisplayName") -match [RegEx]"(\d{4})\s+") { $matches[0].Trim(" ") } } },
@{n = "Release"; e = { if ($_.GetValue("DisplayName") -match [RegEx]"(\d{4})\s+") { $matches[0].Trim(" ") } elseif ($_.GetValue("DisplayName") -match [RegEx]"v(\d+)") { $matches[1].Trim(" ") } } },
@{n = "UninstallString"; e = { $_.GetValue("UninstallString") } },
@{n = "QuietUninstallString"; e = { $_.GetValue("QuietUninstallString") } },
@{n = "UninstallKey"; e = { $UninstallKey } }
Expand Down
4 changes: 2 additions & 2 deletions VcRedist/Public/Get-VcList.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ function Get-VcList {
[CmdletBinding(DefaultParameterSetName = "Manifest", HelpURI = "https://vcredist.com/get-vclist/")]
param (
[Parameter(Mandatory = $false, Position = 0, ParameterSetName = "Manifest")]
[ValidateSet("2012", "2013", "2015", "2017", "2019", "2022")]
[System.String[]] $Release = @("2012", "2013", "2022"),
[ValidateSet("2012", "2013", "2015", "2017", "2019", "14")]
[System.String[]] $Release = @("2012", "2013", "14"),

[Parameter(Mandatory = $false, Position = 1, ParameterSetName = "Manifest")]
[ValidateSet("x86", "x64", "ARM64")]
Expand Down
4 changes: 2 additions & 2 deletions VcRedist/Public/Uninstall-VcRedist.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ function Uninstall-VcRedist {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSReviewUnusedParameter", "")]
param (
[Parameter(Mandatory = $false, Position = 0, ParameterSetName = "Manual")]
[ValidateSet("2005", "2008", "2010", "2012", "2013", "2015", "2017", "2019", "2022")]
[System.String[]] $Release = @("2005", "2008", "2010", "2012", "2013", "2015", "2017", "2019", "2022"),
[ValidateSet("2005", "2008", "2010", "2012", "2013", "2015", "2017", "2019", "14")]
[System.String[]] $Release = @("2005", "2008", "2010", "2012", "2013", "2015", "2017", "2019", "14"),

[Parameter(Mandatory = $false, Position = 1, ParameterSetName = "Manual")]
[ValidateSet("x86", "x64", "ARM64")]
Expand Down
1 change: 0 additions & 1 deletion VcRedist/Public/Update-VcMdtBundle.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ function Update-VcMdtBundle {
if (Test-PSCore) {
Write-Warning -Message "PowerShell Core doesn't support PSSnapins. We can't load the MicrosoftDeploymentToolkit module."
throw [System.Management.Automation.InvalidPowerShellStateException]
Exit
}
}

Expand Down
30 changes: 15 additions & 15 deletions VcRedist/VisualCRedistributables.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@
"DetectionFile": "%SystemRoot%\\System32\\vcruntime140.dll"
},
{
"Name": "Visual C++ Redistributable for Visual Studio 2022",
"ProductCode": "{d8bbe9f9-7c5b-42c6-b715-9ee898a2e515}",
"Version": "14.44.35211.0",
"Name": "Visual C++ v14 Redistributable (x64)",
"ProductCode": "{91ee571b-0e8a-4c65-9eaf-2e2f5fc60c00}",
"Version": "14.50.35719.0",
"URL": "https://www.visualstudio.com/downloads/",
"URI": "https://aka.ms/vs/17/release/VC_redist.x64.exe",
"Release": "2022",
"URI": "https://aka.ms/vc14/vc_redist.x64.exe",
"Release": "14",
"Architecture": "x64",
"Install": "/install /passive /norestart",
"SilentInstall": "/install /quiet /norestart",
Expand All @@ -106,12 +106,12 @@
"DetectionFile": "%SystemRoot%\\System32\\vcruntime140.dll"
},
{
"Name": "Visual C++ Redistributable for Visual Studio 2022",
"ProductCode": "{0b5169e3-39da-4313-808e-1f9c0407f3bf}",
"Version": "14.44.35211.0",
"Name": "Visual C++ v14 Redistributable (x86)",
"ProductCode": "{0e4ccf1b-d073-4cfe-8a24-e86185719b56}",
"Version": "14.50.35719.0",
"URL": "https://www.visualstudio.com/downloads/",
"URI": "https://aka.ms/vs/17/release/VC_redist.x86.exe",
"Release": "2022",
"URI": "https://aka.ms/vc14/vc_redist.x86.exe",
"Release": "14",
"Architecture": "x86",
"Install": "/install /passive /norestart",
"SilentInstall": "/install /quiet /norestart",
Expand All @@ -121,12 +121,12 @@
"DetectionFile": "%SystemRoot%\\System32\\vcruntime140.dll"
},
{
"Name": "Visual C++ Redistributable for Visual Studio 2022",
"ProductCode": "{88A3EF6C-D7E4-4707-B3F5-E530B3AD6081}",
"Version": "14.44.35211.0",
"Name": "Visual C++ v14 Redistributable (Arm64)",
"ProductCode": "{a111f0a4-679e-43e6-bdfe-25e176541c72}",
"Version": "14.50.35719.0",
"URL": "https://www.visualstudio.com/downloads/",
"URI": "https://aka.ms/vs/17/release/VC_redist.arm64.exe",
"Release": "2022",
"URI": "https://aka.ms/vc14/vc_redist.arm64.exe",
"Release": "14",
"Architecture": "ARM64",
"Install": "/install /passive /norestart",
"SilentInstall": "/install /quiet /norestart",
Expand Down
Binary file modified VcRedist/img/vcredist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 15 additions & 8 deletions ci/Update-Manifest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,17 @@ param (
[System.String] $VcManifest
)

begin {
$ErrorActionPreference = [System.Management.Automation.ActionPreference]::Stop
$InformationPreference = [System.Management.Automation.ActionPreference]::Continue
$ProgressPreference = [System.Management.Automation.ActionPreference]::SilentlyContinue
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
}

process {

# Get an array of VcRedists from the current manifest and the installed VcRedists
Write-Host -ForegroundColor "Cyan" "`tGetting manifest from: $VcManifest."
Write-Information -MessageData "$($PSStyle.Foreground.Cyan)`tGetting manifest from: $VcManifest."
$CurrentManifest = Get-Content -Path $VcManifest | ConvertFrom-Json
$InstalledVcRedists = Get-InstalledVcRedist

Expand All @@ -25,7 +32,7 @@ process {
foreach ($Arch in $Architecture) {
foreach ($Rls in $Release) {

Write-Host "`tInstalling VcRedist $Rls." -ForegroundColor "Cyan"
Write-Information -MessageData "$($PSStyle.Foreground.Cyan)`tInstalling VcRedist $Rls."
Get-VcList -Release $Rls -Architecture $Arch | Save-VcRedist -Path $Path | Install-VcRedist -Silent
$InstalledVcRedists = Get-InstalledVcRedist | Where-Object { $_.Name -notmatch "Debug Runtime" }

Expand All @@ -35,9 +42,9 @@ process {

# If the manifest version of the VcRedist is lower than the installed version, the manifest is out of date
if ([System.Version]$InstalledItem.Version -gt [System.Version]$ManifestVcRedist.Version) {
Write-Host -ForegroundColor "Cyan" "`tVcRedist manifest is out of date."
Write-Host -ForegroundColor "Cyan" "`tInstalled version:`t$($InstalledItem.Version)"
Write-Host -ForegroundColor "Cyan" "`tManifest version:`t$($ManifestVcRedist.Version)"
Write-Information -MessageData "$($PSStyle.Foreground.Cyan)`tVcRedist manifest is out of date."
Write-Information -MessageData "$($PSStyle.Foreground.Cyan)`tInstalled version:`t$($InstalledItem.Version)"
Write-Information -MessageData "$($PSStyle.Foreground.Cyan)`tManifest version:`t$($ManifestVcRedist.Version)"

# Find the index of the VcRedist in the manifest and update it's properties
$Index = $CurrentManifest.Supported::IndexOf($CurrentManifest.Supported.ProductCode, $ManifestVcRedist.ProductCode)
Expand All @@ -54,19 +61,19 @@ process {
}

# If a version was found and were aren't in the main branch
Write-Host -ForegroundColor "Cyan" "`tFound new version $FoundNewVersion."
Write-Information -MessageData "$($PSStyle.Foreground.Cyan)`tFound new version $FoundNewVersion."
if ($FoundNewVersion -eq $true) {

# Convert to JSON and export to the module manifest
try {
Write-Host -ForegroundColor "Cyan" "`tUpdating module manifest for VcRedist $($Output -join ", ")."
Write-Information -MessageData "$($PSStyle.Foreground.Cyan)`tUpdating module manifest for VcRedist $($Output -join ", ")."
$CurrentManifest | ConvertTo-Json | Set-Content -Path $VcManifest -Force
}
catch {
throw "Failed to convert to JSON and write back to the manifest."
}
}
else {
Write-Host -ForegroundColor "Cyan" "`tInstalled VcRedist matches manifest."
Write-Information -MessageData "$($PSStyle.Foreground.Cyan)`tInstalled VcRedist matches manifest."
}
}
Binary file added img/Microsoft-VisualStudio2026.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion scripts/Import-IntoMdt.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Import-VcMdtApplication -VcList (Get-VcList) -Path $Path -MdtPath $DeploymentSha
New-VcMdtBundle -MdtPath $DeploymentShare

$params = @{
VcList = (Get-VcList -Release "2022" -Architecture "x64")
VcList = (Get-VcList -Release "14" -Architecture "x64")
Path = "E:\Temp\Deploy"
MdtPath = "E:\Temp\VcRedist"
AppFolder = "VcRedists"
Expand Down
4 changes: 2 additions & 2 deletions tests/Manifest.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
param ()

BeforeDiscovery {
$ValidateReleasesAmd64 = @("2017", "2019", "2022")
$ValidateReleasesArm64 = @("2022")
$ValidateReleasesAmd64 = @("2017", "2019", "14")
$ValidateReleasesArm64 = @("14")

if ($env:PROCESSOR_ARCHITECTURE -eq "AMD64") {
$SkipAmd = $false
Expand Down
6 changes: 3 additions & 3 deletions tests/Private/Test-VcListObject.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ BeforeDiscovery {
InModuleScope VcRedist {
BeforeAll {
$ValidObject = [PSCustomObject]@{
Name = "Visual C++ Redistributable for Visual Studio 2022"
Name = "Visual C++ Redistributable for Visual Studio 14"
ProductCode = "{6ba9fb5e-8366-4cc4-bf65-25fe9819b2fc}"
Version = "14.34.31931.0"
URL = "https://www.visualstudio.com/downloads/"
URI = "https://aka.ms/vs/17/release/VC_redist.x86.exe"
Release = "2022"
Release = "14"
Architecture = "x86"
Install = "/install /passive /norestart"
SilentInstall = "/install /quiet /norestart"
Expand All @@ -30,7 +30,7 @@ InModuleScope VcRedist {
}

$InvalidObject = [PSCustomObject]@{
Property1 = "Visual C++ Redistributable for Visual Studio 2022"
Property1 = "Visual C++ Redistributable for Visual Studio 14"
Property2 = "{6ba9fb5e-8366-4cc4-bf65-25fe9819b2fc}"
}
}
Expand Down
Loading
Loading