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 returning Error even though key exists!!!
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
‎Aug 04, 2009
05:59 AM
RegDBGetKeyValueEx returning Error even though key exists!!!
Ok, first of all, this is a 64bit project (though I'm creating a 32bit version as well) that I'm trying to get to run on Server 2003 and 2008.
I need to retrieve the installation directory of Microsoft Dynamics CRM 4.0, both for later installation procedures, but also to determine if it is installed or not. However, RegDBGetKeyValueEx keeps returning an error, even though the key exists in the registry!
My code snippet:
**************************************
#define REGISTRY_FOLDER "SOFTWARE\\Microsoft\\MSCRM"
#define REGISTRY_ENTRY "CRM_Server_InstallDir"
function SetPathFromRegistry(hMSI)
begin
end;
*************************************
RegDBGetKeyValueEx keeps returning a very high negative number (minus 2xxxxxxxx something).
I tried using this code as well, courtesy of this community, to see what this would return:
*************************************
function CheckRequirements()
begin
end;
*************************************
But I get exact same issue, that the key doesn't exist!
What am I doing wrong???
Thanx . . .
Edit: The oddest thing is, I just tried to test a 32bit version and it seemed to work! So tomorrow I will go through the 32bit project and see if there are any differences or possibly just test it and convert it to 64bit...
I need to retrieve the installation directory of Microsoft Dynamics CRM 4.0, both for later installation procedures, but also to determine if it is installed or not. However, RegDBGetKeyValueEx keeps returning an error, even though the key exists in the registry!
My code snippet:
**************************************
#define REGISTRY_FOLDER "SOFTWARE\\Microsoft\\MSCRM"
#define REGISTRY_ENTRY "CRM_Server_InstallDir"
function SetPathFromRegistry(hMSI)
STRING strRegistryValue, strTemp, CrmID, szTemp;
NUMBER nvSize, nValueType, nResult;
NUMBER nvSize, nValueType, nResult;
begin
RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
if(RegDBGetKeyValueEx ( REGISTRY_FOLDER, REGISTRY_ENTRY, nValueType, strRegistryValue, nvSize) < 0) then
MessageBox ("MS CRM 4.0 is not installed on this Server! Aborting Installation...", SEVERE);
abort;
else
// Assign the path (with extra sub path) to the global CRMINSTALLDIR
strRegistryValue = strRegistryValue + "\\CRMWeb\\bin";
MsiSetProperty(ISMSI_HANDLE, "CRMINSTALLDIR", strRegistryValue);
endif;
if(RegDBGetKeyValueEx ( REGISTRY_FOLDER, REGISTRY_ENTRY, nValueType, strRegistryValue, nvSize) < 0) then
MessageBox ("MS CRM 4.0 is not installed on this Server! Aborting Installation...", SEVERE);
abort;
else
// Assign the path (with extra sub path) to the global CRMINSTALLDIR
strRegistryValue = strRegistryValue + "\\CRMWeb\\bin";
MsiSetProperty(ISMSI_HANDLE, "CRMINSTALLDIR", strRegistryValue);
endif;
end;
*************************************
RegDBGetKeyValueEx keeps returning a very high negative number (minus 2xxxxxxxx something).
I tried using this code as well, courtesy of this community, to see what this would return:
*************************************
function CheckRequirements()
NUMBER nReturn;
NUMBER nControl;
STRING svRegKey;
NUMBER nControl;
STRING svRegKey;
begin
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
svRegKey = "SOFTWARE\\Microsoft\\MSCRM";
if (RegDBKeyExist(svRegKey) < 0) then
MessageBox(svRegKey + "\n\n Does Not Exist",SEVERE);
else
SprintfBox(INFORMATION,"Key Exists","%s",svRegKey);
endif;
svRegKey = "SOFTWARE\\Microsoft\\MSCRM";
if (RegDBKeyExist(svRegKey) < 0) then
MessageBox(svRegKey + "\n\n Does Not Exist",SEVERE);
else
SprintfBox(INFORMATION,"Key Exists","%s",svRegKey);
endif;
end;
*************************************
But I get exact same issue, that the key doesn't exist!
What am I doing wrong???
Thanx . . .
Edit: The oddest thing is, I just tried to test a 32bit version and it seemed to work! So tomorrow I will go through the 32bit project and see if there are any differences or possibly just test it and convert it to 64bit...
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 04, 2009
08:22 AM
I researched your problem and found the following information from the link provided below. I'm not certain this pertains to your problem, but I'm hopeful it will help.
If you need to search the 64-bit areas of the registry (as opposed to the 32-bit WOW64 areas), you'll need to use something like REGDB_OPTIONS = REGDB_OPTIONS | REGDB_OPTION_WOW64_64KEY before your registry read. Don't forget to reset REGDB_OPTIONS as appropriate.
http://community.installshield.com/showthread.php?t=187742
If you need to search the 64-bit areas of the registry (as opposed to the 32-bit WOW64 areas), you'll need to use something like REGDB_OPTIONS = REGDB_OPTIONS | REGDB_OPTION_WOW64_64KEY before your registry read. Don't forget to reset REGDB_OPTIONS as appropriate.
http://community.installshield.com/showthread.php?t=187742
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 05, 2009
03:18 AM
Am trying this out later today . . .
***************
Edit:
Works like a charm - once again, many thanx 🙂
***************
Edit:
Works like a charm - once again, many thanx 🙂