09-01-2009 09:39 PM
Hi all,
Having a problem with reading the registry of a Vista 64-bit machine with a LabVIEW 8.X 32-bit EXE.
I've read a little about the issues. Can someone tell me is there a work around with LabVIEW 8.X?
I understand that Vista 64 divides the registry into a 32-bit and a 64-bit version. Is it not possible to access (read/write) the 32-bit version of the registry using a 32-bit app?
Cheers,
Battler.
Solved! Go to Solution.
09-02-2009 06:29 PM
Hi Battler,
With a 32 bit application you can read 32 bit entries and with a 64 bit app you can read 64 bit entries. However you can't mix them. This is the limitation of Windows because it doesn't actually name the two different sections differently. You can read more on this on the Microsoft support page.
09-02-2009 11:16 PM
David,
I understand that Windows Vista64 provides a 32bit and a 64bit registry.
I am trying to retreive the Machine GUID which is a registry entry
Software/Windows/Cryptography
Reading this key using a 32-bit compiled app in a 64-bit environment returns an empty string.
What are the options?
Cheers,
Battler.
09-04-2009 11:48 AM
09-04-2009 11:49 AM
09-04-2009 12:28 PM
I duplicated the whole hierarchy, but in this ZIp file is AIT - WinAPI - Open Registry Key (WOW64 Support).vi (in the WinAPI\Registry folder). It is almost a drop in replacement for the standard NI Open Registry Key VI (8.6).
It has one new option - Registry to Access. You can select Native, 32-bit, or 64-bit. Native is whatever bit level your app is running. So, LabVIEW 32-bit would access the 32-bit registry on a 64-bit OS. 32-bit and 64-bit access those specific registries.
If you try to run on a 32-bit OS, the VI will force you into Native mode. The VI checks for WOW64 support or 64-bit OS (note that a 32-bit application will not indicate it is running on a 64-bit OS, which is why we need to check for WOW64 support). Based on the registry to access and the OS, the code ORs the proper bits for the security access.
More info can be found via Google and MSDN.
09-04-2009 10:49 PM
Matthew, in Aussie we'd say "you're a bloody legend"!
Well done, thanks.
09-15-2009 11:56 PM
Matthew,
I do not currently have the ability to confirm functionality on a 64-bit machine.
My application is 32-bit. What I want to do is to read from the 64-bit registry when installed on a 64-bit machine. The registry entry I'm looking for on a 64-bit machine only resides in the 64-bit registry.
From your description, with your registry read VIs does this mean that I need to have separate 32-bit applications; one intended for 32-bit OS and another for the 64-bit?
Cheers,
Battler.
09-16-2009 06:47 AM
Well, it depends. On a 32-bit system, the Registry to Access input is effectively ignored and it will open the 32-bit registry all the time. So, you can wire the input to access the 64-bit registry, but when running on a 32-bit system, it will access the 32-bit registry.
I did this to get around having to do case statements everywhere in my code. In my case, the entries always existed (I was checking for installations of .NET and SQL Server), but if the 64-bit versions were installed, the registry entries were in the 64-bit reigistry, if 32-bit versions installed, it was in the 32-bit registry.
If you need to access different parts of the reigistry depending on the OS, then use the coe inside My Registry Open VI which checks for 64-bit OS. These are AIT - WinAPI - Check if Running as WOW 64.vi and AIT - WinAPI - Get OS Info (Basic).vi If the first VI returns True or the second VI or the second VI reports the processor architecture is x64, then you are running on a 64-bit OS. You ca use this result as the condition to a case statement to change how the program behaves.
03-29-2012 11:36 AM
I have an application running OK on 2 pc ..with XP (windows XP)
I just got a new PC with Windows 7 ....and 'open Registry key VI' fails and get errro -604
I tried al 3 cases : default, 64KEY, an 32KEY ... all of them fail