XE4:如何在平台上更改exe输出名称?

编程入门 行业动态 更新时间:2024-10-24 18:22:51
本文介绍了XE4:如何在平台上更改exe输出名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在Delphi XE4中编译项目后,我仅需要输出可执行文件名称,例如MyApp32.exe和MyApp64.exe。

Simply I need output executable names like MyApp32.exe and MyApp64.exe after compiling my project in Delphi XE4.

我在论坛中找到了一个伪指令,{ $ LIBSUFFIX'32'},但似乎仅适用于dll。

I found a directive in the forum which is {$LIBSUFFIX '32'} but it seems it is only for dlls.

对可执行文件有任何建议吗?

Any suggestions for executable files?

谢谢。

推荐答案

最终的可执行文件名始终与项目文件名匹配。因此,要么创建共享公共源代码的单独项目,要么使用构建后事件调用编译后将输出文件复制并重命名到单独的部署文件夹的脚本,例如:

The final executable filename always matches the project filename. So either create separate projects that share common source code, or else use a Post-Build event to invoke a script that copies and renames the output file to a separate deployment folder after it has been compiled, such as:

copy /B "$(OutputPath)" "C:\Deployment\$(OutputName)$(MySuffix)$(OutputExt)"

其中在项目选项中定义了 MySuffix 的每个平台都有不同的值:

Where MySuffix is defined in the Project Options with a different value for each platform:

MySuffix=32

MySuffix=64

使用在单独的文件夹中,调试器仍然可以访问原始未重命名的可执行文件以进行调试和测试。

By using a separate folder, the debugger still has access to the original un-renamed executable for debugging and testing.

更多推荐

XE4:如何在平台上更改exe输出名称?

本文发布于:2023-11-16 21:12:02,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1607474.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:名称   如何在   平台上   exe

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!