Jump to content


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.
Photo

Problem while facing a registry key


1 reply to this topic

new2is

new2is
  • Members
  • 5 posts

Posted 20 June 2006 - 04:40

I am trying to read the version of JRE (Java Runtime Environment) on a machine using the following code:
RegDBSetDefaultRoot( HKEY_LOCAL_MACHINE );
RegDBGetKeyValueEx( "Software//JavaSoft//Java Runtime Environment","CurrentVersion", nvType, szVersionString, nvSize);
switch (nvType)
case REGDB_STRING:
MessageBox("REGDB_STRING",INFORMATION);
case REGDB_STRING_EXPAND:
MessageBox("REGDB_STRING_EXPAND",INFORMATION);
case REGDB_STRING_MULTI:
MessageBox("REGDB_STRING_MULTI",INFORMATION);
case REGDB_NUMBER:
MessageBox("REGDB_NUMBER",INFORMATION);
case REGDB_BINARY:
MessageBox("REGDB_BINARY",INFORMATION);
default:
MessageBox("Other",INFORMATION);
endswitch;
/* Assign a value to IFX_INSTALLED_VERSION. */
MessageBox("Version of JRE on your machine is ", INFORMATION);
MessageBox(szVersionString, INFORMATION);

When I try to run on my machine(Win XP), the szVersionString is returning null. But when I see the registry, there is a value for "Current Version" of "1.5" and the data type is REG_SZ. My confusion is when I read the documentation, I don't see Installshield fn RegDBGetKeyValueEx returning REG_SZ datatype at all. What mistake am I doing?

new2is

new2is
  • Members
  • 5 posts

Posted 20 June 2006 - 07:58

I identified the problem - replaced forward slash with backward slash and it worked. Thanks.