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;

相关文章:

  • 2021-10-15
  • 2021-06-03
  • 2021-11-12
  • 2021-06-25
  • 2022-02-26
  • 2021-08-23
  • 2022-01-02
猜你喜欢
  • 2022-12-23
  • 2021-12-16
  • 2021-08-11
  • 2022-12-23
  • 2022-12-23
  • 2021-08-29
  • 2021-06-28
相关资源
相似解决方案