Question

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?

Était-ce utile?

La solution

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.

Autres conseils

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.

Usually you can not access the 64 bit registry from 32 bit applications. I have found some code, which is for PowerShell, that allows you to access the 64 bit registry through WMI: http://gallery.technet.microsoft.com/scriptcenter/6062bbfc-53bf-4f92-994d-08f18c8324c0

However, I'm not sure whether you can use this in Wise. You could use Windows Installer XML instead and have it create a 64-bit MSI.

I also use Wise and have to support both 32 and 64 bit windows. I have had some success using batch files to call reg.exe to delete and query 64 bit registry entries. You should be able to employ the same technique to add and modify the registry. I look for "program files(x86) to determine if it is 64 bit windows. If not, I use the native registry controls in wise, otherwise, I use the batch files with passed in parameters. Reg.exe should be in your path. go to a dos prompt and type reg /? to get the syntax.

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

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

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

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

You could also use

c:\Windows\SysNative\REG.exe ADD "HKLM\Software\Example" /v "Name" /t REG_SZ /d "Data"

This forces the use of the 64-bit version of reg.exe. Of course, that's not going to work if you're on a 32-bit OS. So you should put in a check for the OS type, and then call the proper reg.exe program (either c:\Windows\System32 for 32-bit OS, or C:\Windows\SysNative for 64-bit OS).

The environment variable PROCESSOR_ARCHITEW6432 will have the value of AMD64 if it's a 64-bit OS, and empty if 32-bit OS.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top