UPDATE: New section added underneath on how to compile WiX sources outside Visual Studio. Leaving in Visual Studio section for reference.
Visual Studio
Are you in Visual Studio? If so, I tried to make a simple demo of how to do a minimal WiX installer with GUI and a license agreement a while back. Maybe see if it makes sense to you: WiX installer msi not installing the Winform app created with Visual Studio 2017.
- Try the step-by-step list on top
- With your prior knowledge you can also just look directly in the WiX source at the bottom (inline comments)
- Crucially you need a reference to WixUIExtension.dll where the GUI sets are found
If you follow those steps you should succeed. If you are not in Visual Studio, then you need to get the command lines right when you call candle.exe
and light.exe
. Not rocket science, but it can be a bit fiddly as I like to call it. Maybe there is a simple sample somewhere of proper command lines - I don't have any available right now.
UPDATE: Forgot to mention that you need to install these extensions for Visual Studio in addition to WiX: http://wixtoolset.org/releases/. Just in case you haven't already.
Command Line Compile
To compile a WiX source file and include a default GUI with a license agreement RTF file outside Visual Studio, please use the sample above to update the WiX source so it links a default GUI, then try these command lines to compile and link your WiX sources:
Compile:
candle.exe product.wxs -ext WixUIExtension
Link:
light.exe -out Test.msi product.wixobj -ext WixUIExtension
If things work correctly you should get a Test.msi
file next to your WiX XML source file, and running it you should get a default GUI with your specified license agreement.
And, though obvious, I will just mention it: you can get a full list of candle.exe
and light.exe
parameters by just running them without parameters via a command prompt.
And just so it is clear: you must use the procedure in the linked answer above to set up this GUI and the license agreement file. Repeating the link here: WiX installer msi not installing the Winform app created with Visual Studio 2017
The essence of adding your own license agreement to your MSI is just this WiX XML blurb:
<UIRef Id="WixUI_Mondo" />
<WixVariable Id="WixUILicenseRtf" Value="TestLicenseAgreement.rtf" />
- The UIRef element just specifies the
WixUI_Mondo
default dialog set (found in WixUIExtension.dll
)
- The WixVariable element simply specifies an RTF license file (add path, if any)
- Then you link with
WixUIExtension.dll
by the -ext switch for the light.exe
linker as shown in the command line above.
There are several such default dialog sets, but I find that Mondo
is the one that works best. How can I add an optional UI to WiX toolset.
Similar answer: Create a msi from .wxs file using command line