设定Server 2008中ISAPI and CGI Restrictions的方法
手动:
1 IIS Managerを開く
2 左側のViewerで、サーバ名をクリック(ACE(ACE\Administrator))
3 右側のViewerで、IIS->ISAPI and CGI Restrictionsをダブルクリック
4 表示されたASP.NET v4.0.xxxxのRestrictionが[Not Allowed]なら、[Allow]してください
代码设定
if (((SYSINFO.nWinMajor = 6 && SYSINFO.nWinMinor = 1) //Server 2008 R2
|| (SYSINFO.nWinMajor = 6 && SYSINFO.nWinMinor = 0)) //Server 2008
&& (SYSINFO.nOSProductType != VER_NT_WORKSTATION)) then
szProgram = "C:\\Windows\\System32\\inetsrv\\appcmd.exe";
if (SYSINFO.bIsWow64) then
szCmdLine = "set config /section:isapiCgiRestriction /[path='C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\aspnet_isapi.dll'].allowed:True";
fLogWrite("OnMoved() 64bit ", LOG_NORMAL,szCmdLine);
LaunchAppAndWait(szProgram,szCmdLine,LAAW_OPTION_HIDDEN|LAAW_OPTION_WAIT);
endif;
szCmdLine = "set config /section:isapiCgiRestriction /[path='C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\aspnet_isapi.dll'].allowed:True";
fLogWrite("SystemSetupScript_Installed()", LOG_NORMAL,szCmdLine);
LaunchAppAndWait(szProgram,szCmdLine,LAAW_OPTION_HIDDEN|LAAW_OPTION_WAIT);
endif;
|| (SYSINFO.nWinMajor = 6 && SYSINFO.nWinMinor = 0)) //Server 2008
&& (SYSINFO.nOSProductType != VER_NT_WORKSTATION)) then
szProgram = "C:\\Windows\\System32\\inetsrv\\appcmd.exe";
if (SYSINFO.bIsWow64) then
szCmdLine = "set config /section:isapiCgiRestriction /[path='C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\aspnet_isapi.dll'].allowed:True";
fLogWrite("OnMoved() 64bit ", LOG_NORMAL,szCmdLine);
LaunchAppAndWait(szProgram,szCmdLine,LAAW_OPTION_HIDDEN|LAAW_OPTION_WAIT);
endif;
szCmdLine = "set config /section:isapiCgiRestriction /[path='C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\aspnet_isapi.dll'].allowed:True";
fLogWrite("SystemSetupScript_Installed()", LOG_NORMAL,szCmdLine);
LaunchAppAndWait(szProgram,szCmdLine,LAAW_OPTION_HIDDEN|LAAW_OPTION_WAIT);
endif;
endif;