11

I'm missing something obvious. How do you put the .dll's in a subdirectory called "bin" under your install directory? I'm trying to follow this tutorial: http://www.tramontana.co.hu/wix/lesson5.php#5.3 to deploy a WCF web service. So I need to copy the .svc files and the .bin files, along with a few other, but starting with just these two. I'm using Wix 3.5 under Visual Studio.

    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
            <Directory Id="INSTALLLOCATION" Name="TFBIC.RCT.WCFWebServicesWIXSetup">
                <Component Id="ProductComponent" Guid="E9A375FB-DF6A-4806-8B0B-03BE4A50802F"> 
                    <File Id='SVC1' Name='CreateUpdateReturnService.svc' DiskId='1' Source='../TFBIC.RCT.WCFWebServices/CreateUpdateReturnService.svc'  />
                </Component>
            </Directory>
            <Directory Id="INSTALLLOCATION" Name="TFBIC.RCT.WCFWebServicesWIXSetup">
                <Component Id="ProductComponent" Guid="E9A375FB-DF6A-4806-8B0B-03BE4A50802F">
                    <File Id='DLL1' Name='TFBIC.RCT.WCFWebServices.dll' DiskId='1' Source='../TFBIC.RCT.WCFWebServices/bin/TFBIC.RCT.WCFWebServices.dll'  />
                </Component>
            </Directory>
        </Directory>
        <Component Id='TestWebVirtualDirComponent' Guid='9586807E-9065-48e8-8E73-13A9191962E5'>
            <iis:WebVirtualDir Id='TestWebVirtualDir' Alias='Test' Directory='InstallDir'
              WebSite='DefaultWebSite'>
                <iis:WebApplication Id='TestWebApplication' Name='Test' />
            </iis:WebVirtualDir>
        </Component>

    </Directory>

I tried putting \bin on the ID and the name attribute, and it didn't like either (invalid character).

Also, with IIS, is the best practice to install in c:\program files, or in c:\inetpub\wwwroot? How to I switch the default directory to c:\inetpub\wwwroot\myproj?

These are my various first experiments with WiX.

Yan Sklyarenko
  • 31,557
  • 24
  • 104
  • 139
NealWalters
  • 17,197
  • 42
  • 141
  • 251

1 Answers1

10

Each tag creates a new directory. For each nested tag, there's a new directory. So, if you want to have a "bin" under INSTALLLOCATION, use like below.

<Directory Id="INSTALLLOCATION" Name="TFBIC.RCT.WCFWebServicesWIXSetup"> 
    <Directory Id="BinFolder" Name="bin"> 
        <Component Id="ProductComponent" Guid="E9A375FB-DF6A-4806-8B0B-03BE4A50802F">  
            <File Id='SVC1' Name='CreateUpdateReturnService.svc' DiskId='1' Source='../TFBIC.RCT.WCFWebServices/CreateUpdateReturnService.svc'  /> 
        </Component> 
     </Directory> 
 </Directory>
Fredrik Ullner
  • 2,106
  • 2
  • 22
  • 28
  • Thanks, that makes perfect sense! I wasn't thinking about nesting the elements. – NealWalters Jan 12 '10 at 20:27
  • Also, if you want to have an empty directory, you can use – Fredrik Ullner Jan 12 '10 at 20:47
  • 1
    Also, you can alias directories with alternate Id's by adding a child element. This is useful if you are authoring reusable wix components under a `DirectoryRef` element, as you can't know yet in which folder the applications want to install that component. – Wim Coenen Jan 13 '10 at 01:09
  • 2
    This did not work. Says ProductComponent is orphaned. Why are people voting this up? – Scott Shaw-Smith Jul 29 '14 at 19:31