Introduction
An MSI installer has three distinct phases. The first, which is called the UI sequence, shows a graphical user interface (if you don't have one, this phase will go really fast). During this phase, the user can enter their preferences for things such as where the files will be installed, which features to include, and whether the user accepts the end user license agreement. No changes are made to the system at this point; we're just collecting information.
The next stage is called the immediate phase of the execute sequence, and this is where the installer thinks about all of the changes that it's going to make to the computer. It makes a list, so that it knows how to do that work in an orderly fashion and also how to undo it if an error occurs. After all, the last thing we want to do is leave the user's computer in a halfway state where only part of the installation took place. It's much better to undo the whole thing. This immediate phase is the first...