The sale of any business is closely dependent on how you develop a website for your users. A good website has the potential to attract customers, give a full overview of what the business is capable to offer, and drive them to give opportunities and improve business profitability.
Table of Content
Windows Installer XML (aka WiX Toolset) is a free toolset that can build components of a website using a windows installer package from XML code. It is simply defined through XML. Wix provides a platform for web development with multiple features and easy-to-use syntax to write and run codes without any complex tools.
WiX toolset is one of the build tools supported on all windows-based systems to create your windows installation with a wide spectrum of WIX tools features. You can easily install any small project very quickly to large projects. This platform is an open-source platform initiated by Rob Mensching.
The Wix toolset provides a command-line environment to integrate makefile in order to build processes using conventional methods. New methods such as Microsoft technology to integrate development environments like Microsoft Visual Studio or SharpDevelop are used to set up packages (MSI and MSM merge modules).
WiX includes several extensions with supply functionality that is beyond the control of Windows Installer. For example, WiX can install IIS websites, registry to be created, installed drivers and services that need to be started, create SQL Server databases, files to be copied and register exceptions within the Windows Firewall, etc.
Using Burn, Wix can create a setup bundle that installs prerequisites that are required for its own product like .Net framework, SQL server, driver, etc. Burn allows users to download a package or combine packages into a single downloadable .exe.
1. What are the Features of the Wix Toolset?
- Wix is a free and open-source platform for website building
- Wix supports the installation of packages in multiple languages
- It prevents you from installing the same product multiple times.
- It checks and prevents installing the 32-bit version package on a 64-bit OS and vice versa.
- Wix supports both in-house and third-party development.
- It is possible to integrate with third-party apps and develop newer products
- Wix has unrestricted access to Windows Installer functionality
- Designed to easily develop and use using Wix
- Wix can perform complete integration into an application to build processes
Some of the limitations of the Wix toolset :
- There is no facility of drag-and-drop in Wix
- MSI installer is not a simple package manager.
- It is complex to use and an initial learning curve is involved to get used to it.
- There is no automatic dependency or inclusion
- WixToolset does not build bootstrappers (setup.exe)
- Software versions are limited to only three parts (major.minor.build) in the Wix SDK file.
WiX is a matured application with a build system that can be installed and implemented for complex applications with a large number of files to be deployed. Also, most of the organization use WiX to install their major windows installer packages.
2. How Does Wix Toolset Work?
In WiX, the source code is in XML language which is compiled and managed using the models so as to execute overall codes in unique models.
Wix has an extension of the file ending with .wxs:
When you make a website with Wix source code and files to test the core Wix schema, you’ll need to use a preprocessor, parser, and linker to get the final performance. When you gather all the features of the Wix toolset, you can develop unique outputs and their types.
3. Wix System Requirements
Various versions of the .NET framework are supported by Wix from versions ranging from .Net 3.5 and above. For Wix version 3.5, you would require a version of .NET 4.0 or more. Wix MSBuild is compatible with .NET 3.5 and Windows 2012 and the newer versions are not installed as default. It does not allow any other windows installer.
To install .NET 3.5, follow the below steps:
- Go to the Control Panel
- Open Program and features
- Select Turn Windows feature ON or OFF from the list
- Select .NET Framework 3.5 and click on OK
4. Build Process of Wix Toolset
- .wxs is XML document that contain only one root element <wix/> with the following elements as children: <Product>, <Module>, and <Patch>
- .wxi file is similar to C++ header files with .h extensions. The prime element is <Include> and everything should be added under the root element using Wix toolset.
- There is an object file created by the compiler with extension .wix.obj with other source files in the process. It is an XML document that follows the objects.xsd schema defined within the WiX project.
- .wixlib is a collection of .wixobj. It contains a library of setup functions that is easily shared across different Wix-based packages and it also includes setup packages for linking.
- The Candle preprocessor executes the compilation command by accumulating all source files of Wix and converts them into .wixobj (object) files.
- The Light (light.exe) seamlessly connects and binds .wixobj files utilizing Windows installer with extension .msi or .msm.
- Object files of .wixobj files are interlinked to build Windows installer with extensions .msi and .msm.
- Among all Windows-based installation packages, .msi is the smallest unit of installation from the tools available to create.
5. Wix Installation Phase of Wix Toolset
Most of the businesses might consider the Wix installer similar to that of the Windows installer, but no that is not true. Undoubtedly, windows have a fixed set of tools available that offer a windows installation experience. Wix toolset comes with its unique setup bundles and a completely different f powerful set of tools compared to the tools that build windows using Windows installer. Here are the pro tips on how Wix can be installed.
- Immediate custom action applies to the sequence table and also controls the DoAction events.
- ExecuteAction launches the execute sequence as a subprocedure.
- Execute sequence processed in two phases between InstallInitialize and InstallFinalize:
- In the first phase, installers go through all standard and custom actions and note them down into an installation script then actually executes the commands through the script.
- In the second phase, the target computer is modified, e.g. copied files, registry entries are written, run as LocalSystem users, etc.
- Immediate custom action actually executes while the installer builds the script and other actions to be noted in the script.
- As soon as the script is developed, the installer is initiated to implement scripts keeping in mind all standard actions that need to be performed.
- Abiding by all standard actions to be performed, there are some certain rules that need to be executed using the Rollback script and rollback command.
- For a case, when the installation is terminated then the script is programmed to initiate the rollback script which will undo the changes executed in the targeted device.
- The rollback script and all backup files are removed if the installer completed the update script without any interruptions.
- We need to commit actions that need to be added in the script and the script was created with an if condition which takes time in the installation screen.
- Suppose if the installation is complete without any hassle then the command “InstallFinalize” will be executed to end the overall function using a single command. There are other command-line build tools also available with setup bundles, build concepts that manage security releases, and cater to all feature requests of the web sites.
6. Important Rules to be Noticed
- Since immediate custom behavior cannot be reversed, they do not change the goal scheme. Only improvements can be made during the installation process such as setting paths and resources, selecting features, verifying passwords, and so on.
- There is a reaction to every action which means every deferred custom action will have a rollback custom action.
- With a set of tools available, there are options for customization along with a rollback script which can delay the action associated with that specific script. This makes sure the rollback is properly executed and installation is aborted during the custom action. This will further enhance your installation experience.
- The custom actions only are placed between InstallInitialize and InstallFinalize from the installation packages. For e.g. Deferred, Commit and rollback action.
- There is not any rollback performed if the setup is aborted during the user interface sequence before the InstallInitialize or after InstallFinalize.
- For instance, if the user has unchecked the rollback option so the custom option will not be executed lately.
7. Create a Sample Demo Setup of Wix Toolset in Visual Studio
First of all, create the c# windows form application:
- Start the Visual Studio application to add the latest features by choosing the New project Option from Visual C# in the tree named Project Types. After this select the Windows Forms application.
- Then give the application a name for example “FirstDemoApplication” and press OK.
- Add a new Project by selecting the Project Type tree from the windows installers XML and then click on the project to build a new installer for the application.
- Name your project as “FirstDemoSetup” and press OK.
- You can easily add references using right-click on each reference that needs to be added.
- In the Visual Studio, Go to the Projects tab then click on the FirstDemoApplication project, click on the Add button, then press OK.
- Finally, you will see the following comment appearing on the screen in the Visual studio box
“<!– TODO: Insert your files, registry keys, and other resources here. –>”
Delete the comment and add the below line:
“<File Source=”$(var.MyApplication.TargetPath)” />”
- Build the Wix Project and you can install and uninstall the application.
1. Tips & Notes
Find the few tips that will help to avoid common deployment problems:
2. Configuring IIS
To create a web setup deployment project using visual studio, first, you will have to turn on “Windows IIS Metabase and IIS 6 configuration compatibility”. If it is not logged in as an Administrator then unable to run setup.exe to install the project.
For more information, please see Microsoft technical documentation.
To ensure that your application will be installed and run successfully, you have to make sure that all components that are dependent on the application are installed on the target computer itself. For e.g. the .NET Framework; the applicable version of the CLR must be present on the destination computer before the application is set to install.
To install the component as part of your installation like .NET Framework and other redistributables then select prerequisites in the Prerequisites dialog box from the Prerequisites property of the setup project.
|Install prerequisite to creating the setup of Wix toolset||Includes the prerequisite component in your application. So it will be installed as a dependency before your application. By default, this option is selected. Without that, not setup.exe is created.|
|Pick the prerequisites to install||For instance, It specifies whether to install the components or not. For example, by selecting the Microsoft .Net framework 4.5 checkbox, you are validating that the component is installed on the target machine and installed if it’s not already installed.|
|Get installed all the prerequisites from clients website||This notifies all the prerequisites that are needed from clients’ websites to download and install.|
|Understand and download the needs from the same clients’ location||This part notifies that the components needed are from the same clients’ location for setting up the application. Make a copy of all packages that need to be copied for developers of computers.|
|Final downloading of requirements from required clients’ locations.||This part notifies all the needs and components that need to be installed for users to browse through the Wix toolset.|
Wix is one of the most powerful and promising build tools with multiple features and a Wixtoolset that creates windows installation and enhances user experience. It successfully installs all the applications without any hassle and lengthy source code to be remembered. Businesses can easily take advantage of all the features of Wix and create their own customized website effortlessly. Our developers can help your business derive long-term profitability using WiX toolset
Vishal Shah has an extensive understanding of multiple application development frameworks and holds an upper hand with newer trends in order to strive and thrive in the dynamic market. He has nurtured his managerial growth in both technical and business aspects and gives his expertise through his blog posts.
Web Development Service
Know more about our Web Development ServiceLearn More
Subscribe to our Newsletter
Signup for our newsletter and join 2700+ global business executives and technology experts to receive handpicked industry insights and latest news
Build your Team
Want to Hire Skilled Developers?