build(wix): add dev build mode

This commit is contained in:
Oleg Shparber 2020-08-15 15:27:00 -04:00
parent bbb7c6fbf7
commit 7b5fcbe4c2
2 changed files with 11 additions and 3 deletions

View File

@ -1,5 +1,4 @@
# TODO: This script should be replaced with wixproj and/or CPack.
# TODO: Add Debug mode to override CompressionLevel with "none".
# Sample command:
# .\build.ps1 -Arch x64 -Version 0.4.0 -PackagePath "c:\tmp\zeal-0.4.0-windows-x64" -SignMsi
@ -16,6 +15,7 @@ param(
[Parameter(Mandatory=$True)]
[string]$PackagePath,
[Switch]$DevBuild,
[Switch]$SignMsi
)
@ -32,8 +32,12 @@ function CleanUp {
Write-Output "Building $MsiFilename..."
if ($DevBuild) {
$compressionLevelArg = '-dCompressionLevel="none"'
}
Write-Output "Running candle..."
& candle.exe -nologo -pedantic -wx -arch "$Arch" -dAppVersion="$Version" -dAppPackageDir="$PackagePath" -o "$WixobjFilename" zeal.wxs
& candle.exe -nologo -pedantic -wx -arch "$Arch" -dAppVersion="$Version" -dAppPackageDir="$PackagePath" $compressionLevelArg -o "$WixobjFilename" zeal.wxs
if ($LastExitCode -ne 0) {
CleanUp
throw "candle failed with exit code $LastExitCode."

View File

@ -8,6 +8,10 @@
<?error AppPackageDir must be set ?>
<?endif?>
<?ifndef CompressionLevel ?>
<?define CompressionLevel="high" ?>
<?endif?>
<?define AppName="Zeal" ?>
<?define AppManufacturer="Oleg Shparber" ?>
<?define AppExeName="zeal.exe" ?>
@ -39,7 +43,7 @@
OnlyDetect="yes" Property="CURRENTVERSIONDETECTED" />
</Upgrade>
<MediaTemplate CompressionLevel="high" EmbedCab="yes" />
<MediaTemplate CompressionLevel="$(var.CompressionLevel)" EmbedCab="yes" />
<Icon Id="$(var.AppExeName)" SourceFile="$(var.AppPackageDir)\$(var.AppExeName)" />
<Property Id="ARPPRODUCTICON" Value="$(var.AppExeName)" />