I write this blog to share the solutions and problems I have found with fellow software engineers. I also do it to remind myself of what I've already figured out ;)

Tuesday, August 30, 2005

Deployment with Microsoft Installer Class and Custom Actions

The last week or so I've been working a lot on rolling out our data warehouse in a packaged deployment scenario. I've decided to use the built-in Microsoft Visual Studio .Net install project for our release packages. Unfortunately, the documentation on these projects is sparse, even in MSDN. I think it's because the project is a major upgrade from their previous install projects and fairly new. It is a nice product once you get the hang of it, but I'm sure there are many more bugs to iron out. Since the documentation is sparse, I'm collecting links of good info and plan to put them here. I'll be adding to the list as time goes on:

Default properties that can be passed to custom actions from Windows Installer

Friday, August 26, 2005

Microsoft Enterprise Library Deployment

In our current project, we have decided to use the Microsoft Enterprise Library to do things like connect to the database and configuration. Unfortunately, I wasn't on the project when the decision was made to use it and now we are left to deal with the decision's ramifications. The Enterprise Library tries to do everything and I believe goes a little, no a lot, overboard. There is just way too much code to slog through to figure out what the heck is going on, and I don't have the time to do it anyways. The documentation also leaves a lot to be desired.

One problem we have is deploying the Ent Lib to our production and staging environments. The reference material suggests signing it with a strong key and putting it in the GAC. Sounds like a good idea, but it takes you down a sinister path if you don't step carefully. The biggest pitfall is that the Configuration GUI that comes with Ent Lib uses all the assemblies that are in its current directory (C:\Program Files\Microsoft Enterprise Library June 2005\bin). If you downloaded the Ent Lib and had the assemblies built before giving them a strong name, then your .config files refer to the non-strong-named assemblies already in that directory. But, since you want to put everything in the GAC, you already re-built the assemblies with a key pair, right!!!?? Well, yes, but those assemblies still reside in the "C:\Program Files\Microsoft Enterprise Library June 2005\src\Configuration(or Common, etc.)\bin\Debug" directories. They need to be copied over to the directory that holds the executable for the GUI config application (C:\Program Files\Microsoft Enterprise Library June 2005\bin). There is a .bat file to do this in "C:\Program Files\Microsoft Enterprise Library June 2005\src" called, ironically enough, "Copy Assemblies.bat". So now the Config GUI will work correctly on new .config files in projects that reference the strongly-named assemblies, BUT it will fail on all your old .config files that were built with the non-strongly-named assemblies. You will have to delete those and start again. I did try changing the public-key token in all the .config files from null to the new public key, but still had problems getting the assemblies to bind together correctly. So I suggest you use the delete and build again method. Enjoy!!!