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
- :
- RegDBGetKeyValueEx does not work on Win Vista 64bit but works on Win 7 64bit
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
Feb 04, 2010
08:25 PM
RegDBGetKeyValueEx does not work on Win Vista 64bit but works on Win 7 64bit
Hello, I have InstallScript project to search for a registry key for 32bit application that can be installed on 64bit OS.
Registry key location is exactly the same on Win Vista 64bit and Win 7 64bit, but below script works correctly on Win 7 64bit only. It returns TRUE (= registry key not found, though it is there) on Win Vista 64bit.
Does RegDBGetKeyValueEx work differently on Win Vista and Win 7? or am I missing something here...?
** below script works correctly for both Win Vista and 7 32bit.
[SIZE="1"]--------------------------------------------------------------------------
Exported Registry information is identical for both 7 and Vista:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MATLAB\MCRPathDir]
"MCRPathDir"="C:\\Program Files (x86)\\MATLAB\\MATLAB Compiler Runtime\\v710\\runtime\\win32"
--------------------------------------------------------------------------
Registry key is located at:
#define MATLAB_CR_KEY_64 "SOFTWARE\\Wow6432Node\\MATLAB\\MCRPathDir"
--------------------------------------------------------------------------
function BOOL MATLABneeded()
NUMBER nvType, nvSize, nResult, nvSPnumber;
STRING svValue;
begin
if (SYSINFO.bIsWow64 != 0) then
REGDB_OPTIONS = REGDB_OPTIONS | REGDB_OPTION_WOW64_64KEY;
endif;
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
if (SYSINFO.bIsWow64 != 0) then //system is 64bit
MessageBox("DEBUG: 64bit OS, and the key I'm looking for is: " + MATLAB_CR_KEY_64, INFORMATION);
if (RegDBGetKeyValueEx(MATLAB_CR_KEY_64, "MCRPathDir", nvType, svValue, nvSize) != 0) then
MessageBox("DEBUG: This is 64-bit OS, MATLAB is not installed!", SEVERE);
return TRUE;
endif;
else
MessageBox("DEBUG: 32bit OS, and the key I'm looking for is: " + MATLAB_CR_KEY_32, INFORMATION);
if (RegDBGetKeyValueEx(MATLAB_CR_KEY_32, "MCRPathDir", nvType, svValue, nvSize) != 0) then
MessageBox("DEBUG: This is 32-bit OS, MATLAB is not installed!.", SEVERE);
return TRUE;
endif;
return FALSE;
endif;
if (SYSINFO.bIsWow64 != 0) then
REGDB_OPTIONS = REGDB_OPTIONS & ~REGDB_OPTION_WOW64_64KEY;
endif;
end;[/SIZE]--------------------------------------------------------------------------
Registry key location is exactly the same on Win Vista 64bit and Win 7 64bit, but below script works correctly on Win 7 64bit only. It returns TRUE (= registry key not found, though it is there) on Win Vista 64bit.
Does RegDBGetKeyValueEx work differently on Win Vista and Win 7? or am I missing something here...?
** below script works correctly for both Win Vista and 7 32bit.
[SIZE="1"]--------------------------------------------------------------------------
Exported Registry information is identical for both 7 and Vista:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MATLAB\MCRPathDir]
"MCRPathDir"="C:\\Program Files (x86)\\MATLAB\\MATLAB Compiler Runtime\\v710\\runtime\\win32"
--------------------------------------------------------------------------
Registry key is located at:
#define MATLAB_CR_KEY_64 "SOFTWARE\\Wow6432Node\\MATLAB\\MCRPathDir"
--------------------------------------------------------------------------
function BOOL MATLABneeded()
NUMBER nvType, nvSize, nResult, nvSPnumber;
STRING svValue;
begin
if (SYSINFO.bIsWow64 != 0) then
REGDB_OPTIONS = REGDB_OPTIONS | REGDB_OPTION_WOW64_64KEY;
endif;
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
if (SYSINFO.bIsWow64 != 0) then //system is 64bit
MessageBox("DEBUG: 64bit OS, and the key I'm looking for is: " + MATLAB_CR_KEY_64, INFORMATION);
if (RegDBGetKeyValueEx(MATLAB_CR_KEY_64, "MCRPathDir", nvType, svValue, nvSize) != 0) then
MessageBox("DEBUG: This is 64-bit OS, MATLAB is not installed!", SEVERE);
return TRUE;
endif;
else
MessageBox("DEBUG: 32bit OS, and the key I'm looking for is: " + MATLAB_CR_KEY_32, INFORMATION);
if (RegDBGetKeyValueEx(MATLAB_CR_KEY_32, "MCRPathDir", nvType, svValue, nvSize) != 0) then
MessageBox("DEBUG: This is 32-bit OS, MATLAB is not installed!.", SEVERE);
return TRUE;
endif;
return FALSE;
endif;
if (SYSINFO.bIsWow64 != 0) then
REGDB_OPTIONS = REGDB_OPTIONS & ~REGDB_OPTION_WOW64_64KEY;
endif;
end;[/SIZE]--------------------------------------------------------------------------
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Mar 12, 2010
09:22 AM
I have the same issue on Vista 64 (to be precise it's Windows 2008 64-bit). I try to use RegDBGetKeyValueEx and on all OSs it reads the entry correctly, but not on this OS.
My project is InstallScript (not MSI) and I have tried turning UAC off and running the setup.exe as Administrator, but still have the same results.
In the particular example I'm detecting whether the user has the IIS 6 Metabase compatibility option installed or not.
Did you find out why this was not working for you?
My project is InstallScript (not MSI) and I have tried turning UAC off and running the setup.exe as Administrator, but still have the same results.
In the particular example I'm detecting whether the user has the IIS 6 Metabase compatibility option installed or not.
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
// Check whether the Metabase registry key exists.
if (RegDBGetKeyValueEx("SOFTWARE\\Microsoft\\InetStp\\Components", "Metabase", nvType, svValue, nvSize) < 0) then// Display error to the user.
MessageBox("Error: Setup has detected that the IIS 6 Metabase Compatibility component is not installed.\n\nSetup is unable to continue.", SEVERE);
// Fail the requirement.
bvResult = FALSE;
endif;
Did you find out why this was not working for you?
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)