Tuesday, June 30, 2009

Converting MSI Project from VS2005 to VS2008 - Welcome Back to (DLL) Hell

Just a few lines to outline something I've recently found out about converting msi projects from vs2005 to vs2008.

After upgrading to VS2008, we've been trying at work to convert everything to 2008. Everything built straightaway, "happy days", we thought.
Comes the first release of THE legacy product we start realizing something is not quite right - the msi is not overwriting all the dlls packaged as expected (this was the behavior on a vs2005 build, where everything was being replaced independently of the version). Also when spawning an msi installation as another process the installation fails and rolls back (which is a always a good crack).

After a bit of digging, looks like good old MS managed to sneak in and ship with vs2008 a fix to the RemoveExistingProducts sequence for msi projects whit the result that msis do not replace files on a vs2008 build unless the version number of the files is greater or has a wildcard in it (i.e x.x.x.*).

Possible solutions? there's plenty, here we go:
  1. Increase the msi project version every release to force an overwrite
  2. Increase single dlls versions (as a decent shop should do) where necessary
  3. Throw wildcards in all your dlls and go home happy

Great - but this doesn't seem to play quite right with COM interoperability where increasing version numbers or the wildcard trick doesn't seem to serve the purpose.

It's back to DLL Hell all over again, and it's time to get creative.

Good luck (any suggestion appreciated).

No comments: