Feature and Component Self-Repair

Written by Horatiu Prica · February 21st, 2018

Self-repair is one of the most powerful functionalities Windows Installer offers. It gives the ability to check and fix broken packages automatically, saving you valuable development time.

There are two types of self-repair: feature-level and component-level. Each of them is triggered depending on where the issue is located in your package.

How Self-Repair Works

The flow diagram shows how Windows Installer works when triggering the self-repair functionality.

Self-repair flow

Examples of entry points

  • A shortcut that launches an EXE
  • An internal component (COM) which is shared between COM applications
  • A file extension which associates a specific application type to it etc.

A feature-level repair will result in the entire feature being reinstalled, while component-level repair will only reinstall that component.

Example

In this example, we’ll consider a user that invokes an entry point associated with resource R4.

Self-repair example

Legend

Windows Installer for an entry point associated with resource R4 will follow the steps below.

  1. Checks the key paths of all components in Feature 4 (R3 and R5).
  2. Checks all key paths in each parent feature, Feature 2(R6) and Feature 1( R2)
  3. If no issues are detected, the application will open.
  4. If issues are detected, Windows Installer checks all the keys paths in the entire package.
  5. For Feature 4, a feature-level repair will be applied.
  6. If issues are found in another component, a component-level repair will be applied only to it.

Thus, by grouping your entry points under dedicated sub-features you could considerably reduce the time it takes for your application to self-repair. This is an optimization that can improve the user experience for your clients and is especially important for enterprise clients which might deploy your application to hundreds or thousands of users inside their company.

Comments: