Jump to content

SetupAPI on 64-bit platforms vs registry redirection


Recommended Posts

Hi everyone, I am facing a tricky case and I hope I can get some advice on how to deal with it.

Environment: Windows 7 x64, Windows XP x86

There is an installer that uses SetupAPI to install a program on a system. The program is a 32-bit application, it has an Explorer context menu plugin. It is a DLL that needs to be registered by creating a key in

HKLM\Software\Classes\CLSID

2 versions of the DLL exist, a 32-bit one for x86 platforms, and a 64-bit one for x64 platforms (AMD64, to be more specific).

This works as expected on 32-bit platforms, but on 64-bit platforms registry redirection kicks in, and instead the key is created in

HKLM\Software\Classes\Wow6432Node\CLSID

The context menu doesn't work, because Explorer.exe is a 64-bit process, hence it doesn't see that part of the registry.

Unfortunately I failed to find any resource that would indicate whether actions performed by setupAPI are subject to registry redirection or not. However, the documentation states that one can use decorators in the sections of the INF file. I assume that if an action is performed from a section that was decorated as "ntamd64", it would be executed without being altered by the redirection magic.

Unfortunately, my experiment brought me to the conclusion that the decorator is not having this effect; not only that - but it appears to be completely ignored (the key is not created in the "Wow6432Node" section either).

Here's an outline of my INF


[DefaultInstall.ntamd64]
RequiredEngine = Setupapi
CopyFiles = CopyFiles,CopyFiles.amd64
RunPreSetupCommands = Install_Certificate
RunPostSetupCommands= RunPostSetup,RunPostSetupRegistry_ntamd64
UpdateInis = CreateStartMenuFolder
CustomDestination = CustDestDir
AddReg = RegAdd, RegAdd_register, RegAdd64test
SmartReboot = N
;RegisterDlls = RegisterAddins

[RegAdd64test]
; .SKF file extension association and icon
HKLM, Software\Classes\CLSID\{A23zzzC51BC-5D02-45a2-A5F1-7775DB68FB84}, , ,"SKIntegr45 Class"

I suspect the problem is in the incorrect use of decorators, because the actions specified in "CopyFiles.amd64" are not performed either.

So, this boils it down to these questions:

  1. Is setupAPI subject to registry redirection?
  2. Why don't the decorators work as expected?

Any ideas will be greatly appreciated.

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...