The Windows Installer XML linker is exposed by light.exe. Light is responsible for processing one or more .wixobj files, retrieving metadata from various external files and creating a Windows Installer database (MSI or MSM). When necessary, light will also create cabinets and embed streams in the created Windows Installer database.
The linker begins by searching the set of object files provided on the command line to find the entry section. If more than one entry section is found, light fails with an error. This failure is necessary because the entry section defines what type of Windows Installer database is being created, a MSI or MSM. It is not possible to create two databases from a single link operation.
While the linker was determining the entry section, the symbols defined in each object file are stored in a symbol table. After the entry section is found, the linker attempts to resolve all of the references in the section by finding symbols in the symbol table. When a symbol is found in a different section, the linker recursively attempts to resolve references in the new section. This process of gathering the sections necessary to resolve all of the references continues until all references are satisfied. If a symbol cannot be found in any of the provided object files, the linker aborts processing with an error indicating the undefined symbol.
After all of the sections have been found, complex and reverse references are processed. This processing is where Components and Merge Modules are hooked to their parent Features or, in the case of Merge Modules, Components are added to the ModuleComponents table. The reverse reference processing adds the appropriate Feature identifier to the necessary fields for elements like, Shortcut, Class, and TypeLib.
Once all of the references are resolved, the linker processes all of the rows retrieving the language, version, and hash for referenced files, calculating the media layout, and including the necessary standard actions to ensure a successful installation sequence. This part of the processing typically ends up generating additional rows that get added associated with the entry section to ensure they are included in the final Windows Installer database.
Finally, light works through the mechanics of generating IDT files and importing them into the Windows Installer database. After the database is fully created, the final post processing is done to merge in any Merge Modules and create a cabinet if necessary. The result is a fully functional Windows Installer database.
light.exe [-?] [-b basePath] [-nologo] [-out outputFile] objectFile [objectFile ...] [@responseFile]
Light supports the following command line parameters:
Allow identical rows; identical rows will be treated as a warning.
Allow unresolved references; this will cause invalid output to be created.
Specify a base path to locate all files; the default value is the current working directory.
Use backwards compatible guid generation algorithm (rarely needed).
Bind files into a wixout; this switch is only valid when also providing the -xo option.
Specify a specific custom binder to use provided by an extension.
Specify a path to cache built cabinet files; the path will not be deleted after linking.
Specify the number of threads to use when creating cabinets; the default is the %NUMBER_OF_PROCESSORS% environment variable.
Specifies a semicolon or comma delimited list of localized string cultures to load from .wxl files and libraries. Precedence of cultures is from left to right. For more information see Specifying cultures to build.
Provide a .cub file containing additional internal consistency evaluators (ICEs) to run.
Define a WiX variable.
Set the default cabinet compression level. Possible values are low, medium, high, none, and mszip (default).
Drop unreal tables from the output image.
Exact assembly versions. If this option is not specified, the assembly version is padded with zeros in certain cases to work around a bug that exists in the initial release of the .NET Framework 1.1. This bug was subsequently fixed in the .NET Framework 1.1 SP1. Use this option if you require non-padded assembly versions in the MsiAssemblyName table (or in relevant bind variables), and do not mind if your MSI is incompatible with the initial release of the .NET Framework 1.1. For more information, seethis blog post.
Note that when using this option, your setup will still be compatible with the .NET Framework 1.0 RTM, .NET Framework 1.1 SP1, .NET Framework 2.0, and later versions of the .NET Framework.
This property is available starting with WiX v3.5.
Specify an extension assembly.
Add a FileVersion attribute to each assembly in the MsiAssemblyName table (rarely needed).
Specify a specific internal consistency evaluator (ICE) to run.
Provide a .wxl file to read localization strings from.
Skip printing Light logo information.
Prevent Light from deleting temporary files after linking is complete (useful for debugging).
Optimize smart cabbing for smallest cabinets (deprecated).
Optimize smart cabbing for faster install time (deprecated).
Specify an output file; by default, Light will write to the current working directory.
Save the wixpdb to a specific file. The default is the same name as the output with the wixpdb extension.
Display pedantic output messages.
Reuse cabinets from the cabinet cache instead of rebuilding cabinets.
Suppress assemblies: do not get assembly name information for assemblies.
Suppress resetting ACLs (useful when laying out an image to a network share).
Suppress adding default Admin sequence actions.
Suppress adding default Advt sequence actions.
Suppress running internal consistency evaluators (ICEs) with specific IDs.
Suppress processing the data in the MsiAssembly table.
Suppress files: do not get any file information; this switch is equivalent to the combination of the -sa and -sh switches.
Suppress file information: do not get hash, version, language and other file properties.
Suppress layout creation.
Suppress outputting the wixpdb.
Suppress schema validation for documents; this switch provides a performance boost during linking.
Suppress tagging sectionId attribute on rows.
Suppress adding default UI sequence actions.
Suppress intermediate file version mismatch checking.
Suppress MSI/MSM validation.
Suppress warnings with specific message IDs.
Suppress all warnings (deprecated).
Specify an unreferenced symbols file.
Generate verbose output.
Treat warnings as errors.
Treat all warnings as errors (deprecated).
Generate XML output instead of an MSI.
Display Light help information.
Standard Binder Variables
Some properties are not available until the linker is about to generate, or bind, the final output. These variables are called binder variables and supported binder variables are listed below.
All Versioned Files
The following standard binder variables are available for all versioned binaries.
The following standard binder variables are available for all managed and native assemblies (except where noted), where the File/@Assembly attribute is set to ".net" or "win32".
MyAssembly, version=184.108.40.206, culture=neutral, publicKeyToken=0123456789ABCDEF, processorArchitecture=MSIL
Note: The publicKeyToken value is uppercased.
MyAssembly, version=220.127.116.11, culture=neutral, publicKeyToken=0123456789abcdef, processorArchitecture=MSIL
Note: The publicKeyToken value's casing is preserved.
Note: The value is uppercased for managed assemblies.
Note: The value's casing is preserved.
You can also reference property values from the Property table at bind time; however, you cannot reference properties as binder variables within other properties, including the attributes on the Product element - many of which are compiled into the Property table. You can reference other binder variables like file information above in properties, or even localization and custom binder variables documented below.
Specializations for each field of the ProductVersion property are also provided as shown below. If you have defined properties like ProductVersion.Major in your package authoring they will not be overwritten, but will be used instead of the automatic binder variables with the same name.
You can reference the following properties from packages in your bundle. This allows developers to use property values already defined in their packages to set attributes in their bundle.
Description of My Product
Variables can be passed in before binding the output file from a WiX localization file, or .wxl file. This process allows the developer to link one or more .wixobj files together with diferent .wxl files to produce different localized packages.
Localization variables are in the following format:
Custom Binder Variables
You can create your own binder variables using the WixVariable element or by simply typing your own variable name in the following format:
Custom binder variables allow you to use the same .wixobj files but specify different values when linking, similar to how localization variables are used. You might use binder variables for different builds, like varying the target processor architecture.