Skip to content

Commit 02723f1

Browse files
FireGiantDocsrobmen
authored andcommitted
Document Primary and Secondary BootstrapperApplications
Closes 8654
1 parent 75679ab commit 02723f1

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

src/content/docs/wix/whatsnew/oopbas.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ The motivation for this change can be found in [#7916](https://github.com/wixtoo
1414
The [WiX repo on GitHub](https://github.com/wixtoolset/wix) contains the code to bootstrapper applications using the new model, like [WixStandardBootstrapperApplication](https://github.com/wixtoolset/wix/blob/HEAD/src/ext/Bal/stdbas/WixStandardBootstrapperApplication.cpp) (C++) and [WixBA](https://github.com/wixtoolset/wix/tree/HEAD/src/test/burn/WixToolset.WixBA) (C#).
1515
:::
1616

17+
## BootstrapperApplication as an EXE
18+
1719
First, the custom bootstrapper application project needs to change from DLL to EXE.
1820

1921
```diff
@@ -83,6 +85,8 @@ At this point, the bootstrapper application API is fairly compatible with only a
8385
* `BalBaseBootstrapperApplication.h` was renamed to `BootstrapperApplicationBase.h`.
8486
* `CBalBaseBootstrapperApplication` was deprecated, use `CBootstrapperApplicationBase` instead.
8587

88+
## Package Renames
89+
8690
To take advantage of the breaking change, we took the opportunity to improve the names of many NuGet packages related to custom bootstrapper applications:
8791

8892
* `WixToolset.BalUtil` - renamed to `WixToolset.BootstrapperApplicationApi` to provide the native headers and libraries to communicate with Burn. Also, split out the `WixToolset.WixStandardBootstrapperApplicationFunctionApi` for WixStdBA BAFunctions API.
@@ -100,3 +104,28 @@ Related issues
100104

101105
* [#7916 - BootstrapperApplication Processes](https://github.com/wixtoolset/issues/issues/7916)
102106
* [#8020 - Better Burn-related .nupkg names](https://github.com/wixtoolset/issues/issues/8020)
107+
108+
109+
## Primary and Secondary BootstrapperApplications
110+
111+
A bundle may include two BootstrapperApplications: the primary and the secondary. The primary (no pun intended) use case is to support a complex BootstrapperApplication that requires prerequisites to be installed before it can proceed. A "secondary" BootstrapperApplication with no dependencies (and usually a minimal design) can be included to install those prerequisites. The sequence works like this:
112+
113+
1. Burn launches the primary BootstrapperApplication.
114+
2. If the primary BootstrapperApplication returns `0` as its exit code, Burn exits with the code provided via `IBootstrapperEngine.Quit()` and the sequence is complete.
115+
3. Otherwise, Burn launches the secondary BootstrapperApplication.
116+
4. If the secondary BootstrapperApplication returns `0` as its exit code, Burn exits with the code provided via `IBootstrapperEngine.Quit()` and the sequence is complete.
117+
5. Otherwise, Burn launches the primary BootstrapperApplication, one last time.
118+
119+
This sequence allows the primary BootstrapperApplication to complete the install/uninstall/repair/etc if possible. If not, the secondary BootstrapperApplication can complete the process itself or, more common, install a subset of the bundle's packages required to boot the primary BootstrapperApplication then return non-zero exit code to Burn.
120+
121+
This sequence also supports _always_ launching the prerequisite BootstrapperApplication as "primary" where it detects that everything is in place before _always_ returning non-zero so the main BootstrapperApplication runs secondary. This sequence is less optimal as it always requires two BootstrapperApplication launches but it is supported.
122+
123+
To author your primary and secondary BootstrapperApplications, use the `BootstrapperApplication` element's `Secondary` attribute. For example:
124+
125+
```xml
126+
<Fragment>
127+
<BootstrapperApplication Id="MainBA" SourceFile="mainba.exe" />
128+
129+
<BootstrapperApplication Id="PrereqBA" SourceFile="prqba.exe" Secondary="yes" />
130+
</Fragment>
131+
```

0 commit comments

Comments
 (0)