• HOWTO:InstallShield中如何判断IIS是否安装以及安装的版本


    版权声明: 可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息。 

    近期被问及在InstallShield的脚本中如何判断IIS(Internet Information Services)是否被安装,或者是判断目标机上安装的IIS版本。

    我们这里是通过读取注册表的方式来进行判断。

    对于Basic MSI或InstallScript MSI工程,还可以通过IIS_VERSION属性进行判断,大家有兴趣可以去琢磨一下。

    下面是通过注册表方式判断的示例代码(我们在事件响应函数OnAppSearch进行判断)

    function OnAppSearch()
        
    STRING szKey, szName, svValue, szMsg;
        
    NUMBER nvType, nvSize, nvVersion;
    begin
        
    RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE); 
        szKey = "SOFTWARE\\Microsoft\\InetStp";          
        szName = "MajorVersion";
        nvType = REGDB_STRING;
        
    if(RegDBGetKeyValueEx(szKey, szName, nvType, svValue, nvSize) < 0then
            szMsg = "Please add this role in Server Manager and then run this setup again.";     
            
    MessageBox(szMsgSEVERE);
            
    abort;
        
    else
            
    StrToNum(nvVersion, svValue); 
            
    if ( nvVersion < 6 ) then
                szMsg = "Please install IIS 6.0 or higher and then run this setup again.";     
                
    MessageBox(szMsg, SEVERE);
                
    abort;
            
    endif;
        
    endif;
    end;
  • 相关阅读:
    Python中max()内置函数使用(list)
    linux命令总结mpstat命令
    linux命令总结vmstat命令
    linux命令总结free命令
    linux命令总结top命令
    linux命令总结之echo命令
    Nagios服务器端配置文件详解
    python之OS模块详解
    真正的inotify+rsync实时同步 彻底告别同步慢
    linux BASH shell下设置字体及背景颜色
  • 原文地址:https://www.cnblogs.com/wanbinghong/p/1879385.html
Copyright © 2020-2023  润新知