简体   繁体   English

Inno Setup CreateOleObject('IISNamespace') 在 Windows Server 2012 上抛出异常

[英]Inno Setup CreateOleObject('IISNamespace') throws exception on Windows Server 2012

I am trying to create IISSetup in the Windows Server 2012 (IIS version 8.5) through the below install script but throws error "Invalid class string".我正在尝试通过以下安装脚本在 Windows Server 2012(IIS 版本 8.5)中创建 IISSetup,但抛出错误“无效的类字符串”。 code:代码:

var
  IIS, WebSite, WebServer, WebRoot, VDir: Variant;
  ErrorCode: Integer;
begin
  { Create the main IIS COM Automation object }
  try
    IIS := CreateOleObject('IISNamespace');
  except
    RaiseException(
      'Please install Microsoft IIS first.'#13#13'(Error ''' +
      GetExceptionMessage + ''' occurred)');
  end;
end;

I had the same issue on a Windows Server 2008 R2 Enterprise with Service Pack 1.我在带有 Service Pack 1 的 Windows Server 2008 R2 Enterprise 上遇到了同样的问题。

procedure TForm1.Button1Click(Sender: TObject);
var
  iis: OleVariant;
begin
  iis := CreateOleObject('IISNamespace');
end;

iis 命名空间

The solution for me was a missing IIS feature.我的解决方案是缺少 IIS 功能。 One has to install the IIS 6 thingy.一个必须安装IIS 6 thingy。

(germany version, don't know english) (德国版,不懂英文)

  • IIS 6-Verwaltungskompatibilität IIS 6-Verwaltungskompatibilität
    • IIS 6-Metabasiskompatibilität IIS 6-Metabasiskompatibilität
    • IIS 6-WMI-Kompatibilität IIS 6-WMI-兼容性
    • IIS 6-Scriptingtools IIS 6-脚本工具
    • IIS 6-Verwaltungskonsole IIS 6-Verwaltungskonsole

I am not sure but "IIS 6-Scriptingtools" should be enough.我不确定,但“IIS 6-Scriptingtools”应该足够了。

iis功能

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM