Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wix 3.0 unexpected child element 'Website'

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">

because it was complaining about

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

so my script looks like this

<?xml version='1.0' encoding='Windows-1252'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
   <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?

like image 684
godseyeview Avatar asked Aug 13 '09 16:08

godseyeview


1 Answers

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'>

to

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

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.

like image 139
Wim Coenen Avatar answered Sep 24 '22 00:09

Wim Coenen