开发者

How to check for an existing executable before running it in a post-build event in VS2008?

开发者 https://www.devze.com 2022-12-23 03:15 出处:网络
I\'m trying to use SubWCRev to get the current revision number of our SVN repository and pu开发者_C百科t it in a file so I can show it in the UI.

I'm trying to use SubWCRev to get the current revision number of our SVN repository and pu开发者_C百科t it in a file so I can show it in the UI.

As I'm working with a Web App, I use the following post build command line:

"SubWCRev.exe" "$(SolutionDir)." "$(ProjectDir)Content\js\revnumber.js.tpl" "$(ProjectDir)Content\js\revnumber.js"

It works great, but now I want to make sure I have SubWCRev before running it, so I can skip this post build if a fellow developer is not running TortoiseSVN.

I tried a few batch codes here, but couldn't figure this out.

Any ideas?

Thanks!


Maybe it is acceptable in your situation to add the following after the subwcrev.exe call:

SubWCRev.exe "$(SolutionDir)." ...
exit 0

That way Visual Studio does not know that the post build generated an error and the build is successful even if some developers do not have the subwcrev.exe. If you perform other things in the post build then my proposal is probably not suitable.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号