0

如何在由InstallShield 2009安装的网站上设置HTTP自定义错误消息?在InstallShield 2009上设置多个IIS自定义HTTP错误消息

它看起来似乎很简单。有一个Internet信息服务视图,我们可以在其中创建网站或虚拟目录对象,而这些对象的选项卡之一看起来可能会让我们设置自定义的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页面。还要注意,我认为将这些信息存储在TD元素中,而不是在它自己的TABLE中,对于故障是有缺陷的,尤其是在InstallShield/Windows Installer世界。

这不起作用,在各个层面上。

首先,这里是安装日志,

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个字符,因此只有少数自定义错误被正确设置,最后一个严重错误(403.12的自定义错误URL为“cus”)。

有什么办法可以解决这个限制吗?

回答

0

我将CustomError.html中的CustomError页面重命名为ce.htm。这节省了一些空间,但还不够。一个更大的char缓冲器保存器是好的*。取而代之的

401,1,网址,CustomError.html; 401,2,网址,CustomError.html; ...; 401,13,CustomError.html; 401,2,网址,CustomError.html

我最终使用:

401,*,FILE 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不会理解这一点(并且仍然会这样做,甚至会导致项目加载并正确构建,“自定义错误”选项卡是一团糟,我只是打折默认或suberror专业条目,他们不在那里产生的MSI文件,或者这就是无论如何Orca说)。

我也从URL移动到FILE,因为后者似乎更加正交于身份验证。

阅读更好的解决方案会很棒,我仍然想知道为什么在这样的表格世界中,有人认为这样存储表格是个好主意。