LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW 32-bit and Vista 64 Registry Read

Solved!
Go to solution

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.

 

 

0 Kudos
Message 1 of 11
(7,036 Views)

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.

0 Kudos
Message 2 of 11
(7,000 Views)

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.

0 Kudos
Message 3 of 11
(6,989 Views)
If you are an SSP subscriber, you can always go to ni.com/src and download the new 64bit version of LabVIEW, which will be able to pull registry entries using either the registry VI's or the System Exec.vi
Rob K
Measurements Mechanical Engineer (C-Series, USB X-Series)
National Instruments
CompactRIO Developers Guide
CompactRIO Out of the Box Video
0 Kudos
Message 4 of 11
(6,959 Views)
***If you have a serial number for 32bit version, you can use the same serial number to activate the 64bit version
Rob K
Measurements Mechanical Engineer (C-Series, USB X-Series)
National Instruments
CompactRIO Developers Guide
CompactRIO Out of the Box Video
0 Kudos
Message 5 of 11
(6,958 Views)
Solution
Accepted by topic author battler.

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.

Message 6 of 11
(6,950 Views)

Matthew, in Aussie we'd say "you're a bloody legend"!

 

Well done, thanks.

0 Kudos
Message 7 of 11
(6,922 Views)

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.

 

 

0 Kudos
Message 8 of 11
(6,718 Views)

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.

Message 9 of 11
(6,709 Views)

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

0 Kudos
Message 10 of 11
(5,565 Views)