This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Writing Binary Registry
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Mar 28, 2008
05:00 AM
Writing Binary Registry
Hi All!
I have a problem which I hope somebody know the answer....
I would like to write in the Registry of Windows a Binary Registry filled in with a decimal number converted to hexadecimal (for example, if I have in my program the number “1680”, in the Registry I will write “90 06 00 00” –because it is BIG ENDIAN).
My problem is that in InstallShield you can only use “Strings” to write in the Registry, although this is Binary, and then the function translate to ASCII code the number of the string. For example, if I have “1680” in the string, it writes “31 36 38 30”, even if I pass the number in binary “00000...11100....” It just will write the ASCII code of “0” and “1” all the times.
My question is: Is there any way to do with InstallShield what I need to do? (write binary numbers in the registry, not their ASCII codes)
Thank you very much in advance.
I have a problem which I hope somebody know the answer....
I would like to write in the Registry of Windows a Binary Registry filled in with a decimal number converted to hexadecimal (for example, if I have in my program the number “1680”, in the Registry I will write “90 06 00 00” –because it is BIG ENDIAN).
My problem is that in InstallShield you can only use “Strings” to write in the Registry, although this is Binary, and then the function translate to ASCII code the number of the string. For example, if I have “1680” in the string, it writes “31 36 38 30”, even if I pass the number in binary “00000...11100....” It just will write the ASCII code of “0” and “1” all the times.
My question is: Is there any way to do with InstallShield what I need to do? (write binary numbers in the registry, not their ASCII codes)
Thank you very much in advance.
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Mar 28, 2008
10:06 AM
Per the "Registry Table (Windows Installer)" documentation, it sounds like you want to write your value as a string prefixed with #x - e.g. #x90060000. See http://msdn2.microsoft.com/en-us/library/aa371168(VS.85).aspx for details.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Mar 28, 2008
11:52 AM
Thank you,
Do not worry, I finally could do it like this:
svHex[0] = 0x90;
svHex[1] = 0x06;
svHex[2] = 0x00;
svHex[3] = 0x00;
being svHex the String to use in RegDBSetKeyValueEx (szKey, "X Offset", REGDB_BINARY, svHex, 4)
if you want 0x90 etc...to be variables, you have to do:
sResult = "0x";
...
... (conditions)
sResult = sResult + "A"; (for example)
sResult = sResult + "9"; (for example)
...
StrToNumHex (nHex, sResult);
svHex[iCount] = nHex;
I tell that just in case it is useful for somebody 😉
Do not worry, I finally could do it like this:
svHex[0] = 0x90;
svHex[1] = 0x06;
svHex[2] = 0x00;
svHex[3] = 0x00;
being svHex the String to use in RegDBSetKeyValueEx (szKey, "X Offset", REGDB_BINARY, svHex, 4)
if you want 0x90 etc...to be variables, you have to do:
sResult = "0x";
...
... (conditions)
sResult = sResult + "A"; (for example)
sResult = sResult + "9"; (for example)
...
StrToNumHex (nHex, sResult);
svHex[iCount] = nHex;
I tell that just in case it is useful for somebody 😉