Writing to a 64-bit registry from a 32-bit installer

I have a 32-bit application and a 32-bit installer written in Wise Installation Studio. I know ... I should not use the Wise, and I should switch to something else. But now I'm stuck.

Our application uses graphics intensively and improves performance; we want it to disable desktop layout (Windows Aero) during operation. We performed this on 32-bit systems by adding an entry to the registry:

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

with value DISABLEDWM.

This sets the "Disable Desktop Layout" checkbox on the property compatibility tab for our EXE by default.

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

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

+5
source share
5 answers

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

, , EXE , .

+4

, , , REG ADD /reg:64, :

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

/reg:64 64- . , 32- , , , , .

+3

Wise 32, 64- . , reg.exe 64- . . " (x86), , 64- . , , . Reg.exe dos reg/?, .

I have regtest.bat which contains the following: reg.exe query% 1 / v% 2>% 3

The first parameter is the registry key, the second is the value, and the third is the text file it is written to.

My regdelete.bat file contains: reg.exe delete% 1 / f The parameter is the registry entry that you want to delete.

0
source

The problem still exists, although the query registry is with Reg.exe because when the bat file called by Wise, the reg query cannot find the 64-bit key (only the 32-bit key can be found).

0
source

All Articles