zoukankan      html  css  js  c++  java
  • 枚举注册表

    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;

  • 相关阅读:
    __attribute__ 总结
    linux文件夹打包命令
    学习ARM的一些基本知识,个人整理
    备忘录之 —— .bashrc(IC工具篇)
    GitHub的基本使用
    02: SocketServer服务
    01: socket模块
    08: python基础练习题
    07: 高阶函数&异常处理
    06: 面向对象
  • 原文地址:https://www.cnblogs.com/sabrinahuang/p/2184457.html
Copyright © 2011-2022 走看看