0
votes

I have a C# .NET Installer Class DLL being used by InstallShield 2011 to perform some custom code at the end of the installation process. The .NET Installer class is currently targeting .NET Framework 3.5.

When changing the .NET Installer class to target .NET Framework 4.0 and copy the new DLL to the InstallShield project, I am hitting an Error 1001 message when the custom installer code used to launch.

The test machine has the latest .NET Framework version installed.

Is there something that needs to change in InstallShield to specify the target version of the .NET Installer class?

2

2 Answers

1
votes

Windows installer reuses custom action sandboxes across custom actions. If one custom action fires up CLR 2.0 and another custom action tries to run with CLR 4.0 you'll get a BadImageFormatException. This is one of the many, many flaws with InstallUtil (Installer class ) custom actions.

Instead research Windows Installer XML (WiX) Deployment Tools Foundation (DTF) custom actions. They get encapsulated as native Win32 DLL custom actions and are compatible with InstallShield. Only native code runs in the sandbox and all managed custom action is run out of process with the native code acting as a proxy to the MSI API. (Something that an InstallUtil custom action can't even do believe it or not.)

Deployment Tools Foundation (DTF) Managed Custom Actions

-1
votes

In InstallShield, the .NET Framework File Location was not pointing to .NET 4.

This file location is specified in InstallShield - Tools - Options - .NET - .NET Framework File Locations.