Search code examples
windows-8windows-installercustom-action

Managed custom action not working in Windows 8 without .NET 3.5 installed


in my Visual Studio 2010 setup project, I have a managed Custom Action. It used to work great but will not on Windows 8 unless .NET 3.5 is installed. I can't force my users to have .NET 3.5 installed - well I could, but I'd lose customers.

I have a vague understanding that maybe it's not working with .NET 4 because the shim DLL (installutillib.dll) has a dependency on .NET 2?

Is there anything I can do to get it to work? I know managed CAs are frowned on by some, but need it to write a registry entry that depends on a bit of logic.

Thanks


Solution

  • Managed CA's using installutillib.dll are frowned upon. It's really bad stuff such as throwing modal 1001 error messages during silent/non-interactive installs, not supporting access to the MSI session, tattooing the MSIEXEC process with a CLR version (sticky) and many other horrible design shortcomings.

    Use Windows Installer XML (WiX) Deployment Tools Foundation (DTF) managed custom actions instead. It looks like a native custom action to the installer and has support for CustomAction.Config XML that expresses the SupportedRuntimes element.

    Deployment Tools Foundation (DTF) Managed Custom Actions

    And of course, odds are you don't need custom actions to do what you are trying to do. The Registry table supports [PROPERTY] expressions and the component it belongs to can use conditions to control installation or not.