diff --git a/scripts/update-msvcredist.ps1 b/scripts/update-msvcredist.ps1 new file mode 100644 index 00000000..947aa572 --- /dev/null +++ b/scripts/update-msvcredist.ps1 @@ -0,0 +1,34 @@ +$Urls = [ordered]@{ "X86" = "https://aka.ms/vs/17/release/vc_redist.x86.exe"; + "X64" = "https://aka.ms/vs/17/release/vc_redist.x64.exe"; + "ARM64" = "https://aka.ms/vs/17/release/vc_redist.arm64.exe"; } + +$UpgradeCodes = @{ "X86" = "65E5BD06-6392-3027-8C26-853107D3CF1A"; + "X64" = "36F68A90-239C-34DF-B58C-64B30153CE35"; + "ARM64" = "DC9BAE42-810B-423A-9E25-E4073F1C7B00"; } + +function Get-RedirectTarget([string]$Url) { + return (Invoke-WebRequest -Method Get -Uri $Url -MaximumRedirection 0 -ErrorAction SilentlyContinue).Headers.Location +} + +function Print-WixForArch([string]$Arch) { + $targetUrl = Get-RedirectTarget $Urls[$Arch] + + $file = "$env:TEMP\\vc_redist.tmp" + Invoke-WebRequest -Method Get -Uri $targetUrl -o $file + + $targetSize = (Get-Item $file).Length + $targetVersion = (Get-Command $file).Version + $targetSha1 = (Get-FileHash -Path $file -Algorithm SHA1).Hash + + Write-Output "" + Write-Output "" + Write-Output "" + Write-Output "" + Write-Output "" + + Remove-Item $file +} + +foreach ($arch in $Urls.Keys) { + Print-WixForArch $arch +} diff --git a/wix/MoonlightSetup/Bundle.wxs b/wix/MoonlightSetup/Bundle.wxs index e4908f3d..6595830d 100644 --- a/wix/MoonlightSetup/Bundle.wxs +++ b/wix/MoonlightSetup/Bundle.wxs @@ -1,17 +1,18 @@ - - - - + + + + + - - - + + + - - - + + + @@ -115,7 +116,7 @@ @@ -137,7 +138,7 @@