Skip to content

build.ps1: Enable semantic versioning for the installer #497

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -367,15 +367,25 @@ function Build-WiXProject()
[string]$FileName,
[Parameter(Mandatory = $true)]
[hashtable]$Arch,
[switch]$Bundle,
[hashtable]$Properties = @{}
)

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

$ProductVersionArg = $ProductVersion
if (-not $Bundle)
{
# WiX v4 will accept a semantic version string for Bundles,
# but Packages still require a purely numerical version number,
# so trim any semantic versionning suffixes
$ProductVersionArg = [regex]::Replace($ProductVersion, "[-+].*", "")
}

$Properties = $Properties.Clone()
TryAdd-KeyValue $Properties ProductArchitecture $ArchName
TryAdd-KeyValue $Properties ProductVersion $ProductVersion
TryAdd-KeyValue $Properties ProductVersion $ProductVersionArg
TryAdd-KeyValue $Properties RunWixToolsOutOfProc true
TryAdd-KeyValue $Properties OutputPath $Arch.MSIRoot
TryAdd-KeyValue $Properties IntermediateOutputPath BinaryCache\$Name\$ArchName\
Expand Down Expand Up @@ -1120,7 +1130,7 @@ function Build-Installer()
DEVTOOLS_ROOT = "$($HostArch.ToolchainInstallRoot)\";
}

Build-WiXProject installer.wixproj -Arch $HostArch -Properties @{
Build-WiXProject installer.wixproj -Arch $HostArch -Bundle -Properties @{
OutputPath = "$BinaryCache\";
MSI_LOCATION = "$($HostArch.MSIRoot)\";
}
Expand Down