• 枚举注册表


    1.工程类型:IS2010 installscript

    2.目的:枚举注册表中donet版本,如果注册表中存在的版本与要检测的版本一致,就返回true,否则返回false.

    3.具体实现:


    function BOOL LISTDonetVer(DefineVer)
      STRING   InstallVer,SPVer;
      LIST   listID;
      STRING nzItem, szSubKey,svString; 
      NUMBER nResult,nReturn, nItem,nvType,nvSize;
      LIST   listSubKeys, listNames;

    begin
       listSubKeys = ListCreate(STRINGLIST);
          listNames = ListCreate(STRINGLIST);
          RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
          szSubKey = "SOFTWARE\\Microsoft\\NET Framework Setup\\NDP";
          nReturn = RegDBQueryKey ( szSubKey, REGDB_KEYS, listSubKeys );
         if (nReturn >=0) then
           nResult = ListGetFirstString (listSubKeys, svString);
          // Loop while list items continue to be retrieved.
              while (nResult != END_OF_LIST)
              // Get the next string in the list.
                 nResult = ListGetNextString (listSubKeys, svString);
                   if(svString=DefineVer)then
                     szSubKey=szSubKey+"\\"+svString;
                     RegDBGetKeyValueEx (szSubKey, "Install", nvType, InstallVer, nvSize);
                     RegDBGetKeyValueEx (szSubKey, "SP", nvType, SPVer, nvSize);
                    if( StrCompare(InstallVer,"1")=0)&&(StrCompare(SPVer,"1")>=0) then
                          return  TRUE;
                  else
                          return  FALSE;
       
                   endif;
               endif; 
            endwhile;
     
         endif;
    end;

  • 相关阅读:
    javascript命名空间的简单实现
    javascript变量的作用域
    Python单元测试框架
    opencv中遍历图片数据的两种方法
    hsv 与 hsi 颜色空间
    OpenCV资料
    Linux下查看文件和文件夹大小
    The run destination iPhone 5.0 Simulator is not valid for running the scheme 'MyApp'
    OpenCV函数学习之cvLUT
    Linux中find常见用法示例
  • 原文地址:https://www.cnblogs.com/sabrinahuang/p/2184457.html
Copyright © 2020-2023  润新知