Book Image

WiX Cookbook

By : Nicholas Matthew Ramirez
1 (1)
Book Image

WiX Cookbook

1 (1)
By: Nicholas Matthew Ramirez

Overview of this book

WiX is a dialect of XML used to make installers for Windows. Its declarative style avoids the complexity and limitations of procedural code, providing you with everything you need to package up an entire application into a single MSI file. This book gives you a good overview of WiX's capabilities to develop your own installer packages with functionalities beyond those available in Windows Installer. In the recipes of this book, you will see ways in which WiX can cut down on your installation time and help you streamline your deployment processes. You will see how to make customized installer UIs, write custom actions, create shortcuts, and also set your application as the default for a file type.
Table of Contents (20 chapters)
WiX Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Stopping the installation with a launch condition


A launch condition checks the user's computer to make sure that it can support our software. If it can't, the installation is automatically stopped before the user can go any further. For example, we may want to prevent the installation if the user doesn't have the necessary version of .NET installed. In this recipe, we'll do just that by adding a condition that checks for .NET Framework 4.5.

Windows 8 comes with .NET 4.5 preinstalled, but Windows 7 doesn't. We can use NetFxExtension to check whether .NET 4.5 is preinstalled, and if it's missing, a message is displayed telling the user that the installation cannot continue. A nice thing about launch conditions is the ability to show the user a warning message explaining what went wrong.

Getting ready

To get started, perform the following steps:

  1. Create a new setup project and name it LaunchConditionInstaller.

  2. Add a reference to NetFxExtension by right-clicking on the References node in Solution...