WIX – Create virtual directory

  1. first you include the <Wix xmlns=”” xmlns:iis=””> at the start of the xml file
  2. The virtualdirectory needs to point to a real life folder (aka physical path). To do this you first add compoenent inside the directory-element that represents the physical path.
  3. Insite this you add 2 elements. <createFolder /> and <iis:WebVirtualDir Id=”VDir” WebSite=”DefaultWebSite” Alias=”{this is the folder’s name as it appears in inetmgr}”   Directory=”{name of physical path’s folder}”>
  4. Just before feature’s element, enter:<iis:WebSite Id=’DefaultWebSite’
    Description=’Default Web Site’
    Directory='{name of physical path’s folder}’>
    <!– This element has to be here or WiX does not compile. It’s ignored in this case. –>
    <iis:WebAddress Id=”AllUnassigned” Port=”80″ />
  5. On the command line, cd to the folder contain the wxs file, then use the iis extension:
    & ‘C:\Program Files (x86)\WiX Toolset v3.8\bin\light.exe’ .\product.wixobj -ext ‘C:\Program Files (x86)\WiX Toolset v3.8\bin\WixIIsExtension.dll’



You can find all my latest posts on medium.