|
159 | 159 | <Chain DisableSystemRestore="yes" ParallelCache="yes">
|
160 | 160 |
|
161 | 161 | <!--
|
162 |
| - The finalizer is not an actual installation package. We "detect" the EXE |
163 |
| - based on the action the bundle is performing to ensure it runs the uninstall |
164 |
| - command only when the bundle is being removed. The package is always installable because the bundle |
165 |
| - will remove the package (execute its UninstallCommand) if it is not installable when then bundle is |
166 |
| - being installed. |
167 |
| -
|
168 |
| - See https://github.com/orgs/wixtoolset/discussions/9017. We cannot rely on the bundle action since it isn't finalized |
169 |
| - until the detect phase completes and therefore not available in a detect condition. We'll need to add explicit install/uninstall commands |
170 |
| - to the finalizer. |
171 |
| -
|
172 |
| - The finalizer is first in the chain to ensure it executes last during an uninstall. When the |
173 |
| - SDK is upgraded, the old SDK will be removed before the finalizer executes. This ensures that the |
174 |
| - finalizer detects the new SDK and does nothing because the feature band matches. |
175 |
| -
|
176 |
| - For an install+uninstall scenario, because the SDK MSI is removed prior to the finalizer, it will |
177 |
| - detect that there are no matching feature bands and then clean up workloads associated with |
178 |
| - the feature band. |
179 |
| - --> |
| 162 | + The finalizer is not an installation package. It's detected based on the bundle's installation state (WixBundleInstalled). |
| 163 | + |
| 164 | + User action | Install | Repair | Modify | Uninstall | Uninstall (Upgrade) |
| 165 | + WixBundleInstalled | FALSE | TRUE | TRUE | TRUE | TRUE |
| 166 | + WixBundleAction | 6 | 8 | 7 | 4 | 4 |
| 167 | + Finalizer (Plan) | None | Execute | Execute | Execute | Execute |
| 168 | + |
| 169 | + Setting an InstallCondition will cause Burn to remove the package if it evaluates to FALSE and |
| 170 | + the bundle is being installed, repaired, or modified. This breaks upgrades. We cannot use |
| 171 | + WixBundleAction in the DetectCondition because it's not finalized until the planning phase completes (after |
| 172 | + the detect phase). See https://github.com/orgs/wixtoolset/discussions/9017 for more detail. |
| 173 | + |
| 174 | + The finalizer also takes the bundle action as a parameter to ensure it no-ops, but logs the action. --> |
180 | 175 | <ExePackage SourceFile="$(FinalizerExeSourceFile)"
|
181 | 176 | Bundle="no"
|
182 | 177 | Cache="keep"
|
183 |
| - DetectCondition="WixBundleInstalled" |
| 178 | + DetectCondition="1=1" |
184 | 179 | Id="Finalizer"
|
185 |
| - InstallCondition="WixBundleAction >= 4" |
186 |
| - UninstallArguments=""[WixBundleLog_Finalizer]" $(Version) $(TargetArchitecture)" |
| 180 | + InstallArguments=""[WixBundleLog_Finalizer]" $(Version) $(TargetArchitecture) [WixBundleAction]" |
| 181 | + UninstallArguments=""[WixBundleLog_Finalizer]" $(Version) $(TargetArchitecture) [WixBundleAction]" |
| 182 | + RepairArguments=""[WixBundleLog_Finalizer]" $(Version) $(TargetArchitecture) [WixBundleAction]" |
187 | 183 | Vital="no" />
|
188 | 184 |
|
189 | 185 | <!-- .NET Runtime has to be installed before the CLI because of a custom action that depends on dotnet.exe. -->
|
|
0 commit comments