Chris@2448: Chris@2448: Set-StrictMode -Version 2.0 Chris@2448: $ErrorActionPreference = "Stop" Chris@2448: Chris@2448: $redist_ver = "14.24.28127" Chris@2448: $version = (Get-Content version.h) -replace '#define SV_VERSION ','' -replace '"','' Chris@2448: $wxs = "deploy\win64\sonic-visualiser.wxs" Chris@2448: Chris@2448: $in = "$wxs.in" Chris@2448: Chris@2448: $redist_dir="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\$redist_ver\x64\Microsoft.VC142.CRT" Chris@2448: Chris@2448: echo "Generating $wxs..." Chris@2448: echo " ...for SV version $version" Chris@2448: echo " ...for redist version $redist_ver" Chris@2448: echo " ...from $in" Chris@2448: echo "" Chris@2448: Chris@2448: if (!(Test-Path -Path $redist_dir -PathType Container)) { Chris@2448: echo "ERROR: Redistributable directory $redist_dir not found" Chris@2448: exit 1 Chris@2448: } Chris@2448: Chris@2448: if (!(Test-Path -Path $in -PathType Leaf)) { Chris@2448: echo "ERROR: Input file $in not found" Chris@2448: exit 1 Chris@2448: } Chris@2448: Chris@2448: (Get-Content $in) -replace '@VERSION@', $version -replace '@REDIST_VER@', $redist_ver -replace '@W@', '' | Out-File -encoding ASCII $wxs Chris@2448: Chris@2448: echo "Done"