Skip to content

Commit

Permalink
Make scheduling of upgrade configurable (#8025)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericstj authored Oct 12, 2021
1 parent c451265 commit dfb902f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Microsoft.DotNet.Build.Tasks.Installers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ If you have files that need to have a stabilized identity in the MSI file, you c

If you want to create MSIs for the target RID that target other architecture install locations, you can add `CrossArchSdkMsiInstallerArch` items for all of the target architecture install locations you want to generate installers of the current build for.

To control the order in which an older product is removed during an upgrade, set the `MajorUpgradeSchedule` property to a value defined [here](https://wixtoolset.org/documentation/manual/v3/xsd/wix/majorupgrade.html). The default is `afterInstallInitialize`.

### Linux package configuration

To add package dependencies for linux packages, add a `LinuxPackageDependency` item with the version in the `Version` metadata.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@

<Package Compressed="yes" InstallScope="perMachine" InstallerVersion="$(var.InstallerVersion)" />

<MajorUpgrade DowngradeErrorMessage="$(var.DowngradeErrorMessage)" Schedule="afterInstallInitialize"/>
<?ifndef MajorUpgradeSchedule?>
<?define MajorUpgradeSchedule = afterInstallInitialize?>
<?endif?>

<MajorUpgrade DowngradeErrorMessage="$(var.DowngradeErrorMessage)" Schedule="$(var.MajorUpgradeSchedule)"/>

<MediaTemplate CompressionLevel="high" EmbedCab="yes"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@
<CandleVariables Include="NugetVersion" Value="$(Version)" />
<CandleVariables Include="TargetArchitectureDescription" Value="$(InstallerTargetArchitecture)$(CrossArchContentsBuildPart)" />
<CandleVariables Include="UpgradeCode" Value="$(UpgradeCode)" />
<CandleVariables Include="MajorUpgradeSchedule" Value="$(MajorUpgradeSchedule)" Condition="'$(MajorUpgradeSchedule)' != ''" />

<!-- If this is a cross-arch MSI, add target arch to the dependency key for uniqueness. -->
<CandleVariables Include="CrossArchContentsPlatformPart" Value="$(CrossArchContentsBuildPart.Replace('-', '_'))" />
Expand Down

0 comments on commit dfb902f

Please sign in to comment.