XE4:如何在平台上更改exe输出名称? [英] XE4: How to change exe output name base on platform?
问题描述
在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输出名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!