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
- :
- Code Working Differently on Win2K8 64-bit than Win7 32-bit
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
May 14, 2013
03:35 PM
Code Working Differently on Win2K8 64-bit than Win7 32-bit
Hi All,
I have a simple script that I'm running to detect if MS SQL Server 2008 R2 or better is installed on a machine before the installation proceeds. It seems to work just fine on my Windows 7 32-bit machine but fails on my Windows 2008 64-bit machine. What looks like is happening is that it's reading only part of the registry keys (100, 90, etc) under HKLM\SOFTWARE\Microsoft\Microsoft SQL Server. On Win2K8 64-bit it's breaking because it's skipping right over MSSQL10_50.xxxxx.
Any ideas what might be wrong? The SSRS section works fine.
// Create list of prereqs that may be missing from the machine.
//
// Microsoft SSRS
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
szMSSSRS = MSSSRS;
szSubKey = "SOFTWARE\\Microsoft\\Microsoft SQL Server";
listResults = ListCreate(STRINGLIST);
listPrereqs = ListCreate(STRINGLIST);
listPrereqsMissing = ListCreate(STRINGLIST);
nItem = REGDB_KEYS;
nResult = 0;
nStartRSVersion = 0;
nLengthRSVersion = 9;
nSSRSInstalled = -1;
szValidRSVersion = "MSRS10_50";
RegDBQueryKey(szSubKey, nItem, listResults);
// Get the first string in the list
nResult = ListGetFirstString(listResults, szString);
// Loop
while (nResult != END_OF_LIST)
// Extract characters from the current item in the list
StrSub(svSubStr, szString, nStartRSVersion, nLengthRSVersion);
if (svSubStr = szValidRSVersion) then
nSSRSInstalled = 0;
endif;
// Get the next item in the list
nResult = ListGetNextString(listResults, szString);
endwhile;
if (nSSRSInstalled != 0) then
ListAddString(listPrereqsMissing, szMSSSRS, AFTER);
endif;
// Destroy list
ListDestroy(listResults);
// Microsoft SQL Server 2008 R2
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
szSubKey = "SOFTWARE\\Microsoft\\Microsoft SQL Server";
listResults = ListCreate(STRINGLIST);
listPrereqs = ListCreate(STRINGLIST);
listPrereqsMissing = ListCreate(STRINGLIST);
nItem = REGDB_KEYS;
nResult = 0;
nStartSQLVersion = 0;
nLengthSQLVersion = 10;
nSQLServerInstalled = -1;
szValidSQLVersion = "MSSQL10_50";
szMSSQLServer2008R2 = MSSQLSERVER2008R2;
RegDBQueryKey(szSubKey, nItem, listResults);
// Get the first string in the list
nResult = ListGetFirstString(listResults, szString);
// Loop
while (nResult != END_OF_LIST)
// Extract characters from the current item in the list
StrSub(svSubStr, szString, nStartSQLVersion, nLengthSQLVersion);
if (svSubStr = szValidSQLVersion) then
nSQLServerInstalled = 0;
endif;
// Get the next item in the list
nResult = ListGetNextString(listResults, szString);
endwhile;
if (nSQLServerInstalled != 0) then
ListAddString(listPrereqsMissing, szMSSQLServer2008R2, AFTER);
endif;
// Destroy list
ListDestroy(listSubKeys);
I have a simple script that I'm running to detect if MS SQL Server 2008 R2 or better is installed on a machine before the installation proceeds. It seems to work just fine on my Windows 7 32-bit machine but fails on my Windows 2008 64-bit machine. What looks like is happening is that it's reading only part of the registry keys (100, 90, etc) under HKLM\SOFTWARE\Microsoft\Microsoft SQL Server. On Win2K8 64-bit it's breaking because it's skipping right over MSSQL10_50.xxxxx.
Any ideas what might be wrong? The SSRS section works fine.
// Create list of prereqs that may be missing from the machine.
//
// Microsoft SSRS
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
szMSSSRS = MSSSRS;
szSubKey = "SOFTWARE\\Microsoft\\Microsoft SQL Server";
listResults = ListCreate(STRINGLIST);
listPrereqs = ListCreate(STRINGLIST);
listPrereqsMissing = ListCreate(STRINGLIST);
nItem = REGDB_KEYS;
nResult = 0;
nStartRSVersion = 0;
nLengthRSVersion = 9;
nSSRSInstalled = -1;
szValidRSVersion = "MSRS10_50";
RegDBQueryKey(szSubKey, nItem, listResults);
// Get the first string in the list
nResult = ListGetFirstString(listResults, szString);
// Loop
while (nResult != END_OF_LIST)
// Extract characters from the current item in the list
StrSub(svSubStr, szString, nStartRSVersion, nLengthRSVersion);
if (svSubStr = szValidRSVersion) then
nSSRSInstalled = 0;
endif;
// Get the next item in the list
nResult = ListGetNextString(listResults, szString);
endwhile;
if (nSSRSInstalled != 0) then
ListAddString(listPrereqsMissing, szMSSSRS, AFTER);
endif;
// Destroy list
ListDestroy(listResults);
// Microsoft SQL Server 2008 R2
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
szSubKey = "SOFTWARE\\Microsoft\\Microsoft SQL Server";
listResults = ListCreate(STRINGLIST);
listPrereqs = ListCreate(STRINGLIST);
listPrereqsMissing = ListCreate(STRINGLIST);
nItem = REGDB_KEYS;
nResult = 0;
nStartSQLVersion = 0;
nLengthSQLVersion = 10;
nSQLServerInstalled = -1;
szValidSQLVersion = "MSSQL10_50";
szMSSQLServer2008R2 = MSSQLSERVER2008R2;
RegDBQueryKey(szSubKey, nItem, listResults);
// Get the first string in the list
nResult = ListGetFirstString(listResults, szString);
// Loop
while (nResult != END_OF_LIST)
// Extract characters from the current item in the list
StrSub(svSubStr, szString, nStartSQLVersion, nLengthSQLVersion);
if (svSubStr = szValidSQLVersion) then
nSQLServerInstalled = 0;
endif;
// Get the next item in the list
nResult = ListGetNextString(listResults, szString);
endwhile;
if (nSQLServerInstalled != 0) then
ListAddString(listPrereqsMissing, szMSSQLServer2008R2, AFTER);
endif;
// Destroy list
ListDestroy(listSubKeys);
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
May 15, 2013
05:06 PM
Since InstallScript runs in a 32-bit process, you will see only the 32-bit part of HKLM\Software on a 64-bit machine. To be able to see the 64-bit part, set REGDB_OPTION_WOW64_64KEY
in the REGDB_OPTIONS variable before accessing any HKLM\Software keys. Once you are finished with your registry checks, clear REGDB_OPTION_WOW64_64KEY
to ensure subsequent registry access for HKLM\Software is for the 32-bit registry. Please see the REGDB_OPTIONS help article for more information.
in the REGDB_OPTIONS variable before accessing any HKLM\Software keys. Once you are finished with your registry checks, clear REGDB_OPTION_WOW64_64KEY
to ensure subsequent registry access for HKLM\Software is for the 32-bit registry. Please see the REGDB_OPTIONS help article for more information.
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)