如何使用WIX在IIS 6上安装ASP.NET MVC 3应用程序?

时间:2012-01-02 15:34:47

标签: asp.net-mvc iis-6 wix

安装到IIS-6时需要考虑以下事项:

  • 需要注册ASP.NET 4(可能使用aspnet_regiis.exe
  • 需要同时允许ASP.NET v2和v4
  • 需要注册aspnet_isapi.dll并支持通配符映射

到目前为止,这就是我所拥有的:

<iis:WebDirProperties Id='WebDirProperties' Script='yes' Read='yes
  Execute='no' WindowsAuthentication='yes' AnonymousAccess='no' 
  AuthenticationProviders='NTLM,Negotiate' />

<!-- SO has some good posts on selecting the website from a dropdown -->
<iis:WebSite Id='SelectedWebSite' Directory='WWWROOT' SiteId='[WEBSITE_ID]' Description='[WEBSITE_DESCRIPTION]'>
  <iis:WebAddress Id='AllUnassigned' Port='80' IP='*'/>
</iis:WebSite>

  <Component Id="ProjWebApp" Guid="{B4BE9223-7109-4943-AE4E-8F72FA350D02}" 
    Win64="$(var.IsWin64)" NeverOverwrite="yes" Transitive="yes">
    <CreateFolder/>

    <iis:WebAppPool Id="ProjAppPool" Name="[APPPOOLNAME]" Identity="networkService"
      ManagedRuntimeVersion="v4.0" ManagedPipelineMode="integrated" />
    <iis:WebVirtualDir Id="ProjVDir" DirProperties="WebDirProperties"
      Alias="[WEBAPPNAME]" Directory="WEBFILESDIR" WebSite="SelectedWebSite">
      <iis:WebApplication Id="ProjApp" Name="[WEBAPPNAME]" WebAppPool="ProjAppPool">
        <iis:WebApplicationExtension
            CheckPath="no"
            Script="yes"
            Executable="[ASPNETISAPIDLL]"
            Verbs="GET,HEAD,POST"
            />
      </iis:WebApplication>
    </iis:WebVirtualDir>
  </Component>

  <!-- other apps may start using it once installed so it must be permanent -->
  <Component Id="EnableASPNet4Extension" Permanent="yes" Guid="{C8CDAB96-5DDC-4B4C-AD7E-CD09B59F7813}">
    <iis:WebServiceExtension Id="ASPNet4Extension" Group="ASP.NET v4.0.30319"
      Allow="yes" File="[ASPNETISAPIDLL]" Description="ASP.NET v4.0.30319" 
      UIDeletable="no"
      />
  </Component>

我有一个自定义操作来向IIS注册ASP.NET:

<?if $(var.Platform) = x64 ?>
  <CustomAction Id="SetProperty_AspNetRegIIS_InstallNet40Cmd"
    Property="AspNetRegIIS_InstallNet40Cmd"
    Value="&quot;[NETFRAMEWORK40FULLINSTALLROOTDIR64]aspnet_regiis.exe&quot; -ir"/>
<?else?>
  <CustomAction Id="SetProperty_AspNetRegIIS_InstallNet40Cmd"
    Property="AspNetRegIIS_InstallNet40Cmd"
    Value="&quot;[NETFRAMEWORK40FULLINSTALLROOTDIR]aspnet_regiis.exe&quot; -ir"/>
<?endif?>

问题

这几乎可行。此时有两个问题:

  1. IIS扩展不遵守IIS-6上的托管运行时版本,因此应用程序没有设置ASP.NET版本。
  2. 如果我在创建后使用aspnet_regiis.exe -s APP_PATH注册它,它会覆盖通配符映射(我不知道我可以运行的命令行来恢复它)。
  3. 鉴于上述缺点,如何在已安装ASP.NET 2的情况下使用WIX将ASP.NET MVC 3应用程序安装到具有适当通配符映射的IIS-6上?

0 个答案:

没有答案