WiX Cookbook

Over 60 hands-on recipes packed with tips and tricks to boost your Windows installations

WiX Cookbook

Cookbook
Nick Ramirez

2 customer reviews
Over 60 hands-on recipes packed with tips and tricks to boost your Windows installations
$26.99
$44.99
RRP $26.99
RRP $44.99
eBook
Print + eBook

Instantly access this course right now and get the skills you need in 2017

With unlimited access to a constantly growing library of over 4,000 eBooks and Videos, a subscription to Mapt gives you everything you need to learn new skills. Cancel anytime.

Free Sample

Book Details

ISBN 139781784393212
Paperback260 pages

Book Description

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

Chapter 1: Organizing and Building WiX Projects
Introduction
Installing WiX and creating a new project in Visual Studio 2013
Referencing the output of a .NET console application in a WiX project by using a preprocessor variable
Separating a portion of WIX markup into its own library
Compiling a WiX installer on a build machine using MSBuild
Building a WiX installer from the command line
Chapter 2: Installing Files and Directories
Introduction
Installing directories onto the target computer
Adding a file to a directory
Installing a 64-bit executable file to Program Files
Including one component or another depending on the condition
Using the heat.exe tool to generate components
Chapter 3: File and Folder Permissions
Introduction
Changing the permissions on a folder for a user
Changing the permissions on a file for a user
Marking a file as read only
Creating a file share
Setting the default program for a file type
Chapter 4: Shortcuts
Introduction
Adding an application shortcut to the Start menu
Adding an icon to a shortcut
Placing a shortcut on the desktop
Creating a shortcut to a folder
Creating an advertised shortcut that installs a feature on demand
Chapter 5: Editing XML Files during Installation
Introduction
Adding a new element to an XML file during installation
Setting the value of an attribute on an XML element
Inserting inner text into an XML element
Adding an XML element only if it does not already exist
Removing an XML element
Chapter 6: Custom Actions
Introduction
Creating a C# custom action and referencing it in your project
Passing information entered by a user to a deferred custom action
Preventing custom action data from being displayed in the install log
Running an executable as a custom action without showing a console window by using CAQuietExec
Testing rollback custom actions with WixFailWhenDeferred
Chapter 7: Installing Wizards
Introduction
Adding a wizard to guide users through the installation
Changing the logo images and default license agreement text of the wizard
Customizing the wizard by adding a new dialog window to it
Deciding which dialog to show next depending on the user's choices
Setting a property based on user input
Chapter 8: Users and Groups
Introduction
Creating a local user
Adding a new user to a new group
Adding a new user to an existing group
Adding an existing user to a new group
Adding a new user with the log on as a service security setting
Chapter 9: Handling Prerequisites
Introduction
Stopping the installation with a launch condition
Installing only to supported versions of Windows
Redistributing the .NET Framework with a bootstrapper
Executing either a 64-bit or 32-bit MSI depending on the user's operating system
Downloading resources from the Web with a web installer
Chapter 10: Installing Websites
Introduction
Spinning up a new application pool in IIS
Adding a website to IIS that runs under your app pool
Creating a virtual directory
Adding a web application to IIS
Setting up a website to use SSL
Chapter 11: Linking to the Web
Introduction
Adding a hyperlink control to a wizard dialog
Opening an installed HTML file after a successful installation
Launching a web page when a user uninstalls our software
Installing a shortcut that opens a web page
Updating programs and features to show a link to our company's website
Chapter 12: Installing SQL Server Databases
Introduction
Installing a SQL Server instance with a bootstrapper
Adding a database to a SQL Server instance
Creating a table within a SQL Server database
Inserting data into a database table
Creating an ODBC data source for a SQL Server instance
Chapter 13: Admin Tasks
Introduction
Setting an environment variable
Creating a scheduled task
Defining a new event source for the Windows event viewer
Registering a performance counter
Adding an exception to Windows Firewall

What You Will Learn

  • Install websites, application pools, and virtual directories in IIS
  • Add a wizard to your installer and customize it with your own dialogs
  • Set up new user accounts, add security groups, and secure files and folders on installation
  • Prevent deployment to unsupported systems by using launch conditions
  • Update XML files during installation
  • Configure shortcuts to your application
  • Include prerequisites with a bootstrapper
  • Create custom actions using C#
  • Add environment variables to the system

Authors

Table of Contents

Chapter 1: Organizing and Building WiX Projects
Introduction
Installing WiX and creating a new project in Visual Studio 2013
Referencing the output of a .NET console application in a WiX project by using a preprocessor variable
Separating a portion of WIX markup into its own library
Compiling a WiX installer on a build machine using MSBuild
Building a WiX installer from the command line
Chapter 2: Installing Files and Directories
Introduction
Installing directories onto the target computer
Adding a file to a directory
Installing a 64-bit executable file to Program Files
Including one component or another depending on the condition
Using the heat.exe tool to generate components
Chapter 3: File and Folder Permissions
Introduction
Changing the permissions on a folder for a user
Changing the permissions on a file for a user
Marking a file as read only
Creating a file share
Setting the default program for a file type
Chapter 4: Shortcuts
Introduction
Adding an application shortcut to the Start menu
Adding an icon to a shortcut
Placing a shortcut on the desktop
Creating a shortcut to a folder
Creating an advertised shortcut that installs a feature on demand
Chapter 5: Editing XML Files during Installation
Introduction
Adding a new element to an XML file during installation
Setting the value of an attribute on an XML element
Inserting inner text into an XML element
Adding an XML element only if it does not already exist
Removing an XML element
Chapter 6: Custom Actions
Introduction
Creating a C# custom action and referencing it in your project
Passing information entered by a user to a deferred custom action
Preventing custom action data from being displayed in the install log
Running an executable as a custom action without showing a console window by using CAQuietExec
Testing rollback custom actions with WixFailWhenDeferred
Chapter 7: Installing Wizards
Introduction
Adding a wizard to guide users through the installation
Changing the logo images and default license agreement text of the wizard
Customizing the wizard by adding a new dialog window to it
Deciding which dialog to show next depending on the user's choices
Setting a property based on user input
Chapter 8: Users and Groups
Introduction
Creating a local user
Adding a new user to a new group
Adding a new user to an existing group
Adding an existing user to a new group
Adding a new user with the log on as a service security setting
Chapter 9: Handling Prerequisites
Introduction
Stopping the installation with a launch condition
Installing only to supported versions of Windows
Redistributing the .NET Framework with a bootstrapper
Executing either a 64-bit or 32-bit MSI depending on the user's operating system
Downloading resources from the Web with a web installer
Chapter 10: Installing Websites
Introduction
Spinning up a new application pool in IIS
Adding a website to IIS that runs under your app pool
Creating a virtual directory
Adding a web application to IIS
Setting up a website to use SSL
Chapter 11: Linking to the Web
Introduction
Adding a hyperlink control to a wizard dialog
Opening an installed HTML file after a successful installation
Launching a web page when a user uninstalls our software
Installing a shortcut that opens a web page
Updating programs and features to show a link to our company's website
Chapter 12: Installing SQL Server Databases
Introduction
Installing a SQL Server instance with a bootstrapper
Adding a database to a SQL Server instance
Creating a table within a SQL Server database
Inserting data into a database table
Creating an ODBC data source for a SQL Server instance
Chapter 13: Admin Tasks
Introduction
Setting an environment variable
Creating a scheduled task
Defining a new event source for the Windows event viewer
Registering a performance counter
Adding an exception to Windows Firewall

Book Details

ISBN 139781784393212
Paperback260 pages
Read More
From 2 reviews

Read More Reviews