产生一个映射路径
有时候在做程序的时候,输出文件(运行程序) 依赖系统中别的应用程序安装的结果。但是我们又不想把别的程序安装到我们的输出目录来,
再加上对Debug 和Release的不同,所以,如果有一种方法可以简单的映射需要的文件夹到我们程序的输出目录,这样就比较方便了。
参考下面的命令,只需要放在project 的 Build Events里就可以了。以下命令将在TragetDir产生一个名字为{Name}的文件夹,该文件夹指向{Dest}实际存在的地方
REM Create a link to the {Dest} directory below so that the
REM executable will run on a developer's PC (this step isn't needed
REM on build machines, but it won't hurt either). I am creating this
REM link each time so that we can ensure the link is created after
REM a developer installs the {Dest} folder.
if exist "$(TargetDir){Name}" rd "$(TargetDir){Name}"
mklink /J "$(TargetDir){Name}" "{Dest}"
参考 http://technet.microsoft.com/zh-cn/library/cc753194(WS.10).aspx
在XP下应该也可以用junction命令
参见
http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx
mklink [[/d] | [/h] | [/j]] <Link> <Target>
posted on 2011-11-24 15:39 Levon Chen 阅读(132) 评论(0) 收藏 举报
浙公网安备 33010602011771号