PDA

View Full Version : x64 OS and Reading Registry



NewsArchive
02-25-2011, 12:50 AM
I am trying to read the registry in a x64 OS - I am using the Enable 64
Support function but it seems to not be working. See below. In the
Display Message Box, %IS_X64% is a one. When I issue the Get Registry
Key Value, it is returning my default (1.0) instead of the actual
version. What am I doing wrong?

TIA, Dee

! see if x64 system
Set Variable %IS_X64% to FUNCTION:Get System Info(WOW64 Status)
If %IS_X64% Equals "1" Then
Enable x64 Support
End
Display Message Box "%IS_X64% (1 = yes)" -- "Is it x64?"
Exit Installation()

! See if Pervasive (must be version 9.5 or greater) issue
Set Variable %PERVASIVE_ENGINE% to "SERVER"
! If Pervasive workgroup, get the version
Set Variable %PCC_VERSION% to FUNCTION:Get Registry Key Value
("VersionLevel") from "HKEY_LOCAL_MACHINE\Software\Pervasive Software
\Products\Pervasive.SQL Workgroup\InstallInfo"
If %PCC_VERSION% Version Equals "1.0" Then
! Not Pervasive workgroup, get server version
Set Variable %PCC_VERSION% to FUNCTION:Get Registry Key Value
("VersionLevel") from "HKEY_LOCAL_MACHINE\Software\Pervasive Software
\Products\Pervasive.SQL NT Server\InstallInfo"
Set Variable %PERVASIVE_ENGINE% to "SERVER"
Else
! Yes Pervasive workgroup
Set Variable %PERVASIVE_ENGINE% to "WORKGROUP"
End

! If x64, disable x64 support
If %IS_X64% Equals "1" Then
Disable x64 Support
End


--
Dee Witham
Professional Data Services, Inc

NewsArchive
02-25-2011, 12:54 AM
Darrel,

> I am trying to read the registry in a x64 OS - I am using the Enable 64
> Support function but it seems to not be working. See below. In the
> Display Message Box, %IS_X64% is a one. When I issue the Get Registry
> Key Value, it is returning my default (1.0) instead of the actual
> version. What am I doing wrong?

I don't know what you are doing wrong, but I have developed and attached a
simple x64 demo for you.

In Windows x64, the user name and user company ("RegisteredOwner" and
"RegisteredOrganization") are stored in the 32-bit and 64-bit registry keys.
The 32-bit values are set to "Microsoft" by default, and the 64-bit values
are set to your "real" name.

The attached script reads the "RegisteredOwner" and "RegisteredOrganization"
from the 32-bit and 64-bit Windows registry values.

Hope this helps.

Friedrich

NewsArchive
02-25-2011, 12:55 AM
Darrel,

BTW, is the Pervasive 9.5+ system a native 64-bit application? You only
have to read the 64-bit registry if that application is 64-bit. Otherwise,
the information is stored in the 32-bit branch of the registry.

Friedrich

NewsArchive
02-25-2011, 12:56 AM
Friedrich - thanks this explains why it is not working - thanks again.

Dee

--
Dee Witham
Professional Data Services, Inc

NewsArchive
02-25-2011, 12:56 AM
> Friedrich - thanks this explains why it is not working - thanks
> again.

You are welcome, Dee!

BTW, as I understand it, Pervasive 10+ supports both native 32-bit and
64-bit installations. I don't know if you support this version (v10 and
above), but in this case it makes sense to check both 32-bit and 64-bit
registry keys.

Friedrich