Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Registry.vcx / wow6432node

Status
Not open for further replies.

steve4king

IS-IT--Management
Feb 6, 2007
154
0
0
US
Apologies if this is elsewhere.. (Saw lots of registry entries.. but surprisingly nothing pertaining to this question)

My application will make use of a registry key at HKLM\Software\MySoftware
My installer correctly creates the key and string values at HKLM\Software\MySoftware\AppDir

However, when I use registry.vcx to access the key, it redirects "HKLM\Software\MySoftware\AppDir" to "HKLM\Software\Wow6432Node\MySoftware\AppDir"

According to this Software and all items within are by default "shared", not reflected or redirected in Windows 7(my current OS), but redirected but not reflected in Windows XP, vista, server2003 and others..

How can my application circumvent this redirection?

Code:
oReg = NewObject("Registry",HOME()+"FFC\REGISTRY")
lcKey = "SOFTWARE\MySoftware\CurrentInstall"
lcValueName = "AppDir"
lcValueData = ""

IF oReg.IsKey(lcKey, HKEY_LOCAL_MACHINE ) 
	oReg.OpenKey( lcKey, HKEY_LOCAL_MACHINE , .F.)
	oReg.GetKeyValue( lcValueName, @lcValueData)
	?lcValueData &&pulling from wrong key in wow6432node
ENDIF

-Stephen
 
This redirection is normal and doesn't hurt, because reading the key also is redirected. To write to the "normal" branch in the registry in a 64 bit system, your application would need to be 64 bit. And VFP is 32 bit won't benefit from 64 bit anyway.

So there is nothing to do, unless you say you have problems reading the key the installer writes. That wold possibly mean your installer creates a 64 bit MSI or setup.exe and that is bad also for reasons of writing third party components you'd need as 32 bit components in SysWOW64 into system32. so the solution would be to create a 32bit setup.

This redirection also is not noticeable, when you use regedit from SysWow64, so even if you intend to write a manual for user to configure your application within registry keys, you can use the same documentation for XP and older 32bit systems and Vista or later 32 or 64 bit systems, if you simply point 64 bit system user to use regedit from SysWow64.

Bye, Olaf.
 
Yes, the problem is that Fox cannot find the registry key that the innoSetup installer creates.. (Looking for a way to alter innoSetup now..)

To be clear, are you saying that since my fox application will be 32bit, I will only be able to read/write to the redirected(HKLM\Software\wow6432node\MySoftware) location?
This suggests that it's possible to define the registry key used, and
ms724859(v=vs.85).aspx
mentions enabling reflection (reflection being disabled by default for this in windows 7)

These would require altering the vcx..

I suppose it's not a HUGE issue, but since it will behave the same in both 64/32 environments, it would be easier for future technical support to find it in the same location on every OS.


-Stephen
 
It's possible to explicitly read 64 bit registry keys, that's true. But that would require your application to branch into different code in case of 32 bit or 64 bit OS to do different API calls, that's not favorable, is it?

"it would be easier for future technical support to find it in the same location on every OS." You still bark up the wrong tree, because if you want that, you want to use the same code for reading and writing keys and so you'd not enforce 64bit registry use but welcome the automatic redirection. To make it clear 32bit regedit will show the exact same physical key under HKLM\Software\MySoftware. That's why I said you'd not need to write two different documentations.

It should be possible to create a setup working as 32bit app, as that is best for installing a 32 bit app anyway. Make it live in the 32 bit subsystem of windows, and that is SysWoW64 (which abbreviates "System Windows32 on Windows64" and not "Wow, this system has 64 bits") and the wow6432node of the registry, as that is what the 32bit regedit system tool will show just as usual. So indeed writing into the "normal" HKLM\Software\MySoftware\ branch of the registry, you write into the 64 bit registry, which you shouldn't do as a 32bit application.

I just googled inno setup 32bit and found this: and this: So if you didn't explicitly specify to install as a 64bit architecture and write registry entries in the 64 bit registry, then I wonder how your installation did write to the 64bit registry.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top