-
Notifications
You must be signed in to change notification settings - Fork 0
Create Windows installer with Wix
To create a new Windows installer using Wix Toolset is relatively easy. The toolset has several tools to aid in that process, but we will use candle
and light
here. To see all available tools and more explanation on how to use them check Wix documentation.
To use candle
a Windows Installer XML Source file (wxs
) is required. This file contains all the information about the package contents, like what files it contains and where they should be stored upon installation. Some information on what each tag represents and expects is given below and a full wxs
file is here.
Almost every tag in the file needs a GUID, that is a unique number in the format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
. It is composed of hexadecimal numbers and it's how Windows handles what is installed/uninstalled. Any place that has YOUR-GUID
in this document requires a valid and unique GUID to work properly.
- Product tag describes name, language, version and whoever is responsible for this package.
<Product Name="templateTest 1.0.1" Id="YOUR-GUID" UpgradeCode="YOUR-GUID" Language='1046' Codepage='1252' Version="1.0.1" Manufacturer='UnB Games'>
- A Directory tag simply has an unique ID and a Name. If that folder doesn't exist in the system, it will be created upon installation. If the Directory has to referenced anywhere in the document, its ID must be used, hence the need for it to be unique. Windows pattern on new packages is to install them under
Program Files
(orProgram Files (x64)
if the package is 64 bit). The contents of the package should go under a folder with its name inside a folder with the maintainer's name. (Eg: The game Wenova should be found inC:/Program Files/UnB Games/Wenova/
). TheTARGETDIR
directory should always be used and the other folders should be described inside this one (check here for more details).
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id='UnBGames' Name='UnB Games'>
<Directory Id='INSTALLDIR' Name="templateTest 1.0.1">