Automatic account creation is now enabled. Captcha authentication required for account creation and editing unless you are trusted here.

Installation prerequisites

From WiX Wiki at MindCapers

Jump to: navigation, search

Many installations have dependencies (such as runtime components) which must be present for the application to operate correctly.

Prerequisites packaged in MSI files must be installed using a bootstrapper. However, since it is also possible that an advanced user may directly trigger installation from the MSI it is strongly recommended that the application's MSI file also contains conditions to ensure that the prerequisites have been met.

Typically, prerequisites should be handled as a Launch Condition. A property should be set during the AppSearch phase, which is then checked during the LaunchConditions phase.

Registry Prerequisite

The following is a sample of a registry based prerequisite (expressed as a WiX V2 fragment). It tests for the presence of the Crystal Reports XI R2 runtime by checking the contents of the
HKEY_LOCAL_MACHINE\Software\Business Objects\Suite 11.5\Crystal Reports\CommonFiles
registry key, and setting the
CRYSTALRUNTIMEINSTALLED
property to a value other than the default.
 
 <?xml version="1.0" encoding="utf-8"?>
 &lt;Wix <nowiki>xmlns="http://schemas.microsoft.com/wix/2003/01/wi"&gt;</nowiki>
 	&lt;!-- NOTE: This fragment only checks for the presence of the Crystal Reports runtime. The
 		 runtime itself should be installed by the bootstrapper. --&gt;
 	&lt;Fragment Id="CrystalRuntime"&gt;
 		&lt;Condition Message="This application requires the Crystal Reports XI R2 runtime."&gt;
 			Not CRYSTALRUNTIMEINSTALLED = "NotInstalled"
 		&lt;/Condition&gt;
 		&lt;Property Id="CRYSTALRUNTIMEINSTALLED" Value="NotInstalled"&gt;
 			&lt;RegistrySearch Id="_DD88B6BE_8DDE_4EFF_83EC_DD6F3757E3E7"
 				Key="Software\Business Objects\Suite 11.5\Crystal Reports"
 				Name="CommonFiles" Root="HKLM" Type="raw" /&gt;
 		&lt;/Property&gt;
 	&lt;/Fragment&gt;
 &lt;/Wix&gt;
 

Note: Business Objects seem reluctant to provide a recommended mechanism to detect a specific version of the Crystal Reports runtime. The code above is just something that worked for me! If you encounter a "correct" resource to test against, please update this example!

File Prerequisite

Alternatives

An alternate mechanism to including the prerequisite checks in both the bootstrapper and the MSI file is to add a launch condition for the MSI based on a property passed from the bootstrapper. If the property is not set to the appropriate value, the installation will terminate with a message indicating that the bootstrapper must be used. It should be noted that this does not provide complete protection, since a suitably motivated user (or more likely system administrator) could use Orca or a similar tool to determine which property needs to be set.

Personal tools