4
votes

I am trying to run a managed custom action in WiX 3.5 as a 64 bit process. All projects involved are configured to be built in x64 (as specified here). My understanding is that the key to this is the sfxca version. According to my build log, it is calling the x64 version properly.

"C:\Program Files (x86)\Windows Installer XML v3.5\bin\..\sdk\MakeSfxCA.exe" "C:\Projects\WiXInstaller\MyCustomActions\obj\x64\Debug\MyCustomActions.CA.dll" "C:\Program Files (x86)\Windows Installer XML v3.5\bin\..\sdk\x64\SfxCA.dll" "C:\Projects\WiXInstaller\MyCustomActions\obj\x64\Debug\MyCustomActions.dll" "C:\lib\wix35\Microsoft.Deployment.WindowsInstaller.dll;..\builds\source\OtherDll.dll;C:\Projects\WiXInstaller\MyCustomActions\CustomAction.config"

But when I run the installer, the log still says "Hello, I'm your 32bit Impersonated custom action server," and the custom action doesn't run correctly.

Specifically I am trying to run the 64 bit version of Powershell instead of the 32 bit version.

1
DTF ca's are set to Any CPU by default. The native hook is 32bit but the CA process is 64bit.Christopher Painter
I changed it from Any CPU to x64 specifically to force the correct sfxca version.TheWhitness
I'm not sure why it would matter. The sfxca is just used to start everything up and marshal the interop calls. I've run 64bit code without having to do this in the past.Christopher Painter
I'm not sure what's going on either. My research has given me the impression that I should have the 64 bit impersonated server available to me, but I can't get it to work.TheWhitness
I think that the hook still determines whether or not the managed portion is run in 64bit. I did figure out the problem, though, and it is stupid of me. Because I forgot to change a path, the custom actions were being compiled totally correctly but then the wix project was grabbing the old custom actions instead. Changing the hook to x64 did get the x64 version of PowerShell to run for me.TheWhitness

1 Answers

7
votes

If you explicitly compile your managed code to be 64-bit then DTF will correctly load your custom action into the 64-bit custom action server. By default managed code compiles to "Any CPU" which will cause your custom action to be loaded in the 32-bit custom action server.

Hope that helps!