Community Forums
Page 1 of 2 12 LastLast
Results 1 to 5 of 6

Thread: RegDBGetKeyValueEx issue

  1. #1
    Join Date
    Mar 2012
    Posts
    12

    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.

  2. #2
    Join Date
    Oct 2001
    Location
    Here and there
    Posts
    16,243
    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.

  3. #3
    Join Date
    Oct 2006
    Location
    Stroud, Glos. U.K
    Posts
    165
    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.

  4. #4
    Join Date
    Mar 2012
    Posts
    12
    Hello guys, thank you for reply.
    When calling the function RegDBGetKeyValueEx() i am getting error code -2147024894.
    Please help.

  5. #5
    Join Date
    Oct 2001
    Location
    Here and there
    Posts
    16,243
    Given a large negative number return value, you can pass it to FormatMessage to get a system message string.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •