Bootstrapper property VersionMSI

Today I would like to talk about a predefined Bootstrapper property, VersionMSI.  The VersionMSI property contains the current, installed version of Windows Installer.  (Even if you just upgraded.)  This property is not saved in any way and is obtained 'fresh' every time it is used.

The value is obtained as follows:

  1. Open the registry key HKLM\Software\Microsoft\Windows\CurrentVersion\Installer
  2. Get the directory name where the current version of Windows Installer is from the InstallerLocation key
  3. Verify that the file msi.dll exists in that folder
  4. Open the DLL and return its file version

If you look at the package.xml manifest for the .Net Framework you will notice that the Windows Installer dependency is declared using this property.