locked
How to do a Auto Increment of Version Numer while doing a Auto Build RRS feed

  • Question

  •   HI,

           how do i can increment version number  automatically after the Build.Im using Visual Studio 2008.I have set the DetectNewerInstallVersion=True and RemovePreviousVersion=True in the Setup Project properties. Still the version number is not incrementing. When we manually change the Version Number in the Deployment prj then its change ,but i need it to be done automatically after doing Auto Build in TFS.

     So while trying to install the msi im getting previous version is there in the system and i manually uninstall that version from Addandremove programs.

    Thank You,

    Tuesday, February 3, 2009 7:49 AM

Answers

  • Hi,

    Based on my understanding, you want to build the setup project with MSBuild and automatically increase the version of the MSI package, right?

    Unlike the VB.Net and C# project (XML based project file), setup project (.vdproj file) is not MSBuild formatted project file. Thus you cannot use MSBuild to build the setup project directly. Usually, we call Exec task to invoke devenv (Visual Studio) to build a setup project.

    When I change Version from 1.0.1 to 1.0.2 in Visual Studio and I found the different between the .vdproj file is list below (using WinDiff from Windows SDK). Changes are in bold style

            "ProductCode" = "8:{79523FF7-20E0-40A3-BA42-2CDEAA0DDB2C}"
            "ProductCode" = "8:{38B055DE-AD96-4B08-89DC-96417AF3BA55}"
            "PackageCode" = "8:{F16D8DE7-7A09-4532-B9DD-825D8AF33E81}"
            "PackageCode" = "8:{42D3558F-97CE-41B1-8E45-9951B98EBFCA}"
            "ProductVersion" = "8:1.0.1"
            "ProductVersion" = "8:1.0.2"

    One possible way is that you can write your own task to make these changes, and then call Exec task to build the setup project.

    Howerver, as WiX provide you a standard MSBuild formatted project, I recommend you use this toolset. 
    http://wix.sourceforge.net/

    Thanks,
    Rong-Chun Zhang.
    Please mark the replies as answers if they help and unmark if they don't.
    Thursday, February 5, 2009 10:18 AM