Sunday, November 11, 2007

Distributing Visual C++ Applications

In recent years (and recent Visual Studio versions) Microsoft has unintentionally made it much harder to distribute C++ applications.

The reason for all the grief is a new dependency file MSVCR80.dll (Visual Studio 8.0/2005) or MSVCR90.dll (Visual Studio 9.0/2008). The DLL file handles initialization and cleanup of The C++ Standard Libraries among other things. If your swapping applications with another developer then you probably won't have a problem, but if you try to send your app to someone without the latest Visual Studio they're going to run into a nasty error message.

The solution Microsoft suggests for solving the problem they created is to wrap the Visual Studio redistributable in an installer. This is okay, but what if your program is too small to warrant an installer? Running a tutorials site, it doesn't make sense for users to have to install each demo application. My solution was to just compile under Visual C++ 6.0, which is arguably the best in the VC product line anyway.

References:
Deployment (C++)
http://msdn2.microsoft.com/en-us/library/zebw5zk9(VS.80).aspx

No comments: