0

InstallShield 2009 によってインストールされた Web サイトで HTTP カスタム エラー メッセージを設定するにはどうすればよいですか?

それは一見シンプルに見えます。Web サイトまたは仮想ディレクトリ オブジェクトを作成できるインターネット インフォメーション サービス ビューがあり、これらのオブジェクトのタブの 1 つで、カスタム HTTP エラー メッセージを設定できるように見えます。

1 つまたは 2 つのエラー メッセージをリセットすることもできますが、すべての HTTP エラー メッセージをリセットしようとすると失敗します。

具体的には、これは私の InstallShield プロジェクト (XML ファイル形式) の ISIISCommon テーブルです。

<table name="ISIISCommon">
    <col key="yes" def="s72">ISIISCommon</col>
    <col def="S72">ISIISCommon_Parent</col>
    <col def="L255">DisplayName</col>
    <col def="s50">RootDir</col>
    <col def="i4">Attributes</col>
    <col def="L255">DefDoc</col>
    <col def="I4">SessionTimeout</col>
    <col def="I4">ScriptTimeout</col>
    <col def="S255">AnonyUserName</col>
    <col def="S255">AnonyPasswrd</col>
    <col def="S0">CustomErrors</col>
    <col def="L255">AppName</col>
    <col def="S72">SSLCert</col>
    <col def="L72">AppPool_</col>
    <col def="S255">Aspversion</col>
    <col def="S255">SslPassword</col>
    <col def="S255">HostHeaderName</col>
    <row><td>ISIISCommonVRoot</td><td>ISIISCommonWebsite1</td><td>##ID_STRING121##</td><td>WEB</td><td>25873</td><td>Index.html</td><td>20</td><td>90</td><td/><td/><td>400,*,URL,CustomError.html;401,1,URL,CustomError.html;401,2,URL,CustomError.html;401,3,URL,CustomError.html;401,4,URL,CustomError.html;401,5,URL,CustomError.html;403,1,URL,CustomError.html;403,10,URL,CustomError.html;403,11,URL,CustomError.html;403,12,URL,CustomError.html;403,13,URL,CustomError.html;403,14,URL,CustomError.html;403,15,URL,CustomError.html;403,16,URL,CustomError.html;403,17,URL,CustomError.html;403,2,URL,CustomError.html;403,3,URL,CustomError.html;403,4,URL,CustomError.html;403,5,URL,CustomError.html;403,6,URL,CustomError.html;403,7,URL,CustomError.html;403,8,URL,CustomError.html;403,9,URL,CustomError.html;404,*,URL,CustomError.html;405,*,URL,CustomError.html;406,*,URL,CustomError.html;407,*,URL,CustomError.html;412,*,URL,CustomError.html;414,*,URL,CustomError.html;500,*,URL,CustomError.html;500,100,URL,CustomError.html;500,12,URL,CustomError.html;500,13,URL,CustomError.html;500,15,URL,CustomError.html;501,*,URL,CustomError.html;502,*,URL,CustomError.html</td><td>##ID_STRING127##</td><td/><td>##ID_STRING31##</td><td/><td/><td/></row>
</table>

お気づきかもしれませんが、仮想ディレクトリのすべての HTTP エラーを CustomError.html ページにリダイレクトするように設定しようとしました。また、この情報を独自の TABLE ではなく TD 要素内に保存することは、特に InstallShield/Windows インストーラーの世界では、障害につながると思います。

これは、さまざまなレベルで機能しません。

何よりもまず、ここにインストールログがあります。

    MSI (s) (60:14) [12:28:49:025]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI72A0.tmp, Entrypoint: CreateIISVRoots
    InstallShield 12:28:49: User legacy object preference is the following: 1 . This is based on the value of the following property: IISPREFERLEGACYOBJECTS
    InstallShield 12:28:49: InitIISObject
    InstallShield 12:28:49: CreateAppPoolFunction
    InstallShield 12:28:49: OpenKeyLog, pszMDPath =/LM
    InstallShield 12:28:49: AddKey, pszMDPath = /W3SVC/AppPools/MyAppPool
    InstallShield 12:28:49: OpenKeyLog, pszMDPath =/LM/W3SVC/AppPools/MyAppPool
    InstallShield 12:28:49: getvaluelog
    InstallShield 12:28:49: SetVRtStrProperty for property '1002' with value 'IIsApplicationPool' and strSubPath '/'.
[zip]
    InstallShield 12:28:49: SetVRtStrProperty for property '6006' with value 'Index.html' and strSubPath '/'.
    InstallShield 12:28:49: SetData, pszMDPath = /
    InstallShield 12:28:49: SetVRtDelimMultiszProperty for property '6008' with value '400,*,URL,CustomError.html;401,1,URL,CustomError.html;401,2,URL,CustomError.html;401,3,URL,CustomError.html;401,4,URL,CustomError.html;401,5,URL,CustomError.html;403,1,URL,CustomError.html;403,10,URL,CustomError.html;403,11,URL,CustomError.html;403,12,URL,Cus'.
    **InstallShield 12:28:49: SetVRtMultiszProperty for property '6008' and value '400,*,URL,CustomError.html' with length '522'**.

一見すると、カスタム エラーの説明に 522 文字が使用されているのは好ましくありません。IIS では、最初の 259 文字しか消費されなかったため、正しく設定されたカスタム エラーはほんの一握りで、最後の 1 つはひどく間違っていました (403.12 の結果のカスタム エラー URL は「cus」になります)。

この制限を回避する方法はありますか?

4

1 に答える 1

0

CustomError ページの名前を CustomError.html から ce.htm に変更しました。これによりスペースがいくらか節約されましたが、十分ではありませんでした。より大きな char バッファー セーバーは古き良き *. それ以外の

401,1,URL,CustomError.html;401,2,URL,CustomError.html;...;401,13,CustomError.html;401,2,URL,CustomError.html

私は最終的に使用します:

401、*、ファイル、ce.htm;

ISIISCommon テーブルで仮想ディレクトリの行がどのように表示されるかを次に示します。

    <row><td>ISIISCommonVRoot</td><td>ISIISCommonWebsite1</td><td>##ID_STRING121##</td><td>WEB</td><td>25873</td><td>Index.html</td><td>20</td><td>90</td><td/><td/><td>400,*,FILE,ce.htm;401,*,FILE,ce.htm;403,*,FILE,ce.htm;404,*,FILE,ce.htm;405,*,FILE,ce.htm;406,*,FILE,ce.htm;407,*,FILE,ce.htm;412,*,FILE,ce.htm;414,*,FILE,ce.htm;500,*,FILE,ce.htm;501,*,FILE,ce.htm;502,*,FILE,ce.htm</td><td>##ID_STRING127##</td><td/><td>##ID_STRING31##</td><td/><td/><td/></row>

これは、すべてのシナリオに適しているとは限りません (401.1 と 401.2 で異なる顧客エラーを発生させたい場合はどうすればよいでしょうか?)。

また、この変更を InstallShield XML プロジェクト ファイルで直接行う必要がありました。これは、GUI がそれを理解できないためです (プロジェクトをロードして正しくビルドしても、[カスタム エラー] タブはめちゃくちゃです。 DEFAULT または suberror の特殊なエントリを割り引くだけです。結果の MSI ファイルには存在しません。または、Orca はとにかくこれを言っています)。

また、URL から FILE に移動しました。これは、後者が認証に対してより直交しているように見えるためです。

より良い解決策を読むのは素晴らしいことですが、なぜこのようなテーブルの世界で、誰かがそのようなテーブルを保存するのが良い考えになると思ったのだろうか.

于 2012-06-27T15:32:59.670 に答える