Skip to content

Deployment

Rod Christiansen edited this page Oct 8, 2026 · 4 revisions

Deployment

How BootstrapMate gets onto a Windows device and how it is started. This page covers the MSI, the scheduled task it creates, delivery as an Intune Win32 app, detection, and re-running the tool on a device that is already provisioned.

The MSI

BootstrapMate ships as a per-architecture, per-machine MSI: BootstrapMate-x64-<version>.msi and BootstrapMate-arm64-<version>.msi. There is no combined package; deploy the one that matches the device. The product appears in Add or Remove Programs as Managed Bootstrap Install.

It installs into C:\Program Files\BootstrapMate:

File What it is
managedbootstrapinstall.exe The CLI. This is what runs a manifest
Managed Bootstrap Install.exe The desktop app, with its Windows App SDK payload

The install directory is appended to the system PATH, and a Start Menu entry named Managed Bootstrap Install opens the app. Both binaries are self-contained, so there is no .NET runtime prerequisite.

The MSI also:

  • Writes InstallPath, Version, InstallDate, Architecture and LastRunVersion under HKLM\SOFTWARE\BootstrapMate. Version and LastRunVersion are both the build stamp, YYYY.MM.DD.HHMM.
  • Writes the build's default ManifestUrl to HKLM\SOFTWARE\BootstrapMate\Settings, on every install and upgrade. Set your own URL by policy, which wins; see Preferences.
  • Creates HKLM\SOFTWARE\BootstrapMate\Secrets with an ACL for SYSTEM and Administrators only.
  • Gives C:\ProgramData\ManagedBootstrap its own ACL: owner SYSTEM, SYSTEM and Administrators full control, Users read. The folder is kept on uninstall, with its logs and records.
  • Removes the stale 32-bit settings key, HKLM\SOFTWARE\WOW6432Node\BootstrapMate\Settings.
  • Registers the BootstrapMate Self-Heal scheduled task and starts it once.

MajorUpgrade is configured with AllowSameVersionUpgrades="no" and AllowDowngrades="no". The MSI ProductVersion carries the build time to the hour, so two builds from the same hour do not upgrade each other, and an older MSI is refused with A newer version of [ProductName] is already installed. See Building and Signing.

What happens during install

Two custom actions run on install and upgrade:

  1. RegisterSelfHealTask, after InstallFiles, creates the scheduled task described below.
  2. RunBootstrapMate, before InstallFinalize, deferred, not impersonated, with its result ignored, runs schtasks.exe /Run /TN "BootstrapMate Self-Heal".

The install-time run therefore happens through the scheduled task, not from the MSI itself. A deferred custom action that started managedbootstrapinstall.exe directly would deadlock: the child msiexec processes it starts for MSI packages wait on the Windows Installer mutex the parent MSI still holds.

Two consequences follow. The run takes the task's SYSTEM context. And because the custom action starts the task without waiting and ignores its result, the MSI finishes and reports success while packages may still be installing.

On uninstall, UnregisterSelfHealTask deletes the task before files are removed.

The self-heal scheduled task

The MSI registers one task, equivalent to this command for the default install directory:

schtasks /Create /TN "BootstrapMate Self-Heal" /TR "\"C:\Program Files\BootstrapMate\managedbootstrapinstall.exe\" --silent --no-dialog" /SC DAILY /ST 03:00 /RU SYSTEM /RL HIGHEST /F

So: daily at 03:00 local time, as SYSTEM, at the highest run level, with no console output and no dialog. It passes no --url, so the manifest URL comes from policy, then machine settings, then the built-in default.

With a preflight stage in the manifest, this daily run is what keeps provisioned machines current: the preflight recognises a provisioned machine and asks for a baseline, which refreshes the setupassistant items within the throttle. Without one, every daily run provisions in full. See Preflight and Baseline.

Inspect the task:

schtasks /Query /TN "BootstrapMate Self-Heal" /V /FO LIST

Delivering it as an Intune Win32 app

build.ps1 produces publish\intunewin\BootstrapMate-<arch>-<version>.intunewin from each MSI. Create one Win32 app per architecture, with an architecture requirement rule so the x64 package never lands on an ARM64 device or the reverse.

Install command:

msiexec /i "BootstrapMate-x64-<version>.msi" /qn /norestart

Uninstall command. WiX generates a new ProductCode for every build, so reference the MSI in the package rather than a GUID:

msiexec /x "BootstrapMate-x64-<version>.msi" /qn /norestart

Install behaviour is System.

Detection

Decide what the rule detects.

That this build is installed. Use a registry rule on the MSI-written value, the build stamp. For a release MSI it equals the tag without its v:

HKLM\SOFTWARE\BootstrapMate → Version, string, equals 2026.10.05.1229

That a bootstrap run completed. Use a custom detection script that reads last-run.json, which only a run writes:

$record = Get-Content 'C:\ProgramData\ManagedBootstrap\last-run.json' -Raw -ErrorAction SilentlyContinue | ConvertFrom-Json
if ($record.status -eq 'completed') { Write-Output "BootstrapMate $($record.tool_version) $($record.run_type) completed"; exit 0 }
exit 1

LastRunVersion is a weaker signal: the MSI writes it at install, and a run with failed packages leaves the existing value in place. The scripts in examples/detection-scripts/ compare LastRunVersion to a version hard-coded in each script; update it before use. See Logging and Reporting.

The CLI's exit code reaches Intune too when the CLI itself is the install command: 0 success, 1 usage or manifest error, 2 packages failed, 3 elevation not obtained. With the MSI as the install command, Intune sees the MSI's result, which does not include the bootstrap run.

Redeploying and re-running

To start a run now, as SYSTEM, against the configured manifest:

schtasks /Run /TN "BootstrapMate Self-Heal"

To run interactively from an elevated console, with output on screen:

managedbootstrapinstall.exe --url https://example.com/bootstrap/bootstrapmate.json --verbose

To force a baseline past the throttle, create the force file before the next run; the preflight script is expected to remove it:

New-Item -ItemType File C:\ProgramData\ManagedBootstrap\.bootstrap_force

Points to know:

  • Only one run happens at a time. A second waits on the Global\BootstrapMate.SingleInstance mutex for up to 30 minutes, then exits 1.
  • The cache is emptied at the start of every run, so downloads are always fresh.
  • A provisioning run installs every item every time; idempotence is the packages' job. A baseline run skips items already in place.
  • An unelevated run with --silent, or without an interactive console, exits 3.

Reinstalling the same MSI does not upgrade, so it does not start an install-time run. Use schtasks /Run instead.

See also

Clone this wiki locally