我正在尝试为我的Web API应用程序创建一个基本的WiX安装程序,作为安装程序的一部分,我希望它为该项目创建Web目录和Web应用程序。我有以下代码可以做所有事情,除了它不会创建Web应用程序。我希望iss文件夹结构看起来像
这是我的代码 :
<Fragment>
<SetDirectory Id="WINDOWSVOLUME" Value="[WindowsVolume]"/>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="WINDOWSVOLUME">
<Directory Id="DiagonalFolder" Name="Diagonal">
<Directory Id="ServicesFolder" Name="WebServices">
<Directory Id="LocationServicesFolder" Name="LocationServices">
<!-- Since the installation directory is not 'Program Files', MUST use ComponentGuidGenerationSeed which MUST NEVER CHANGE for life of Product -->
<Directory Id="INSTALLFOLDER" Name="Bin" ComponentGuidGenerationSeed="PUT-GUID-HERE">
</Directory>
</Directory>
</Directory>
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="IISComponentGroup" Directory="TARGETDIR">
<!--The component to define the Virtual Directory-->
<Component Id="IIS.Component" Guid="*" KeyPath="yes">
<iis:WebVirtualDir Id="VDir" Alias="api" Directory="ServicesFolder" WebSite="DefaultWebSite">
<!--Turn the Virtual Directory into a web application-->
<iis:WebApplication Id="WebApplication" Name="ls" WebAppPool="TheAppPool">
</iis:WebApplication>
</iis:WebVirtualDir>
<iis:WebAppPool Id="TheAppPool" Name="DefaultAppPool" ></iis:WebAppPool>
<CreateFolder/>
</Component>
</ComponentGroup>
<iis:WebSite Id="DefaultWebSite" Description="Default Web Site" Directory="TARGETDIR">
<!-- This element has to be here or WiX does not compile. It’s ignored in this case.-->
<iis:WebAddress Id="AllUnassigned" IP="*" Port="8080" />
</iis:WebSite>
</Fragment>
这将创建名为“ api”的Web应用程序文件夹而不是Web目录,并且不会创建名称为“ ls”的Web应用程序。它应该看起来像 本地主机/ api / ls