我正在尝试通过以下安装脚本在 Windows Server 2012(IIS 版本 8.5)中创建 IISSetup,但抛出错误“无效的类字符串”。代码:
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;