Forcing writing registry key in 32bit location under 64bitOS

Got a problem you cannot solve? Try here.
Post Reply
Edhy
Posts: 138
Joined: Sun Jul 31, 2005 4:09 pm
Location: New York, USA

Forcing writing registry key in 32bit location under 64bitOS

Post 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
Edhy Rijo
Thom Child and Family Services
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Re: Forcing writing registry key in 32bit location under 64b

Post 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?
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Edhy
Posts: 138
Joined: Sun Jul 31, 2005 4:09 pm
Location: New York, USA

Re: Forcing writing registry key in 32bit location under 64b

Post 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?
Edhy Rijo
Thom Child and Family Services
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Re: Forcing writing registry key in 32bit location under 64b

Post by MichaelNesmith »

Use the script commands to swap in and out of 64 bit mode as necessary :)
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Edhy
Posts: 138
Joined: Sun Jul 31, 2005 4:09 pm
Location: New York, USA

Re: Forcing writing registry key in 32bit location under 64b

Post by Edhy »

Thanks Michael, that worked! :D

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. :wink:
Edhy Rijo
Thom Child and Family Services
Post Reply