如何在构建时将我项目目录中的文件复制到windows中的.exe文件目录 [英] how copy the file which in my project directory to the .exe file directory in windows when building

查看:164
本文介绍了如何在构建时将我项目目录中的文件复制到windows中的.exe文件目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用visual studio qt addin插件开发一个Windows桌面应用程序,我只想复制一个文件在项目目录中将'1.txt'命名为构建项目时
中exe文件的目录,我该怎么办,非常感谢!

解决方案

Princekin666,


感谢您在这里发帖。


  在其中添加具有复制任务的目标可以正常工作。打开.xxxproj文件(使用记事本编辑.xxproj或右键单击=>卸载项目=>在IDE中编辑
vcxproj),然后在文件底部添加一个名为copy的目标。 (注意:将此目标添加到< / project>节点上方)


       &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; 
< Target Name ="复制" BeforeTargets = QUOT;建立">
< Copy SourceFiles ="


(ProjectDir)\\ ttxt" DestinationFolder = QUOT;

(PROJECTDIR)\

I develop a windows desktop app using visual studio qt addin plugin,I just want to copy a file which named '1.txt' in the project directory to the directory which the exe file in when building the project, what should I do, thanks a lot!

解决方案

Hi Princekin666,

Thanks for posting here.

 Adding a target with a copy task inside it can work. Open your .xxxproj file (edit the .xxproj with notepad or right-click=>unload project=>edit vcxproj in IDE) , and add a target named copy at the bottom of the file. (Note:add this target above </project> node)

               
<Target Name="Copy" BeforeTargets="build">
<Copy SourceFiles="


(ProjectDir)\1.txt" DestinationFolder="


(ProjectDir)\


这篇关于如何在构建时将我项目目录中的文件复制到windows中的.exe文件目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆