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 (15 chapters)
14
Index

Installing only to supported versions of Windows


Once we're confident that our application works on a particular version of Windows, we may want to prevent users from installing to other unsupported operating systems. Here, we can use a launch condition. Launch conditions evaluate the state of the user's system and then cancel the installation if our requirements aren't met. By checking the operating system version, we can save the end user from trying to use our software on a system it was never intended for.

Getting ready

Create a new setup project and name it SupportedWindowsInstaller.

How to do it...

Add a launch condition that checks the VersionNT property to see what the computer's version of Windows is:

  1. Add a Condition element inside the Product element. Its Message attribute will explain that the current operating system is not supported, as follows:

    <Condition Message="Only Windows 8 and up is supported">
    </Condition>
  2. Add a conditional statement inside that element that compares...