2016-03-24 10 views
0

私はWiX 3.10を使用しています。 IEでのみ使用されるウェブサイトの場合。 (.net 2.0)WiX - HTTPレスポンスヘッダー

最近、ブラウザの互換性の設定が原因で、妨害されたレイアウトについて不満を感じているユーザーがいました。

これを固定する一つの方法は、HTTPレスポンスヘッダー(名称:X-UA-の互換性、価値:IE = EmulateIE7)を追加しているようだ

IIS

に私はProduct.WXSから何とかこれを行うことができますインストール後、これは設定されますか?

HttpHeader elementは、あなたが任意のヘッダを指定することができます

答えて

2

WiXを使用してWebサイトとHTTP応答ヘッダーを設定するサンプルコードです。

<?xml version="1.0" encoding="UTF-8"?> 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" 
    xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension"> 
    <Product Id="*" Name="IISTest" Language="1033" Version="1.0.0.0" Manufacturer="Microsoft" UpgradeCode="9670352d-2b30-446e-b17f-a31a7d08d917"> 
     <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" /> 

     <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> 
     <MediaTemplate /> 

     <Feature Id="ProductFeature" Title="IISTest" Level="1"> 
      <ComponentGroupRef Id="ProductComponents" /> 
     <ComponentGroupRef Id="MyWebsiteIISConfiguration" /> 
     </Feature> 
    </Product> 

    <Fragment> 
    <Directory Id="TARGETDIR" Name="SourceDir"> 
     <!-- Will reference to C:\inetpub--> 
     <Directory Id="INETPUB" Name="Inetpub"> 
     <Directory Id="WwwRoot" Name="WWWRoot"> 
     <!-- Will reference to c:\Inetpub\wwwroot\MyWebSite--> 
     <Directory Id="INSTALLFOLDER" Name="MyWebSite" /> 
     </Directory> 
      </Directory> 
     </Directory> 
    </Fragment> 

    <Fragment> 
    <DirectoryRef Id="INSTALLFOLDER"> 
     <Component Id="MyInstallWebsite" Guid="1253DBFC-D959-470E-A044-7DDABFFC1298" KeyPath="yes"> 
     <!-- Install to default web site --> 
     <iis:WebSite Id="MyWebsiteWebsite" Description='MY Website' Directory='INSTALLFOLDER' AutoStart='yes' StartOnInstall='yes'> 
      <iis:HttpHeader Id="header_id" Name="X-UA-Compatible" Value="IE=EmulateIE7"/> 
      <iis:WebAddress Id="AllUnassigned" Port="80" /> 
      <iis:WebApplication Id="MyWebsiteApplication" Name="[MyWebsiteWebsite][WEBSITE_ID]" WebAppPool="MyWebsiteAppPool"> 
      </iis:WebApplication> 
     </iis:WebSite> 
     </Component> 
     <Component Id="MyWebsiteAppPool" Guid="" KeyPath="yes"> 
     <iis:WebAppPool Id="MyWebsiteAppPool" 
         Name="MyWebsiteAppPool" 
         Identity="applicationPoolIdentity" 
         ManagedPipelineMode="Integrated" 
         ManagedRuntimeVersion="v4.0" /> 
     </Component> 

    </DirectoryRef> 
    </Fragment> 

    <Fragment> 
    <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> 
     <Component Id="ProductComponent" Guid="{6F44232F-1C0B-4278-AB2B-BFD34FAE863C}"> 
     <File Id="favicon.ico" Source="favicon.ico" /> 
     </Component> 
    </ComponentGroup> 
    <ComponentGroup Id="MyWebsiteIISConfiguration"> 
     <ComponentRef Id="MyInstallWebsite" /> 
     <ComponentRef Id="MyWebsiteAppPool" /> 
    </ComponentGroup> 
    </Fragment> 
</Wix> 

enter image description here

2

ありがとうございます。

関連する問題