PDA

View Full Version : Need to change VSNET_PROJ_VER number format?


ambalboa
07-11-2007, 11:45 AM
I am able to retrieve the file version of a .vdproj file I am working with, but for some reason it is set to 1.1, instead of 1.0.0.1. I am trying to do a 'Run Script' step to add the two middle digits, but I am unable to do so. Also, I tried using the commands shown below to set the macro to a variable:

Set m = vbld_TempMacros()("VSNET_PROJ_VER")
Set m = vbld_TempMacros("VSNET_PROJ_VER")
Set m = vbld_TempMacroObj()("VSNET_PROJ_VER")

All of them fail. How can I change the version number format that is being retrieved from the 'VS.NET Get Version' step? Is is not possible?

kinook
07-11-2007, 12:31 PM
For setup projects, the VS.NET Get Version action retrieves the project's ProductVersion value. This is typically a three-segment version (i.e., 1.0.2), but the action simply retrieves the value as-is from the .vdproj file.
http://www.visualbuild.com/Manual/vs_netprojver.htm

To change the value of the macro set by the action, you can use code like (VBScript)

Set m = vbld_TempMacro("VSNET_PROJ_VER")
' given a macro value like 1.1, convert to 1.0.0.1
m.Value = Left(m.Value, 1) + ".0.0" + Mid(m.Value, 2)


http://www.visualbuild.com/Manual/systemscripts.htm
http://www.visualbuild.com/Manual/objectmodel.htm

ambalboa
07-11-2007, 02:17 PM
Yes, thank you. That works great.

Now, your comment made me think about the value as it is set in the .vdproj file. So, How do I increment that number? If it's a file version number, then all I need to do is place the filename of the .vdproj file, and check the "Update the File version" to increment it (using a 'Make VS.NET' step), right? Right now, I am building a .sln file and I only have "Update the File version" checked. Would this update the version number on the .vdproj also? I did this once, but it seems it only updates the version number of the .dll files that are created. Would a seperate 'Make VS.NET' step be needed to just increment that number, but not build it? Thank you for your help.

kinook
07-11-2007, 03:10 PM
Right, use a separate no-build Make VS.NET step to update the product version of the .vdproj file.