2.1 KiB
Installer
Installer just installs WixUI whose job is to:
- Run the client code to unpack the latest full NuGet package and finish initial install.
- Execute the uninstaller code when WiX goes to remove us, and remove the App directory.
So, on install:
- WiX unpacks
WixUIand runs it, and puts an entry in Programs and Features. WixUIexecutes initial install usingSquirrel.Clientfor the full NuGet package, doing the update in-place so the installer never needs to be rebuilt.
On Uninstall:
- WiX gets notified about the uninstall, calls
WixUIto do app uninstall viaSquirrel.Client - WiX then blows away
WixUI, the "real" installed app.
Bootstrap UI
WixUI has an extremely simple UI when it does its work, it just pops
up, shows a progress bar, a-la Chrome Installer:
On Uninstall, there is no UI, it's solely in the background.
If Setup.exe gets invoked with the 'Install' action, and the app is already installed, we just execute the app, a-la ClickOnce.
Generating the WiX installer
The WiX install script is generated via a Mustache template, whose contents
are primarily populated via the generated NuGet release package. WiX will end
up installing WixUI, the latest NuGet package file, and a one-line
RELEASES file (meaning that what WiX installs is technically a valid Squirrel
remote update directory).
WiX Engine Events and what we should do about them
-
DetectedPackage- if we're installed (determine this by looking at the NuGet package in the same directory as the app), we run the app and bail. -
DetectComplete- Do what we're actually here to do (invoke the Squirrel installer), then on the UI thread, tell WiX to finish up. -
PlanPackageBegin- squelch installation of .NET 4 -
PlanComplete- Push WiX to to Apply state -
ApplyComplete- If something bad happened, switch to UI Error state, otherwise start the app if we're in Interactive Mode and call Shutdown() -
ExecuteError- Switch to the UI Error state