CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2009
    Posts
    10

    Running batch script on build?

    I'm trying to use SubWCRev so that I can use subversion's revision number as part of the version number that is displayed in my program. Right now, I have to run SubWCRev manually everytime I want the version number to reflect the right revision number. I want to do this automatically -- perhaps have the execution of SubWCRev.exe triggered when my program is built.

    I'm using VC++2008. Is there any way to do this?

    Thanks!

  2. #2
    Join Date
    Jul 2002
    Posts
    2,543

    Re: Running batch script on build?

    There are number of places where you can add build-related actions.
    Open Project - Properties - Configuration Properties - Build Events. There are Pre-Build, Pre-Link and Post-Build events. Pre-Build event is used to prepare some files for compilation and linking. Post-Build event is used to do something with resulting executable files.
    It is possible assosiate some command with specific file. Right-click on any project file, select Properties - Custom Build Step. It is executed before project build.
    I don't know how SubWCRev.exe works. If it modifies source or .rc file, use Pre-Build or Custom Build step. If it modifies output executable, use Post-Build step.

  3. #3
    Join Date
    Jul 2009
    Posts
    10

    Re: Running batch script on build?

    Perfect, thank you. I copy and pasted the command line into Pre-Build event to do what I wanted.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured