Jump to content
amit

Change Target Application Name depended on DIRECTIVE setting.

Recommended Posts

Hi,

I created project name A.   When I compile project I will get name A.exe.     I need to define some directive in source code and it will change the output  application name when it was compiled.   if it's possible to do that and how?

for example

Program A;
{$DEFINE B}
...
begin
..
end.

if I code it like this.   I need to have B.exe or AB.exe instead of A.exe when it was compiled.

 

Share this post


Link to post

@amit

 

you can try this way:

  1. create a bat file with your logic  ( you'll need define a enviroment var with your new-name, for example...)
  2. using the Post-Build event you can call it
rem --- OldName = full path + filename = c:\...\MyOldName.exe
set OldName=%1

rem --- NewName =  new file name       =  MyNewName.txt
set NewName=MyNewName.exe

rem ---------- renaming file -----------
ren  %OldName%  %NewName%  > texto.txt

 

 

image.thumb.png.a6cf7f5b0550132d854ebfe5b6bc145c.png

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×