Showing posts with label installer. Show all posts
Showing posts with label installer. Show all posts

Saturday, September 6, 2008

Incrementing FileVersion for VC++

In a recent posting, I talked about solutions to incrementing the FileVersion in Visual Studio .NET for VB.NET and C# project. This need was motivated by the changes in VS2008 that requires a FileVersion to be changed before the Windows Installer will replace a file.

Some of my projects have Native DLLs that are compiled in VS 2008's VC++ compiler. These files has the same problem with the installer, yet the previous solution (http://dotnetref.blogspot.com/2008/09/auto-incrementing-file-version-in.html) did not address.

I found this very handy Add-In that works well with VS2008 (and previous versions) that will increment the FileVersion (Product Version, etc.) in the VC++ projects resource file.

http://www.codeguru.com/cpp/v-s/devstudio_macros/visualstudionet/article.php/c14981

Thursday, September 4, 2008

Auto-Incrementing the File Version in Visual Studio 2005 and 2008

*** Update - Since I made this post, I have found another tool that is simpler to use and also work with VS2010. See this http://autobuildversion.codeplex.com/

If this doesn't work for you, then you may with to view the info below:

The Setup and Deployment (Windows Installer) has a significant change between VS2005 and VS2008. In VS2008, a file will not be updated by the installer if the File Version has not changed. This pretty much breaks all of the VS2005 Installations I have created. There are various reasons for this, and I will let you read for yourself:

http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.vstudio.general&tid=c4c56abf-9bde-45ed-8737-90cf90514d89&cat=&lang=&cr=&sloc=&p=1

The solution to the problem is to increment the File Version (under Project Properties/Assembly Information) between Setup (.msi) builds. So, before every setup you create, you have to go manually update the File Version so the setup will update the file. Before, you just had to update the Version property in the Installer Project (and let it update the Product Code); you still have to do this (which is probably acceptable). I thought there must be someway to automatically increment the File Version since this change to the Installer breaks all of my setups; however, there is not (that I can find anyway). The only workable solution I have found is to use a BuildTask that updates the AssemblyInfo.vb (or AssemblyInfo.cs) before each build is made. This solution is a really complicated for something that was a checkbox in VB6 (as someone pointed out).

Here is the solution I tried and it does work:

http://www.codeproject.com/KB/dotnet/Auto_Increment_Version.aspx

Here is a similar solution:

http://weblogs.asp.net/bradleyb/archive/2005/12/02/432150.aspx