By default a setup built with the WiX Toolset doesn’t provide a GUI. This might be sufficient for an administrator, but for users it is quite annoying and confusing. In this tutorial we’ll cover, how you can simply add a GUI to your setup.
(Setup-image has been resized)
Built-in WiX Dialogs
The WiX Toolset comes with multiple predefined dialog-sets, which you can simply take and use. For most usecases they are sufficient. If the built in dialogs do not fit your needs, you’d even have the possibility to customize them.
Step by step guide
As an example, we’ll add a GUI to our setup, which allows the user to select an installation-directory.
- Add a reference to the WIXUIExtension.dll
- Add the ui-namespace to the Wix-Element
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:ui="http://schemas.microsoft.com/wix/UIExtension"> ... </Wix>
- Within the product-element after the package, add the installationdirectory and the GUI-type to the setup-xml
<Wix ...> <Product ...> <Package ... /> <Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" /> <UIRef Id="WixUI_InstallDir" /> ... </Product> </Wix>
That’s all. You can now build and try it! Congratulations, you have built your first setup with a GUI!
In the next tutorial we’ll learn how to add a startmenu to a WiX Toolset setup!