Chapter 4 of 8 • Windows Installer Engine

Pre-MSI Runtime Prerequisites & .MSM Merge Modules

Windows Installer allows only one active msiexec Execute sequence at a time (otherwise returning error 1618: Another installation is already in progress). Because third-party framework installers often invoke msiexec.exe internally, SetupWizard.exe stages and executes all [Prerequisite.<Id>] runtimes after the user clicks Install on the wizard summary screen and before Product.msi starts—all under a single unified UAC elevation prompt!

Three Flexible Runtime Delivery Modes

  • download (Small Web Bootstrapper): Streams the runtime over HTTPS via native OS WinHTTP with live byte progress, optional Sha256 verification, and an accessible Retry / Cancel prompt if offline.
  • embedded (Single-File Offline Setup.exe): Compresses your local runtime binary with Windows COMPRESS_ALGORITHM_LZMS (Cabinet.lib) straight into Win32 resources (#300+) alongside Product.msi.
  • side-by-side (ISO / USB Media Layout): Launches from a sibling Redist\ folder next to Setup.exe, automatically falling back to HTTPS if Url is also supplied.

Curated Presets & Reboot Exit Code Latching

Built-in presets (DotNet10Desktop, DotNet10AspNet, DotNet9Desktop, DotNet8Desktop, EdgeWebView2, and VcRedist2022) include architecture-aware detection probes and standardized reboot codes (3010, 1641, and 23). For Preset = Custom runtimes, specify SuccessExitCodes and RebootExitCodes directly: if any prerequisite requests a restart, SetupWizard.exe latches that flag, finishes installing your main Product.msi, and cleanly reports the restart notice at the end!

; Curated .NET 10 Desktop Runtime downloaded on demand
[Prerequisite.DotNet10]
Preset           = DotNet10Desktop
Distribution     = download

; Custom offline vendor runtime compressed with LZMS inside Setup.exe
[Prerequisite.AudioDriver]
Preset           = Custom
Name             = Studio Low-Latency Audio Runtime
Distribution     = embedded
SourceFile       = ..\redist\$(ARCH)\AudioRuntimeSetup.exe
SilentArgs       = /quiet /norestart
DetectRegKey     = HKLM\Software\SampleStudio\AudioRuntime
DetectRegValue   = InstalledVersion
DetectMinVersion = 2.4.0
SuccessExitCodes = 0, 1638
RebootExitCodes  = 3010, 1641, 23
  

Native 64-Bit .MSM Merge Module Consumption

Add as many [MergeModule.<Id>] sections as your project requires. Unlike legacy 32-bit COM mergemod.dll pipelines, instbuild.exe merges .msm SQL tables (Component, File, Directory, Registry, MsiFileHash) and extracts embedded MergeModule.CABinet payloads natively in 64-bit C++20 via msi.dll and Cabinet.lib FDI!

[MergeModule.SharedCore]
Source     = ..\..\out\shared-core-$(ARCH).msm
Feature    = Main
TargetRoot = INSTALLDIR