VC automatic generation software version number

Source: Internet
Author: User
Tags tortoisesvn

VC automatic Generation software version number

Flyfish

Objective:

The version of the software has a major version number. The child version number. Revision number. Compile Version number

Where the compiled version number is automatically synchronized with the SVN server version number (Revision).

Environment

You need to install TORTOISESVN on this machine

The first step

Search for Vs_version_info Versioninfo in the project's. rc file

Follow the example below to change

#ifdef _auto_increment_version         fileversion2,0,4, $WCREV $         productversion2,0,4, $WCREV $ #else         fileversion2,0,4,1         productversion2,0,4,1#endif #ifdef _auto_increment_version         VALUE "FileVersion", "2.0.4. $WCREV $ "         value" ProductVersion "," 2, 0, 4, $WCREV $ "#else         value" FileVersion "," 2.0.4.1 "         value" ProductVersion "," 2, 0, 4, 1 "#endif


If you do not write the conditional compilation command #ifdef, #else, #endif change 2,0,4 directly, $WCREV $. The resource view of the VC could not be resolved $WCREV $.

Undefined keyword or key name: $WCREV $

Step Two

VC Environment Settings Project Properties-build event-Pre-build event command line

Copy the following two lines

C:\ProgramFiles\TortoiseSVN\bin\subwcrev.exe $ (SolutionDir) $ (ProjectDir) $ (ProjectName). RC $ (ProjectDir) $ ( ProjectName). rc_rc.exe/fo$ (ProjectDir) $ (IntDir) $ (ProjectName). res/d _auto_increment_version/d _afxdll$ ( ProjectName). rc_


C:\ProgramFiles\TortoiseSVN\bin\subwcrev.exe Change your own TortoiseSVN installation path

Tool 1:subwcrev.exe

SubWCRev.exe is TortoiseSVN's own tool, through the SubWCRev.exe command line tool in the Tortoisesvn\bin directory

Read the revision fixed version number of the server

Perform keyword substitution in the template to modify the synchronization local version number.

Command-line arguments

Subwcrev Workingcopypath [Srcversionfiledstversionfile] [-nmdfe]

Tool 2:rc.exe

Rc.exe is a resource compiler resourcecompiler that comes with VC.

Command-line arguments

RC [Options] Script-file

Options is the compile option, Script-file is the compiled script file

FO Create res file name

D Define a symbol for the preprocessor (preprocessor)

_afxdll means using MFC in a shared DLL

Macro Description

The directory of the $ (SolutionDir) solution (defined as drive + path), including the trailing backslash "\".

The directory of the $ (ProjectDir) project (defined as drive + path), including the trailing backslash "\".

The base name of the $ (ProjectName) project.

$ (IntDir) The directory path relative to the project directory specified for the intermediate file. it resolves to the value of the "Intermediate Directory" property.

Reference links

Using RC (the RC Command line)

Macros that generate commands and properties

The Subwcrev Command Line


VC automatic generation software version number

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.