Skip to content

Commit c6b0e77

Browse files
tristanlabellecompnerd
authored andcommitted
build.ps1: Enable semantic versionning for the installer
1 parent f80a4e8 commit c6b0e77

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

build.ps1

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,15 +367,25 @@ function Build-WiXProject()
367367
[string]$FileName,
368368
[Parameter(Mandatory = $true)]
369369
[hashtable]$Arch,
370+
[switch]$Bundle,
370371
[hashtable]$Properties = @{}
371372
)
372373

373374
$Name = $FileName.Split('.')[0]
374375
$ArchName = $Arch.VSName
375376

377+
$ProductVersionArg = $ProductVersion
378+
if (-not $Bundle)
379+
{
380+
# WiX v4 will accept a semantic version string for Bundles,
381+
# but Packages still require a purely numerical version number,
382+
# so trim any semantic versionning suffixes
383+
$ProductVersionArg = [regex]::Replace($ProductVersion, "[-+].*", "")
384+
}
385+
376386
$Properties = $Properties.Clone()
377387
TryAdd-KeyValue $Properties ProductArchitecture $ArchName
378-
TryAdd-KeyValue $Properties ProductVersion $ProductVersion
388+
TryAdd-KeyValue $Properties ProductVersion $ProductVersionArg
379389
TryAdd-KeyValue $Properties RunWixToolsOutOfProc true
380390
TryAdd-KeyValue $Properties OutputPath $Arch.MSIRoot
381391
TryAdd-KeyValue $Properties IntermediateOutputPath BinaryCache\$Name\$ArchName\
@@ -1120,7 +1130,7 @@ function Build-Installer()
11201130
DEVTOOLS_ROOT = "$($HostArch.ToolchainInstallRoot)\";
11211131
}
11221132

1123-
Build-WiXProject installer.wixproj -Arch $HostArch -Properties @{
1133+
Build-WiXProject installer.wixproj -Arch $HostArch -Bundle -Properties @{
11241134
OutputPath = "$BinaryCache\";
11251135
MSI_LOCATION = "$($HostArch.MSIRoot)\";
11261136
}

0 commit comments

Comments
 (0)