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: This script should be replaced with wixproj and/or CPack.
# TODO: Add Debug mode to override CompressionLevel with "none".
# Sample command: # Sample command:
# .\build.ps1 -Arch x64 -Version 0.4.0 -PackagePath "c:\tmp\zeal-0.4.0-windows-x64" -SignMsi # .\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)] [Parameter(Mandatory=$True)]
[string]$PackagePath, [string]$PackagePath,
[Switch]$DevBuild,
[Switch]$SignMsi [Switch]$SignMsi
) )
@ -32,8 +32,12 @@ function CleanUp {
Write-Output "Building $MsiFilename..." Write-Output "Building $MsiFilename..."
if ($DevBuild) {
$compressionLevelArg = '-dCompressionLevel="none"'
}
Write-Output "Running candle..." 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) { if ($LastExitCode -ne 0) {
CleanUp CleanUp
throw "candle failed with exit code $LastExitCode." throw "candle failed with exit code $LastExitCode."

View File

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