Mercurial > hg > tony
changeset 689:4bf2fd246c09
Use most recent redist dir, rather than hardcoding one
author | Chris Cannam |
---|---|
date | Mon, 30 Mar 2020 14:53:20 +0100 |
parents | a2c308bd5530 |
children | 74a82cec6aee |
files | deploy/win64/generate-wxs.ps1 |
diffstat | 1 files changed, 12 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/deploy/win64/generate-wxs.ps1 Wed Mar 25 13:26:42 2020 +0000 +++ b/deploy/win64/generate-wxs.ps1 Mon Mar 30 14:53:20 2020 +0100 @@ -2,13 +2,23 @@ Set-StrictMode -Version 2.0 $ErrorActionPreference = "Stop" -$redist_ver = "14.24.28127" +$redist_parent_dir = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\" + +$redists = (Get-ChildItem -Path $redist_parent_dir -Name -Include 14.* -Attributes Directory) + +if (!$redists) { + echo "ERROR: No 14.x redistributable directories found under $redist_parent_dir" + exit 1 +} + +$redist_ver = $redists[-1] + $version = (Get-Content version.h) -replace '#define TONY_VERSION ','' -replace '"','' $wxs = "deploy\win64\tony.wxs" $in = "$wxs.in" -$redist_dir="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\$redist_ver\x64\Microsoft.VC142.CRT" +$redist_dir="$redist_parent_dir\$redist_ver\x64\Microsoft.VC142.CRT" echo "Generating $wxs..." echo " ...for Tony version $version"