Book Image

WiX Cookbook

By : Nicholas Matthew Ramirez
1 (1)
Book Image

WiX Cookbook

1 (1)
By: Nicholas Matthew Ramirez

Overview of this book

Table of Contents (20 chapters)
WiX Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Passing information entered by a user to a deferred custom action


When the end user provides information to the installer, either through a user interface or the command line, we typically store it in WiX properties so that it can be used later during InstallExecuteSequence. However, we cannot pass these properties directly to a custom action that is scheduled as deferred during InstallExecuteSequence. If you try, you'll get the following error in the install log:

Microsoft.Deployment.WindowsInstaller.InstallerException: Cannot access session details from a non-immediate custom action

This is because deferred actions have a heightened level of security and only allow a few properties to be accessed. In this recipe, we will discuss a way to pass our own properties to a deferred custom action.

Getting ready

To prepare for this recipe, perform the following steps:

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

  2. Add a text file to the project called Sample.txt and include it in the...