我错过了一些明显的东西。您如何将 .dll 放在安装目录下名为“bin”的子目录中?我正在尝试按照本教程进行操作:
http://www.tramontana.co.hu/wix/lesson5.php#5.3
部署 WCF Web 服务。所以我需要复制 .svc 文件和 .bin 文件,以及其他一些文件,但只从这两个开始。我在 Visual Studio 下使用 Wix 3.5。
<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>
我尝试将\bin 放在 ID 和 name 属性上,但它不喜欢(无效字符)。
另外,对于 IIS,最佳做法是安装在 c:\program 文件中还是 c:\inetpub\wwwroot 中?如何将默认目录切换到 c:\inetpub\wwwroot\myproj?
这些是我对 WiX 的各种第一次实验。
最佳答案
每个标签创建一个新目录。对于每个嵌套标签,都有一个新目录。因此,如果您想在 INSTALLLOCATION 下有一个“bin”,请使用如下所示。
<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>
关于binary - WiX - 如何创建 bin 子目录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2051928/