• installshield 判断操作系统安装


    export prototype DefaultFeature_Installed(); 
    function DefaultFeature_Installed() 
    string szInfPath,szApp,szCmd,szKey,szKeyValue;
    begin


     // TARGETDIR = "<PROGRAMFILES>\EeePC\" in this project

     if (CMDLINE == "/NotLaunchApp") then
      //do nothing 
     else
      //Launch app  
      szApp = TARGETDIR + "CapsHook\\CapsHook.exe";
      LaunchApp(szApp,"");              
        endif;
             
        if(SYSINFO.nISOSL == ISOSL_WINXP) then
      szKey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\\";
      szKeyValue = TARGETDIR + "CapsHook\\CapsHook.exe";
                                     
      RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE); 
      RegDBCreateKeyEx(szKey, "");
      RegDBSetKeyValueEx(szKey,"CapsHook",REGDB_STRING,szKeyValue,-1);             
     else
      szKey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\\";
      szKeyValue = "AsusSender.exe " + TARGETDIR + "CapsHook\\CapsHook.exe";
                                     
      RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE); 
      RegDBCreateKeyEx(szKey, "");
      RegDBSetKeyValueEx(szKey,"CapsHook",REGDB_STRING,szKeyValue,-1);
     endif;          
    end;

    // -------------------------------------------------------------------------

    export prototype DefaultFeature_UnInstalled(); 
    function DefaultFeature_UnInstalled()
    string szApp, szKey, szKeyValue; 
    begin                                 

     //Delete Registry key   
     szKey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\\CapsHook";
     RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
     RegDBDeleteKey(szKey);
    end;

  • 相关阅读:
    php编程规范整理
    约瑟夫环问题的实现
    MYSQL中SHOW的使用整理收藏
    mysql使用存储过程&函数实现批量插入
    浅谈select for update 和select lock in share mode的区别
    jQuery对象扩展方法(Extend)深度解析
    WCF系列教程之WCF操作协定
    WCF系列教程之WCF实例化
    WCF系列教程之WCF中的会话
    WCF系列教程之WCF服务协定
  • 原文地址:https://www.cnblogs.com/lzjsky/p/1766786.html
Copyright © 2020-2023  润新知