如何使用 INNO 安装程序检测现有的 IIS 安装?
我正在寻找一种方法来确定用户是否已经安装了 IIS 版本。如果他不这样做,我将继续运行我的 IIS 安装脚本。
我知道我所做的异常处理子句:
try
IIS := CreateOleObject('IISNamespace');
except
RaiseException(ExceptionType, ‘IIS not installed. Setup will now install IIS on your machine. ’#13#13'(Error ‘’’+ExceptionParam+’’’ occured)’);
end;
但由于某种原因,我的编译器版本似乎无法识别 RaiseException。我也尝试过包含
uses
SysUtils;
,但编译器甚至无法识别 SysUtils。是否有类似注册表项之类的东西,我可以通过查看来确定 IIS 是否已安装?
任何帮助将不胜感激。
I am looking for a way to determine if the user already has a version of IIS installed. If he doesn't, I will go ahead and run my IIS installation script.
I know of the exception handling clause where I do :
try
IIS := CreateOleObject('IISNamespace');
except
RaiseException(ExceptionType, ‘IIS not installed. Setup will now install IIS on your machine. ’#13#13'(Error ‘’’+ExceptionParam+’’’ occured)’);
end;
but for some reason, my compiler version doesn't seem to recognise RaiseException. I also tried including
uses
SysUtils;
but the compiler won't recognize SysUtils even. Is there something like a registry key that I can look at to determine whether IIS is already installed or not?
Any help would be much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Rishi 您正在使用带有 2 个参数的 RaiseException 函数,但该函数仅支持一个。
尝试像这样使用这个函数
Rishi you are using the
RaiseException
function with 2 parameters, but the this function only support one.try using this function like this
IIS 始终安装到 %windir%\system32\inetsrv,因此您应该检查此目录下是否存在特定文件。例如,对于 IIS 6/7,w3wp.exe 应存在于该文件夹中。
IIS always installs to %windir%\system32\inetsrv so you should check if specific files exist under this directory. For example, w3wp.exe should exist in this folder for IIS 6/7.
尝试:
;
Try:
;