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: RegDBGetKeyValueEx issue
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
‎Oct 12, 2012
12:24 PM
RegDBGetKeyValueEx issue
Hi All.
I have this script in my InstallScript, it used to work untill i upgraded to InstallShield Spring 2012) and now RegDBGetKeyValueEx function does not return me anything. I added the
Software\\Test\\Mytest key under HKEY_LOCAL_MACHINE and to TestString asssigned value "1111" in the registry.
Here is my script.
function QueryRegistry(hInstall)
NUMBER nvType,nResult,nvSize;
STRING svValue;
begin
//nType = REGDB_STRING;
nResult = RegDBSetDefaultRoot( HKEY_LOCAL_MACHINE );
nResult = RegDBGetKeyValueEx( "Software\\Test\\Mytest", "TestString", nvType, svValue, nvSize );
MessageBox(svValue, INFORMATION);
// if a string (REGDB_STRING) value was found (nResult = 0),
// set the value into an Installer property.
if ((nResult = 0) && (nvType = REGDB_STRING)) then
MsiSetProperty(hInstall, @REG_TEST_PROPERTY, svValue);
endif;
end;
Appreciate any help.
I have this script in my InstallScript, it used to work untill i upgraded to InstallShield Spring 2012) and now RegDBGetKeyValueEx function does not return me anything. I added the
Software\\Test\\Mytest key under HKEY_LOCAL_MACHINE and to TestString asssigned value "1111" in the registry.
Here is my script.
function QueryRegistry(hInstall)
NUMBER nvType,nResult,nvSize;
STRING svValue;
begin
//nType = REGDB_STRING;
nResult = RegDBSetDefaultRoot( HKEY_LOCAL_MACHINE );
nResult = RegDBGetKeyValueEx( "Software\\Test\\Mytest", "TestString", nvType, svValue, nvSize );
MessageBox(svValue, INFORMATION);
// if a string (REGDB_STRING) value was found (nResult = 0),
// set the value into an Installer property.
if ((nResult = 0) && (nvType = REGDB_STRING)) then
MsiSetProperty(hInstall, @REG_TEST_PROPERTY, svValue);
endif;
end;
Appreciate any help.
(5) Replies
‎Oct 12, 2012
12:59 PM
What is the nResult return value from RegDBGetKeyValueEx? If it's a large negative number, you can pass it to FormatMessage to get a system message string.
‎Oct 13, 2012
04:59 AM
You might want to try giving svValue a fixed size and then initialising nvSize before calling the function. Something like this perhaps:
svValue[MAX_STRING_SIZE]; // set MAX_STRING_SIZE to something suitable
nvSize = SizeOf( svValue ) - 1;
A lot of functions calls like this now require the size to be set correctly.
svValue[MAX_STRING_SIZE]; // set MAX_STRING_SIZE to something suitable
nvSize = SizeOf( svValue ) - 1;
A lot of functions calls like this now require the size to be set correctly.
‎Oct 17, 2012
09:13 AM
Given a large negative number return value, you can pass it to FormatMessage to get a system message string.