哪位大哥知道:installshield里修改一个键值的函数是什么?例如:我要修改[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment]下的PATH的值。可是用RegDBSetKeyValueEx把PATH的值全部写成了全新的值了。哪位大哥告诉我,谢谢了!

解决方案 »

  1.   

    RegDBSetKeyValueEx()我修改的方法如下:
    首先  RegDBGetKeyValueEx(),得到PATH中的值,然后
    szEnv1 = szEnvi+“;”+"your env";
    最后  RegDBSetKeyValueEx()注意,写这个键值前,须使用 Disable(LOGGING)语句,写完后,
    须使用 Enable(LOGGING)语句,省得卸载时将PATH中的东西全都删除了
      

  2.   

    我的想法与你的想法也是一样,可是我用这个函数却得不到PATH里面的值!
    哎,悉死我了!
      

  3.   


    #define TITLE "RegDBSetKeyValueEx & RegDBGetKeyValueEx"   STRING szKey, szNumName, szNumValue, svNumValue, szTitle, szMsg;   NUMBER nType, nSize, nvType, nvSize;#include "ifx.h"program   // Create a key to test.   szKey = "TestKey";   if (RegDBCreateKeyEx (szKey, "") < 0) then      MessageBox ("RegDBCreateKeyEx failed.", SEVERE);      abort;   endif;   // Set up parameters for call to RegDBSetKeyValueEx.   szNumName  = "TestValue";   szNumValue = "12345";   nType      = REGDB_NUMBER;   nSize      = -1;   // Set a key name and a value associated with it.   if (RegDBSetKeyValueEx (szKey, szNumName, nType, szNumValue,                          nSize) < 0) then      MessageBox ("RegDBSetKeyValueEx failed.", SEVERE);      abort;   else      // Display what RegDBSetKeyValueEx has done.      szMsg = "%s set to: %s";      SprintfBox (INFORMATION, TITLE, szMsg, szNumName, szNumValue);   endif;   // Retrieve key value information.   if (RegDBGetKeyValueEx (szKey, szNumName, nvType, svNumValue,                          nvSize) < 0) then      MessageBox ("RegDBGetKeyValueEx failed.", SEVERE);   else      // Check to see if the value returned is the same as the value set.      if (nvType != REGDB_NUMBER) then         MessageBox ("Type comparison failed.", SEVERE);      endif;      if (svNumValue != szNumValue) then         MessageBox ("Subkey value comparison failed.", SEVERE);      endif;      // Display what RegDBGetKeyValueEx retrieved.      szMsg = "%s has value: %s\n\nThis data is %d bytes.";      SprintfBox (INFORMATION, TITLE, szMsg, szNumName, svNumValue, nvSize);   endif;   // Delete the created test key.   if (RegDBDeleteKey (szKey) < 0) then      MessageBox ("RegDBDeleteKey failed.", SEVERE);   endif;endprogram
      

  4.   

    得不到?奇怪,我怎么就可以呢?有没有:
        RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);      //设置根键    
      

  5.   

    试试
    "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment"也许可以得到
      

  6.   

    谢了! yzt001(yzt001) 这个键值是win98才有的!我要的是win2000的!实在是不知道怎么回事!没办法了!以上些东西,我都是写在一个函数里面,是不是有关系呢?
      

  7.   

    我的环境是W2000,INSTALLSHIELD6.2,运行的很好。写在一个函数中应该没有什么问题吧。