WiX - 如何创建 bin 子目录?

发布于 2024-08-17 14:26:55 字数 1866 浏览 4 评论 0原文

我错过了一些明显的东西。如何将 .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 和名称属性上,但它都不喜欢(无效字符)。

另外,对于 IIS,最佳做法是安装在 c:\program files 还是 c:\inetpub\wwwroot 中?如何将默认目录切换到 c:\inetpub\wwwroot\myproj?

这些是我对 WiX 的首次实验。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

允世 2024-08-24 14:26:55

每个标签都会创建一个新目录。对于每个嵌套标签,都有一个新目录。因此,如果您想在 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>

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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文