WiX - Windows Installer XML
· WIX: Windows Installer XML
· Free software toolset
· XML code structure
· Supports command-line interface to be integrated into any automated application build process or CI environment.
· Developed by Microsoft, using this to develop installation packages for all their major products, including Office and Visual Studio
Bundle
· Bundles are often used to install prerequisites, such as the .NET Framework or C++ Run Time
· Bundles also allow very large applications to be broken into smaller, logical installation packages that are chained together while still presenting a single product to the end-user.
WiX Component
The Windows Installer expects every file to be wrapped up in a component before it’s installed.
<Component …> <File Id=“… /> </Component> |
WiX Fragment
A fragment element is an atomic unit container that functions as a wrapper put around a WiX source unit. A fragment can be linked to other product installation packages.
<Fragment …> <Component> <…> </Component> </Component> |
WiX Library
A file (.wixlib extension) is a library of setup functionality that can be easily shared across different WiX-based packages by including it when linking the setup package.
What is a BootStrapper?
§ In our project, there are so many things that we need to install before our software will be installed.
§ At that time, we can use this to bundle the prerequisites (like .Net Framework, SQL, the installation location, and checking for space, etc.) of the Software.
§ It can also be used to combine several .msi into a single logical unit, so it is easy to manage
What is the standard WiX workflow?
Tools: - There are many tools, 2 important for creating .msi are:
Candle:
Pre-processes and compiles WiX source files (.wxs) into object files (.wixobj)
candle.exe DragIT.wxs
Light: -
Links and binds one or more .wixobj files and creates a .msi or .msm
Light.exe -out DragIT.msi DragIT.wixobj
|
- The product has one or more Features
- Features have one or more components and/or sub-features
- Components have one or more files, registry entries, environment variables, shortcuts, etc.
Components: -
- Contain resources like Files, registry keys, shortcuts, etc.
- Have Id and GUID.
- ID -> uniquely identifies an element within the installation and is used to refer to the element in other places.
- GUID -> unique identification on target systems
- One child under Component’s mush has KeyPath = “yes”. Bec. It’s used to verify if the component is installed or not.
Component Groups: - Collect related components together.
Features: -
- Gives users to select which parts they want to install.
- All installations have at least one feature.
Fragments: -
- Used to delimit sections of WiX code that can be referred to elsewhere by ID
- Code organization, code re-use
- Maybe in different source files such as (*.wxs) -> Source files and (*.wxi) -> Include files
Media and Packaging options: -
- Determine output format (media splitting, etc): - Is it an MSI file, is it enough to go on a 1.4MB floppy disk or 650 MB CD, or does it just create one huge file as big as it needs to be. Does it break it into files that have a 50 MB max and then it creates another one and so on?
- EmbedCab = “yes” to embed CAB file inside MSI file: - The CAB file is like a zip file it contains all the actual files and then there’s the MSI. If “yes” then it winds up all the files inside the MSI.
Supporting Upgrades: -
Factors determining if an upgrade is possible: -
- Version string,
- Product ID GUID: Identifies the specific version of the product
- Upgrade code GUID: Relates multiple versions together
Installing Files: -
- Files live in components
- Components refer to a location
- The best practice is one file per component
- KeyPath identifies the file used to detect if the component is installed.
Debugging Tips: - Download Orca from the Windows SDK
WiX Sample UI Options: -
- WixUI_Minimal
- WixUI_InstallDir
- WixUI_FeatureTree
- WixUI_Mondo
- WixUI_Advanced
Creating Shortcuts: -
Digitally Signing Installations: -
Windows strongly discourages users from executing unsigned products.
- We won’t’s see that behavior in our development system.
Installations should be digitally signed
- Microsoft Authenticode code-signing certificate obtained from a CA
- Self-generated certificate OK for internal use only.
WiX In Pipelines
To create a setup of an application:
Stay Safe!
Thank you. 😃