How can I change a binary value in the registry?
Using Installshield function is very difficut to me.
Can someone please help me?
Thanks
This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Change Binary Restry value
Started by
Stefan Pauwels
, Oct 10 2002 09:41
3 replies to this topic
Posted 11 October 2002 - 10:32
Hi Stefan,
it is most important to put the hexadecimal values (bytes) in ascending order into a string array (don't forget: the very first index is 0)! This is a bit annoying if your binary values to set are of a rather long size. The registry entry has to exist prior to writing the bytes into the registry.
As an example with writing 3 bytes, try this:
Eberhard
it is most important to put the hexadecimal values (bytes) in ascending order into a string array (don't forget: the very first index is 0)! This is a bit annoying if your binary values to set are of a rather long size. The registry entry has to exist prior to writing the bytes into the registry.
As an example with writing 3 bytes, try this:
Code Sample |
STRING szKey, szName, szStrArray; NUMBER nType, nSize, nRet; RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE); //or wherever szKey = "SOFTWARE\\MyTestKey"; szName = "MyEntry"; nType = REGDB_BINARY; nSize = 3; szStrArray[0] = 0xAF; szStrArray[1] = 0xC3; szStrArray[2] = 0x00; //entry must exist, otherwise create it before with //RegDBCreateKeyEx(szKey, szName); nRet = RegDBSetKeyValueEx(szKey, szName, nType, szStrArray, nSize); //... etc |
Eberhard
Posted 11 October 2002 - 10:35
Hi Stefan,
it is most important to put the hexadecimal values (bytes) in ascending order into a string array (don't forget: the very first index is 0)! This is a bit annoying if your binary values to set are of a rather long size. The registry entry has to exist prior to writing the bytes into the registry.
As an example with writing 3 bytes, try this:
Eberhard
it is most important to put the hexadecimal values (bytes) in ascending order into a string array (don't forget: the very first index is 0)! This is a bit annoying if your binary values to set are of a rather long size. The registry entry has to exist prior to writing the bytes into the registry.
As an example with writing 3 bytes, try this:
Code Sample |
STRING szKey, szName, szStrArray; NUMBER nType, nSize, nRet; RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE); //or wherever szKey = "SOFTWARE\\MyTestKey"; szName = "MyEntry"; nType = REGDB_BINARY; nSize = 3; szStrArray[0] = 0xAF; szStrArray[1] = 0xC3; szStrArray[2] = 0x00; //entry must exist, otherwise create it before with //RegDBCreateKeyEx(szKey, szName); nRet = RegDBSetKeyValueEx(szKey, szName, nType, szStrArray, nSize); //... etc |
Eberhard