1.以代码方式打开XXX.rc
2.修改:
FILEVERSION 1, 0, 0, 1
PRODUCTVERSION 1, 0, 0, 1
为:
FILEVERSION 1, 0, 0, $WCREV$
PRODUCTVERSION 1, 0, 0, $WCREV$
3.修改:
VALUE "FileVersion", "1.0.0.1"
VALUE "ProductVersion", "1.0.0.1"
为:
VALUE "FileVersion", "1.0.0.$WCREV$"
VALUE "ProductVersion", "1.0.0.$WCREV$"
4.打开项目属性->生成事件->预先生成事件->命令行
添加:
copy $(ProjectDir)$(ProjectName).rc $(ProjectDir)_$(ProjectName).rc /y
subwcrev . $(Projectdir)$(ProjectName).rc $(Projectdir)$(ProjectName).rc
项目属性->生成事件->后期生成事件->命令行
copy $(ProjectDir)_$(ProjectName).rc $(ProjectDir)$(ProjectName).rc /y
编译后,build自动更新为SVN最后提交版本