MSI Bootstrap Loader
By default, MSI installers are built and distributed as .msi database
files. However, this requires that the target system contains the correct
version of Windows Installer. If the target system does not contain Windows
Installer or an earlier version, the installation will fail.
To prevent this type of problem, Tarma ExpertInstall can include a small program
with your installation package that checks the minimum required Windows Installer
version and optionally installs or updates Windows Installer on the target
system, before installing your own installation package. This type of pre-install
program is commonly called a bootstrap loader; the resulting installation
package is an .exe program file that internally contains the original
.msi installation database.
What the bootstrap loader does
During installation, the bootstrap loader performs the following actions:
- It checks the target system's Windows Installer version and compares it
to the minimum required version as specified in the MSI version
field in the MSI
Configuration pane.
- If the target system's version is equal to or greater than the minimum
required version, continue with step 6. Else, continue with step 3.
- Do the first of the following that applies:
- If the installation package includes an MSI redistributable for
the target platform, extract the redistributable to a temporary
file.
- If the installation package includes a download URL for the target
platform, ask the user for permission to download the redistributable
and store it in a temporary file.
- Cancel the installation with an error message.
- Verify the digital signature on the redistributable file from the previous
step, then do one of the following:
- If the digital signature is valid, continue with step 5.
- If the digital signature is not valid, cancel the installation
with an error message.
- If the digital signature cannot be verified or is not present,
ask the user for permission to continue.
- Run the redistributable file in order to install or update Windows Installer.
System reboots are suppressed. If the redistributable returns an error
code, the installation is cancelled.
- Verify the integrity of the embedded .msi package. If this fails,
cancel the installation with an error message.
- Extract the embedded .msi package and run Windows Installer with
the package. All command line options (the Default args field in
the MSI
Configuration pane, any piggy-backed
arguments, and any arguments on the command line of the bootstrap
loader itself) are passed to the Windows Installer executable MsiExec.exe,
along with the /I "package-path" option to identify the
installation package.
- Wait until the Windows Installer process terminates, then return its exit
code as the bootstrap loader's own exit code.
Differences in quiet mode
In quiet mode (indicated by /quiet, /passive, or any /q
option except /qf on the aggregate command line for the installer),
the bootstrap loader behaves in a slightly different way:
- No error messages are shown and no confirmations are requested. However,
in case of problems the loader's exit code will be set to the error code
that caused the installation to be cancelled.
- If applicable, the MSI redistributable download is performed automatically
(see step 3b above).
- If applicable, invalid, unsigned, or otherwise unverifiable redistributables
are rejected and the installation is cancelled (see steps 4b and 4c above).
Other benefits of the bootstrap loader
Using an MSI bootstrap loader has other benefits as well:
- The resulting .exe package is smaller than the stand-alone .msi
database. This happens because the .msi package is stored in compressed
format inside the bootstrapper, which more than compensates for the (modest)
additional size of the bootstrap loader itself.
- The bootstrap loader checks the embedded .msi package for integrity
before attempting to install it. This catches problems caused by incomplete
downloads or other damage to the installation package.
- The resulting .exe package has a complete VERSIONINFO resource,
containing your product identification in a format that is more easily
accessible than the MSI summary properties used in the .msi package.
- You can protect bootstrapped installers with a password; in that case,
the embedded .msi package will be encrypted and cannot be accessed
without a valid password.
- You can preset default command line arguments for the .exe installation
package, by using either the Default args field in the MSI
Configuration pane, or by using piggy-backed
arguments.
- The resulting .exe package is identified with your own custom icon
instead of the generic MSI icon (as specified by the Custom icon
field in the MSI
Configuration pane).