Page 1 of 1
Forcing writing registry key in 32bit location under 64bitOS
Posted: Tue May 18, 2010 3:57 pm
by Edhy
Hi,
I writing a registry key with the following command:
Write Registry Key HKLM\SOFTWARE\CompanyName\ProgramName\KeyName, $UNC_TARGETDIR$\myServer
On x86 OS they key is written in the correct place but under x64 OS like Windows 7 64bits it will create the key in this location:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\CompanyName\ProgramName\KeyName, $UNC_TARGETDIR$\myServer
Is there a way I can force IA to always write the key in the 32bit OS location of
HKEY_LOCAL_MACHINE\SOFTWARE\\CompanyName\ProgramName\KeyName, $UNC_TARGETDIR$\myServer
Re: Forcing writing registry key in 32bit location under 64b
Posted: Tue May 18, 2010 7:55 pm
by MichaelNesmith
I think you are asking if you can ask to the native 64 bit location and not the 32 bit compatibility location? Did you use Set x64 Mode to set 64 bit install mode?
Re: Forcing writing registry key in 32bit location under 64b
Posted: Tue May 18, 2010 9:19 pm
by Edhy
MichaelNesmith wrote:I think you are asking if you can ask to the native 64 bit location and not the 32 bit compatibility location? Did you use Set x64 Mode to set 64 bit install mode?
Hi Michael,
First, thanks for the prompt response.
You are right, setting x64 Mode to 64 bits give me the desired registry location "native 64 bit" but it introduced a problem with a 32bits activeX library which was marked as "File is Self Registering DLL" which worked fine in any OS mode, I unchecked this option and added the following command after Apply Install instruction:
Code: Select all
Register Library $WINSYSDIR$\SKCL.dll (get result into variable SKCL_REGISTERED)
That did not worked so I tried this:
Code: Select all
if Variable IS_OS_64_BIT Equals TRUE
Comment: If this is x64 OS then force to x86 to properly register 32 bits DLLs
Set Win32 - Native 32 bit Windows and Windows 32 on Windows 64 (WOW64) - installation mode
end
Register Library $WINSYSDIR$\SKCL.dll (get result into variable SKCL_REGISTERED)
MessageBox: $TITLE$, Registration of SKCL.DLL RESULTS:$NEWLINE$$NEWLINE$$SKCL_REGISTERED$
Still the Register Library is returning FALSE. Any suggestions?
Re: Forcing writing registry key in 32bit location under 64b
Posted: Tue May 18, 2010 10:03 pm
by MichaelNesmith
Use the script commands to swap in and out of 64 bit mode as necessary

Re: Forcing writing registry key in 32bit location under 64b
Posted: Tue May 18, 2010 10:14 pm
by Edhy
Thanks Michael, that worked!
The problem was that this DLL is installed in Windows\System32 and changing to 64bit the folder should be Windows\SysWOW64, I added the following command to manually register the dll and it worked:
Code: Select all
if Variable IS_OS_64_BIT Equals TRUE
Comment: If this is x64 OS then use the Windows\SysWOW64 to properly register the 32 bits DLLs
Register Library $WINDIR$\SysWOW64\SKCL.dll (get result into variable SKCL_REGISTERED)
else
Register Library $WINSYSDIR$\SKCL.dll (get result into variable SKCL_REGISTERED)
end
PS
I know I could probably have used the $TARGETDIR$ folder to install and register this file and it would have worked just fine, but I have many installations of this application and would like to keep the DLL under Windows folder.
