Close

WIX – Create virtual directory

  1. first you include the <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension"> 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" />
    </iis:WebSite>
  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'

 

 

http://www.wintellect.com/blogs/jrobbins/install-a-new-virtual-directory-to-default-web-site-with-wix