Chris@2448: Chris@2448: Set-StrictMode -Version 2.0 Chris@2448: $ErrorActionPreference = "Stop" Chris@2448: Chris@2448: $version = (Get-Content version.h) -replace '#define SV_VERSION ','' -replace '"','' Chris@2448: $wxs = "deploy\win32\sonic-visualiser.wxs" Chris@2448: Chris@2448: $in = "$wxs.in" Chris@2448: Chris@2448: echo "Generating $wxs..." Chris@2448: echo " ...for SV version $version" Chris@2448: echo " ...from $in" Chris@2448: echo "" 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 '@W@', '' | Out-File -encoding ASCII $wxs Chris@2448: Chris@2448: echo "Done"