views:

609

answers:

2

I am trying to create a website installer and am using wix. i am using this tutorial http://www.dalun.com/wix/01.05.2007.htm

i had to change my script to use

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"&gt;

because it was complaining about

<Wix xmlns='http://schemas.microsoft.com/wix/2003/01/wi'&gt;

so my script looks like this

<?xml version='1.0' encoding='Windows-1252'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'&gt;
   <Product Id='6197b262-b2d8-464c-9d0b-6cade171b46f' Name='WixWebSiteExample' Language='1033' Version='0.0.0.0' Manufacturer='Corporation'>
      <Package Id='439d5627-cc07-4a41-9f50-b201ae3f8202' Description='Creating a web site with WiX' Comments='Creating a web site with WiX' InstallerVersion='200' Compressed='yes' />

      <Media Id='1' Cabinet='product.cab' EmbedCab='yes' />

      <Directory Id='TARGETDIR' Name='SourceDir'>
         <Directory Id='ProgramFilesFolder' Name='PFiles'>
            <Directory Id='ApplicationFolder' Name='AppDir'>
               <Component Id='WebSiteComponent' Guid='6b27e78e-bcbc-462a-bd7a-50cf991c7d39' DiskId='1'>
                  <File Id='WixExampleFile' Name='simple.txt' src='bin\simple.txt' />
                  <WebSite Id='DefaultWebSite' Description='My First Web Site Created With WiX' Directory='ApplicationFolder'>
                    <WebAddress Id="AllUnassigned" Port="80" />
                  </WebSite>
               </Component>
               <Component Id="WebVirtualDirComponent" Guid="8d7c59c0-b84d-40d9-b3a5-0c73b6487ae4">
                   <WebVirtualDir Id="VDir" Alias="Test" Directory="ApplicationFolder" WebSite="DefaultWebSite">
                       <WebApplication Id="TestWebApplication" Name="Test" />
                   </WebVirtualDir>
               </Component>
            </Directory>
         </Directory>
      </Directory>

      <Feature Id='TestProductFeature' Title='Wix File Product Feature' Level='1'>
         <ComponentRef Id='WebSiteComponent' />
         <ComponentRef Id='WebVirtualDirComponent' />         
      </Feature>
   </Product>
</Wix>

I am getting this error

C:\Downloads\wix3.0.5419.0-binaries\firstWebsite\firstwebsite.wxs(13) : error CN DL0005 : The Component element contains an unexpected child element 'WebSite'. C:\Downloads\wix3.0.5419.0-binaries\firstWebsite\firstwebsite.wxs(18) : error CN DL0005 : The Component element contains an unexpected child element 'WebVirtualD ir'.

is Website tag not supported in wix 3.0?

+2  A: 

In wix 3.0, the website element is in a different namespace. Declare the namespace by changing the wix element from

<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'&gt;

to

<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' 
   xmlns:iis='http://schemas.microsoft.com/wix/IIsExtension'&gt;

and then refer to the <WebSite> element as <iis:WebSite>. Add the same prefix to the other web-related elements.

Furthermore, you need to run candle.exe and light.exe with this option: -ext WixIIsExtension.

Wim Coenen
+2  A: 

When upgrading from WiX v2 source code to WiX v3 source code, try using the WiX v3 tool WixCop.exe. It'll fix these sorts of things for you automatically.

Rob Mensching