李sir_Blog

博客园 首页 联系 订阅 管理

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;

posted on 2010-06-28 15:31  李sir  阅读(1753)  评论(0编辑  收藏  举报