Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

change exe file name and output path

Tags:

delphi

Can I change the name of the compiled exe file and the output folder by Delphi source code. I know I can change that by editing of the "project Settings" by hand. I want to compile dunit testcases and whenever i use the GUItestrunner, I prefer a different outputfolder and exe file Name

{$ifdef guitestrunner}
CONST
   exename = ......
   exeoutfolder = ....
{$else}
   ....
{$ifend}

If i can get a solution for this problem. Any chance to create/compile both executables with ONE mouse click ?

like image 377
Franz Avatar asked May 18 '15 07:05

Franz


1 Answers

Can I change the name of the compiled exe file and the output folder by Delphi source code.

No you cannot. The output file name is determined by the name of the .dpr file.

Some options:

  1. Use one .dpr file, but use conditional compilation to produce the different variants of the project. Then have a post-build action that copies and renames the output file.
  2. Use one .dpr file for each variant of the project. With this latter approach you can have multiple projects contained in a single project group and then compile all projects in the group with a single IDE action.

My final piece of advice though is to learn how to script your builds. That will free you from the constraints of the IDE. You'll be able to automate repeatable build procedures and avoid the human mistakes that are made when operating a UI to perform repetitive tasks.

like image 130
David Heffernan Avatar answered Nov 12 '22 02:11

David Heffernan