The project I'm working on right now is targeted at Windows NT 4.0 desktops. The fun and games to get the application running have been long and complicated. The .net framework won't run without an MDAC version below v2.6, but it does install and so the first sign of this you see is when you try to run your application and get an exception that can't be handled. The real fun however has been Crystal Reports.
When you build an installer for an application the installer detects the dependency and adds the merge module for Crystal, crystal_managed2003.msm. So I fire up my NT Virtual PC machine and install the MSI. Everything appears to work until you try to load a Crystal Report, when the litany of problems begins.
The first problem is dbghelp.dll, an image helper library which comes with Windows 2000 onwards. This is available as a download from microsoft.com, but having users run two installs is somewhat unsatisfactory. You can get around this by creating a new project in your solution, changing the output to Class Library then dropping a copy of dbghelp.dll into that project (the version from Windows XP will work just fine on NT4). Change the content type property for the dll to content. Now right click on your deployment project icon in Solution Explorer and choose "View File System". By default the system folder is not displayed, so right click on the file system tree and choose the "System Folder" option under the "Add Special Folder" menu. Now right click on the installer project icon in Solution Explorer and choose "Add / Project Output". Choose your new project from the Project drop down, the select "Content Files" and choose ok. You should now see a new item in your installer called Content Files from <projectname>. Click on the new item, change the Folder property to System Folder and change the Shared Legacy property to True. As you only want this file to be dropped on NT4 or Windows 98/ME systems you must set the condition property to the following;
(VersionNT>=400 AND VersionNT<500) OR (Version9x=410 OR Version9X=490)
Now we get a little bit further along. Next comes "Invalid or Missing KeycodeV2.dll". Crystal Reports needs extra merge modules manually added to the msi and the license number configured in the properties for Crystal_regwiz2003.msm. Crystal has published instructions on the files you need to add to your install project; these depend on your target system.
So now we can load the Crystal toolbar control, we have a valid license key (after missing a couple of characters <g>) and then comes the really fun error;
"The ordinal 58 could not be located in the dynamic link library atl.dll"
ATL is set of template-based C++ classes that removed some of the pain from writing COM objects. The version on my NT box was 2.00.7024, the version on my XP box was 3.5.2284.0. This is a proper system DLL, there's no simple dropping of this into your system directory and it needs to be properly registered. The problem is there were no merge modules for atl on my machine and I wanted everything in the same MSI. There were merge modules for atl7 and atl7.1, neither of which contains atl.dll. After much random searching google hit up installshield. Installshield are nice enough to provide a large list of merge modules for various Microsoft dlls, including a merge module for ATL. One download later, the addition of the merge module into the deployment project and finally Crystal Reports for .Net will load successfully on NT4.0.