annotate deploy/win32/generate-wxs.ps1 @ 2549:8ac67c315afa

The installer file doesn't permit -pre in version string
author Chris Cannam
date Mon, 18 May 2020 15:29:46 +0100
parents 119588c42772
children
rev   line source
Chris@2448 1
Chris@2448 2 Set-StrictMode -Version 2.0
Chris@2448 3 $ErrorActionPreference = "Stop"
Chris@2448 4
Chris@2549 5 $version = (Get-Content version.h) -replace '#define SV_VERSION ','' -replace '"','' -replace '-pre.*',''
Chris@2448 6 $wxs = "deploy\win32\sonic-visualiser.wxs"
Chris@2448 7
Chris@2448 8 $in = "$wxs.in"
Chris@2448 9
Chris@2448 10 echo "Generating $wxs..."
Chris@2448 11 echo " ...for SV version $version"
Chris@2448 12 echo " ...from $in"
Chris@2448 13 echo ""
Chris@2448 14
Chris@2448 15 if (!(Test-Path -Path $in -PathType Leaf)) {
Chris@2448 16 echo "ERROR: Input file $in not found"
Chris@2448 17 exit 1
Chris@2448 18 }
Chris@2448 19
Chris@2448 20 (Get-Content $in) -replace '@VERSION@', $version -replace '@W@', '<!-- DO NOT EDIT THIS FILE: it is auto-generated -->' | Out-File -encoding ASCII $wxs
Chris@2448 21
Chris@2448 22 echo "Done"