WiX 3.6: A Developer's Guide to Windows Installer XML

WiX 3.6: A Developer's Guide to Windows Installer XML
eBook: $29.99
Formats: PDF, PacktLib, ePub and Mobi formats
save 15%!
Print + free eBook + free PacktLib access to the book: $79.98    Print cover: $49.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Table of Contents
Sample Chapters
  • Brings the reader up to speed on all of the major features of WiX, including the new bootstrapper engine, Burn
  • Provides a richer understanding of the underlying Windows Installer technology
  • Showcases the flexibility and versatility of WiX, with a few tips and tricks along the way

Book Details

Language : English
Paperback : 488 pages [ 235mm x 191mm ]
Release Date : December 2012
ISBN : 1782160426
ISBN 13 : 9781782160427
Author(s) : Nick Ramirez
Topics and Technologies : All Books, Application Development, Open Source

Table of Contents

Chapter 1: Getting Started
Chapter 2: Creating Files and Directories
Chapter 3: Putting Properties and AppSearch to Work
Chapter 4: Improving Control with Launch Conditions and Installed States
Chapter 5: Understanding the Installation Sequence
Chapter 6: Adding a User Interface
Chapter 7: Using UI Controls
Chapter 8: Tapping into Control Events
Chapter 9: Working from the Command Line
Chapter 10: Accessing the Windows Registry
Chapter 11: Controlling Windows Services
Chapter 12: Localizing Your Installer
Chapter 13: Upgrading and Patching
Chapter 14: Extending WiX
Chapter 15: Bootstrapping Prerequisites with Burn
Chapter 16: Customizing the Burn UI
  • Chapter 1: Getting Started
    • Introducing Windows Installer XML
      • What is WiX?
      • Is WiX for you?
      • Where can I get it?
      • Visual Studio package (Votive)
      • A word about GUIDs
    • Your first WiX project
      • XML declaration and Wix element
      • The Product element
      • The Package element
      • The MediaTemplate element
      • The Media element
      • The Directory element
      • The Component element
      • The File element
      • The Feature element
      • Start menu shortcuts
      • Putting it all together
    • Adding a user interface
    • Viewing the MSI database
      • Orca.exe
    • Turning logging on during installation
    • Other resources
    • Summary
    • Chapter 2: Creating Files and Directories
      • The File element
      • The DirectoryRef element
      • The ComponentGroup element
      • The Fragment element
      • Harvesting files with heat.exe
      • Copying and moving files
        • Copying files you install
        • Copying existing files
        • Moving existing files
      • Installing special-case files
        • Adding assembly files to the GAC
        • Installing a TrueType font
      • Installing 64-bit files
      • Creating an empty folder
      • Setting file permissions
      • Speeding up file installations
      • Summary
      • Chapter 3: Putting Properties and AppSearch to Work
        • Custom properties
          • Declaring and setting properties
          • Referencing properties
          • Property visibility and scope
          • Secure properties
          • Property data types
        • Predefined Windows Installer properties
          • Implied properties
          • Cited properties
        • AppSearch
          • DirectorySearch
          • FileSearch
          • ComponentSearch
          • RegistrySearch
          • IniFileSearch
        • Summary
          • Chapter 5: Understanding the Installation Sequence
            • InstallUISequence
              • UI standard actions
                • FindRelatedProducts
                • AppSearch
                • LaunchConditions
                • ValidateProductID
                • CostInitialize
                • FileCost
                • CostFinalize
                • MigrateFeatureStates
                • ExecuteAction
            • InstallExecuteSequence
              • Execute standard actions
                • InstallValidate
                • InstallInitialize
                • ProcessComponents
                • UnpublishFeatures
                • RemoveRegistryValues
                • RemoveShortcuts
                • RemoveFiles
                • InstallFiles
                • CreateShortcuts
                • WriteRegistryValues
                • RegisterUser
                • RegisterProduct
                • PublishFeatures
                • PublishProduct
                • InstallFinalize
              • Immediate versus deferred
            • Custom actions
              • Setting a Windows Installer property
              • Setting the location of an installed directory
              • Running embedded VBScript or JScript
              • Calling an external VBScript or JScript file
              • Calling a function from a dynamic-link library
              • Triggering an executable
              • Sending an error that stops the installation
            • Rollback custom actions
            • Accessing properties in a deferred action
            • Adding conditions to custom actions
            • Deployment Tools Foundation
              • The session object
              • Getting and setting properties
              • Logging
              • Showing a message box
              • Accessing feature and component states
              • Querying the MSI database
              • Inserting rows into the MSI database
            • Summary
            • Chapter 6: Adding a User Interface
              • WiX standard dialog sets
                • WixUI_Advanced
                • WixUI_FeatureTree
                • WixUI_InstallDir
                • WixUI_Mondo
                • Customizing a standard dialog set
              • Creating your own dialogs
                • ICE20 errors
                • Adding dialog files
                • The Dialog element
                • Scheduling dialogs
                • Adding TextStyle elements
                • Adding a tabbable control
                • Adding a progress dialog
              • Modal windows
              • ICE20 revisited
                • FilesInUse
                • Error
                • FatalError
                • UserExit
                • Exit
              • Summary
              • Chapter 7: Using UI Controls
                • Attributes common to all controls
                • Specific control syntax
                  • PushButton
                  • Text
                  • ScrollableText
                  • Line
                  • GroupBox
                  • Bitmap
                  • Icon
                  • Edit
                  • MaskedEdit
                  • PathEdit
                  • CheckBox
                  • RadioButtonGroup
                  • ComboBox
                  • ListBox
                  • ListView
                  • DirectoryList
                  • DirectoryCombo
                  • SelectionTree
                  • VolumeCostList
                  • VolumeSelectCombo
                  • Billboard
                  • ProgressBar
                • Summary
                • Chapter 8: Tapping into Control Events
                  • Publishing control events
                  • Subscribing to control events
                  • Publish events
                    • DoAction
                    • EndDialog
                    • NewDialog
                    • AddLocal
                    • Publishing a property
                  • Subscribe events
                    • ScriptInProgress
                    • SelectionAction
                    • TimeRemaining
                  • Summary
                  • Chapter 9: Working from the Command Line
                    • Candle.exe
                      • Response files
                      • .wixobj files
                      • Command-line arguments (compiling)
                        • -arch
                        • -d
                        • -ext
                        • -fips
                        • -I
                        • -nologo
                        • -o
                        • -p
                        • -pedantic
                        • -sfdvital
                        • -ss
                        • -sw
                        • -trace
                        • -v
                        • -wx
                    • Compile-time variables
                      • Custom compiler variables
                      • Environment variables
                      • System variables
                    • Conditional statements and iterations
                      • if...elseif...else
                      • ifdef
                      • ifndef
                      • Iterations
                      • Errors and warnings
                    • Preprocessor extensions
                    • Light.exe
                      • Command-line arguments (linking)
                        • -b
                        • -bf
                        • -binder
                        • -cultures
                        • -d
                        • -dut
                        • -ext
                        • -loc
                        • -nologo
                        • -notidy
                        • -o[ut]
                        • -pedantic
                        • -sadmin
                        • -sadv
                        • -sloc
                        • -sma
                        • -ss
                        • -sts
                        • -sui
                        • -sv
                        • -sw[N]
                        • -usf <output.xml>
                        • -v
                        • -wx[N]
                        • -xo
                      • Command-line arguments (binding)
                        • -bcgg
                        • -cc <path>
                        • -ct <N>
                        • -cub <file.cub>
                        • -dcl:level
                        • -eav
                        • -fv
                        • -ice <ICE>
                        • -pdbout <output.wixpdb>
                        • -reusecab
                        • -sa
                        • -sacl
                        • -sf
                        • -sh
                        • -sice: <ICE>
                        • -sl
                        • -spdb
                        • -sval
                    • Link-time variables
                      • Localization variables
                      • Binder variables
                      • Custom linker variables
                    • Building an installer without Visual Studio
                    • Summary
                    • Chapter 10: Accessing the Windows Registry
                      • Reading from the registry
                      • Writing to the registry
                        • Writing a single value
                        • Writing multiple values
                        • Setting NeverOverwrite
                      • Removing registry values
                        • Remove all keys recursively
                        • Removing a single value
                      • Copying registry values
                      • Registry permissions
                      • Summary
                      • Chapter 11: Controlling Windows Services
                        • Creating a simple Windows service
                        • Using sc.exe
                        • Using WiX to install a service
                        • Starting, stopping, and uninstalling a service
                        • Setting the service's user account
                        • Adding service dependencies
                        • Service recovery with Util:ServiceConfig
                        • Summary
                        • Chapter 12: Localizing Your Installer
                          • WiX localization files
                          • The role of Light.exe
                          • Setting language and code page attributes
                            • The Package element
                            • The Product element
                          • Localizing the UI
                            • Error messages
                            • Progress bar messages
                            • EULA
                            • Resizing controls
                          • Creating a multi-language MSI
                          • Summary
                          • Chapter 13: Upgrading and Patching
                            • Planning for updates
                              • Choosing an update type
                              • Per-user or per-machine
                            • Preparing a major upgrade
                            • The minor upgrade
                              • Authoring a .wixmsp file
                              • Creating a patch from .wixpdb files
                              • Creating a patch from .wixout files
                            • The small update
                            • Summary
                            • Chapter 14: Extending WiX
                              • Building a custom WiX extension
                                • Setting the stage
                                • Extending the CompilerExtension class
                                • Adding an XML schema
                                • Parsing custom elements
                                • Creating a new MSI table
                                • Extending the WixExtension class
                              • Using the extension in a WiX project
                              • Tying a custom action to the custom element
                              • Summary
                              • Chapter 15: Bootstrapping Prerequisites with Burn
                                • Using the Bootstrapper Project template
                                • Describing the Bundle element
                                • Restricting the install by the operating system
                                • UpgradeCode and detecting related bundles
                                  • Updating existing bundles
                                  • Finding other related bundles
                                  • Where the packages are cached
                                • Chaining packages
                                  • The Chain element
                                  • The MsiPackage element
                                  • The ExePackage element
                                  • The MspPackage element
                                  • The MsuPackage element
                                • Downloading packages
                                • Counting package references
                                • Rollback boundaries
                                • PackageGroups
                                • The Standard Bootstrapper UI
                                  • The RtfLicense user interface
                                  • The HyperlinkLicense user interface
                                • Summary
                                • Chapter 16: Customizing the Burn UI
                                  • Burn extension points
                                  • Creating the class library
                                  • Extending the BootstrapperApplication class
                                  • Defining the model
                                  • Implementing the viewmodel
                                    • Declaring the properties and fields
                                    • Defining the constructor
                                    • Setting up the event handlers
                                    • Helper methods
                                  • Marking up the view
                                  • Referencing the UI in a Burn bundle
                                  • Passing user input to a bundled MSI
                                  • Displaying progress
                                  • Downloading packages
                                  • Collecting command-line arguments
                                  • Summary

                                  Nick Ramirez

                                  Nick Ramirez is a software developer living in Columbus, Ohio. He believes that deployment should not be a moment of terror and has become a big fan of technologies like WiX. His other related interests include build automation, software architecture and playing Portal 2. Nick lives with his wife and two cats

                                  Sorry, we don't have any reviews for this title yet.

                                  Code Downloads

                                  Download the code and support files for this book.

                                  Submit Errata

                                  Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


                                  - 4 submitted: last submission 09 May 2013

                                  Errata Type: Code ; Page No: 219, 290, 390, 393, 403

                                  There should be a space between Wix and xmlns.

                                  For example,

                                  should be
                                  <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"


                                  Errata Type: Typo ; Front matter: About the Reviewers

                                  In the biography of Martin Oberhammer, the last sentence should be
                                  Nick and Martin were at one point colleagues and created a software installer using WiX technology.

                                  Errata Type: Code ; Page No: 59

                                  In the command stated:
                                  heat.exe dir "C:\New Folder" -dr MyProgramDir -cg NewFilesGroup -gg -g1 -sf -srd -var "var.MyDir" -out ".\HeatFile.wxs"
                                  The parameter -sf should be -sfrag


                                  Errata Type: Code ; Page No: 393, 400

                                  There should be a space between MsiPackage and SourceFile.

                                  For example,

                                  <MsiPackageSourceFile="Awesome1.msi" />
                                  should be
                                  <MsiPackage SourceFile="Awesome1.msi" />


                                  Sample chapters

                                  You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

                                  Frequently bought together

                                  WiX 3.6: A Developer's Guide to Windows Installer XML +    Building Websites with Microsoft Content Management Server =
                                  50% Off
                                  the second eBook
                                  Price for both: €25.05

                                  Buy both these recommended eBooks together and get 50% off the cheapest eBook.

                                  What you will learn from this book

                                  • Register with Add/Remove Programs and build in a consistent way to uninstall your software
                                  • Customize an easy to navigate install Wizard
                                  • Gain an understanding of the order in which events happen during an install and how to hook into this process
                                  • Learn how WiX builds and links your files into the final MSI package and how to fine tune this process
                                  • Make your project more modular with Fragments, Components, and ComponentGroups
                                  • Prevent users from installing your software on unsupported operating systems and introduce other prerequisite checks
                                  • Install, start, stop, and uninstall Windows services at the time of setup
                                  • Bootstrap required dependencies before installing your own software

                                  In Detail

                                  The cryptic science of Windows Installer can seem far off from the practical task of simply getting something installed. Luckily, we have WiX to simplify the matter. WiX is an XML markup, distributed with an open-source compiler and linker, used to produce a Windows Installer package. It is used by Microsoft and by countless other companies around the world to simplify deployments.

                                  "WiX 3.6: A Developer's Guide to Windows Installer XML" promises a friendly welcome into the world of Windows Installer. Starting off with a simple, practical example and continuing on with increasingly advanced scenarios, the reader will have a well-rounded education by book’s end.

                                  With the help of this book, you'll understand your installer better, create it in less time, and save money in the process. No one really wants to devote a lifetime to understanding how to create a hassle-free installer. Learn to build a sophisticated deployment solution targeting the Windows platform in no time with this hands-on practical guide. Here we speed you through the basics and zoom right into the advanced. You'll get comfortable with components, features, conditions and actions. By the end, you’ll be boasting your latest deployment victories at the local pub.

                                  Once you've finished "WiX 3.6: A Developer's Guide to Windows Installer XML", you'll realize just how powerful and awesome an installer can really be.


                                  A step-by-step tutorial with plenty of code and examples to improve your learning curve.

                                  Who this book is for

                                  If you are a developer and want to create installers for software targeting the Windows platform, then this book is for you. You’ll be using plenty of XML and ought to know the basics of writing a well-formed document. No prior experience in WiX or Windows Installer is assumed. You should know your way around Visual Studio to compile projects, add project references and tweak project properties.

                                  Code Download and Errata
                                  Packt Anytime, Anywhere
                                  Register Books
                                  Print Upgrades
                                  eBook Downloads
                                  Video Support
                                  Contact Us
                                  Awards Voting Nominations Previous Winners
                                  Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
                                  Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software