Skip to main content

Putting it to Use

If you copy all these fragments together (or, to spare some elbow grease, download the SampleFirst archive), you can build the installer package with the commands:

candle.exe SampleFirst.wxs
light.exe SampleFirst.wixobj

You should get no error message from either tool, and you should find a SampleFirst.msi file in your folder upon completion. If not, check for typos everywhere. Please, also note that the required syntax of the .wxs files might undergo some minor changes as the WiX toolset develops. The tutorial always assumes the most current version of the toolset and the samples should all compile without any error message straight out of the box (provided you correct the invalid GUIDs as described earlier). If you do receive compiler errors or warnings, please, compare your toolset version to the current one available for download.

To test your first installer, simply click on it. It will not greet you or offer any options, just show a progress dialog for a few seconds. But as soon as it finishes without errors, you should be able to find your three files in \Program Files\Acme\Foobar 1.0 all right. Note that the actual files deployed are 1-byte placeholder files, so the installed “application” will, naturally, refuse to run...

To remove this huge application again, go to Control Panel > Add or Remove Programs, locate Foobar 1.0 in the list, click Remove (Change will accomplish nothing at this stage). Both the three files and the Acme\Foobar 1.0 subfolders should evaporate.

If you experience any problems—or just for fun—start the installer with logging turned on:

msiexec /i SampleFirst.msi /l* SampleFirst.log

or even

msiexec /i SampleFirst.msi /l*v SampleFirst.log

The log will be rather verbose (especially in the second case) but it will pinpoint the error that might cause the installation to fail.

During testing, you might find it more convenient to remove the package without having to mouse your way into Add or Remove Programs. Just enter the command instead:

msiexec /x SampleFirst.msi

Error LGHT0103

Ha, I was able to post this using Firebug to fix the page issues!Anyway, I changed the guids, and compiled fine, but got LGHT0103 when linking, even though the wxsobj file exists:C:\WixTest>"C:\Program Files (x86)\WiX Toolset v3.7\bin\candle" SampleFirst.wxsWindows Installer Xml Compiler version 3.7.1224.0Copyright (C) Outercurve Foundation. All rights reserved.SampleFirst.wxsC:\WixTest>"C:\Program Files (x86)\WiX Toolset v3.7\bin\light" SampleFirst.wxsobjlight.exe : error LGHT0103 : The system cannot find the file 'SampleFirst.wxsobj' with type 'Source'.C:\WixTest>

SampleFirst archive: 404

The SampleFirst archive link on this page is dead.

Not any more. Thanks.

Not any more. Thanks.


I ran into problems running "msiexec /i .\my.msi /l* logfile.log".  It popped up an error. Double clicking in Explorer would work fine.  After some experimentation, I found that PowerShell (Windows 8) did not like the filename ".\my.msi".  I replaced with {full-path-to}\my.msi and the error went away.  I had no problem with CMD shell.  I hope this save someone some trouble.

this does not make sense

In the entire tutorial up to this point there is no mention of candle.exe or light.exe. They are not referenced in the xml file. All of a sudden they are used to compile the program. I would currently be better off if I had not wasted any time trying to make sense of this tutorial.


You'd be better off if you read the tutorial from the START and I'd be better off if I weren't annoyed by people that are lost 5% into a tutorial because they're used to being spoon fed.  

I totally agree, a little

I totally agree, a little lost at the moment.
I'd like to move away from windows setup projects but it's a little daunting when I can't get the sample installation to compile.
(Where is Candle.exe)

In the bin directory

In the bin directory. But if you don't like the command line approach and only feel at home in an IDE, create a WiX setup project there. The source code will be the same but the IDE will handle all aspects of the building process.

Entire? Up to?

And what about the very beginning of the very first section of the tutorial? It starts with those tools right away. :-)

No, they're not referenced. Just like no compiler or linker is ever referenced in your C, C++, C#, Pascal, Basic or whatever source file.