Writing to 64-bit registry from 32-bit installer

11,889

Solution 1

I'm not sure what possibilities Wise gives you regarding scripting, but the way to access the 64-bit registry from a regular program is to use KEY_WOW64_64KEY when manipulating the registry.

If it's a possibility to at the least run an external EXE file from the setup, it should solve your problem.

Solution 2

I am not sure if this solution was possible at the time this question was asked, but you can create a custom action that executes a REG ADD command and include the /reg:64 switch, like this:

REG ADD "HKLM\Software\Example" /v "Name" /t REG_SZ /d "Data" /reg:64

The /reg:64 switch will force it to the 64-bit registry. I am not entirely sure what this will do on a 32-bit system, but I expect it will probably be ignored.

Share:
11,889

Related videos on Youtube

Travesty3
Author by

Travesty3

Updated on June 04, 2022

Comments

  • Travesty3
    Travesty3 almost 2 years

    I have a 32-bit application and a 32-bit installer, written in Wise Installation Studio. I know...I shouldn't be using Wise and I should switch to something else. But for now, I'm stuck with it.

    Our application is graphics-intensive and to improve performance, we want it to disable desktop composition (Windows Aero) while running. We accomplished this on 32-bit systems by adding a registry entry at:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
    

    with a value of DISABLEDWM.

    This sets the "Disable desktop composition" checkbox in the compatibility tab of the properties for our EXE to be checked by default.

    This works perfectly on 32-bit systems, but when running the installer on a 64-bit system, Windows redirects the creation of registry entries to HKLM\SOFTWARE\Wow6432Node, and the flag is not set correctly. If I manually create an entry in the 64-bit registry view, then it works.

    So how can I force this registry key to be created in the 64-bit registry view from our 32-bit installer? Or is there a better way to set this property aside from creating a registry entry?

    • Christopher Painter
      Christopher Painter about 12 years
      Is that Wise project type an MSI installer?
    • Travesty3
      Travesty3 about 12 years
      @ChristopherPainter: I don't think so (not sure how to check). But the resulting installer has a .exe extension (not .msi). Any idea where to look for that in Wise Installation Studio?
  • Travesty3
    Travesty3 about 12 years
    Thanks. Looks like this is what we will have to do, at least until I can convince everyone else that it's worth it to spend some extra time migrating to a new installer.
  • E.T
    E.T over 7 years
    This is actually the proper way to do it. The accepted answer is valid for API calls but in this case, when using REG to add/delete a key the /reg:64 will do the trick.
  • Jeff
    Jeff over 4 years
    it works on a 32 bit OS too and just goes to the regular 32 bit registry if you specify /reg:64