Click here to Skip to main content
Click here to Skip to main content

Customizing the WIX Installer

, 25 Apr 2013
Rate this:
Please Sign up or sign in to vote.
Quick and easy way of customizing the WIX Installer

Introduction

This article will help you understand in how to customize the WIX Installer by using a third party tool WixEdit, which provides an interface to .WXS file. You may add background images to dialog boxes and replace the traditional windows buttons with image buttons etc... 

Background 

Sometime back, I was asked to build a WIX installer for one of the utility which was built on MS Visual Studio .NET. I ended up doing the following research with the help of google and couple of WIX related articles on CodeProject itself.  Hope this article will help someone who is looking for a quick guidance using which she can easily create a customized WIX Installer. I have attached a sample WIX installer project source code for the reference. In this project, I've modified only welcome page background image along with the navigation buttons .  

Pre-Requisites 

 

Steps 

Wix Edit Tool – Creating the .WXS file using the .MSI file of the respective application.

1. Create the MSI file of the utility for which WIX installer needs to be developed using Windows Installer XML Toolset.
2. Start Wix Edit Tool and open the MSI file created in STEP 1.
3. As soon as you open the MSI, the Wix Edit tool generates the .WXS and respective binary files needed to build the WIX installer as shown below –  

4. The binary files are structured into following sub-directories:

  • /Binary
  • /File
  • /Icon 
5. Additionally, you may use this tool to modify or customize the dialog background images, fonts, button images, text etc.
6. Once you are done with the changes to all the respective forms/ dialogs, you may save the .WXS file. 
 

Creating WIX Installer Project using Microsoft Visual Studio

1. Create a new WIX Installer project using MS Visual Studio 2010 as shown below –  

2. After creating the project, by default a product.wxs file is generated. You may go ahead and delete this file.
3. Add the references to following .DLL files

  • WixUIExtension (C:\Program Files (x86)\Windows Installer XML v3.5\bin\\WixUIExtension.dll)
  • WixUtilExtension (C:\Program Files (x86)\Windows Installer XML v3.5\bin\\WixUtilExtension.dll) 
4. Now, copy the binary files created using Wix Edit Tool along with the .WXS file as shown below.
5. Also, please fix the reference paths to files under \Binary, \Icon and \File directories. (highlighted in below screenshot) 

6. You may also modify the .WXS file to customize the fonts, text or dialog background images as shown in below screenshots.

7. Locate and modify the following section for font changes

 

8. Now the most important customization you might be looking for is how you can add/ change background images to dialog forms and buttons. You may add couple of XML tags to achieve the same as below:

<Property Id="DialogBitmap">dlgbmp</Property>
<Binary Id="dlgbmp" src="InstallerFiles/Images/bg_utility.BMP" />

Place the respective bg_utility.BMP file under /InstallerFiles/Images/ directory. For simplicity, I’ve created another directory for images, so if in case you need to change the theme of your installer in future, all you have to do is to replace the images under this directory.

After adding these two tags, you may use the PropertyId “DialogBitmap” as shown below – 

  

This will update the respective dialog box’s background image to bg_utility.BMP. If you closely observe the TYPE attribute of the respective CONTROL tag is set to BITMAP. 

9. Similarly, you may convert the traditional windows buttons to custom images of your choice. See few examples below:

10. Make sure you maintain the path of images properly as per your project’s root directory. 
11. Once you are all set, go ahead and build the project and find the respective WIX installer .MSI file in respective Debug or Release directory.
I’ve tried to explain thoroughly, in how you can quickly create a customized WIX installer for a utility or a product built using MS Visual Studio .NET. 

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

indianDEV
Technical Lead
India India
No Biography provided
Follow on   Twitter

Comments and Discussions

 
QuestionThank PinprofessionalMember 100263583-May-13 0:05 
AnswerRe: Thank PinmemberVaibhav Tiparadi3-May-13 0:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 25 Apr 2013
Article Copyright 2013 by indianDEV
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid