You are previewing WiX 3.6: A Developer's Guide to Windows Installer XML.
O'Reilly logo
WiX 3.6: A Developer's Guide to Windows Installer XML

Book Description

If you’re a developer needing to create installers for Microsoft Windows, then this book is essential. It’s a step-by-step tutorial that teaches you all you need to know WiX 3.6: the professional way to produce a Windows installer package.

  • 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

  • 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.

    Table of Contents

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