Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

two different versions of the same application [closed]

I have a software made with Delphi 2010 and it is required to be used from two different departments both of them share the same data and same UI except for some changes like hide/add buttons, forms and grid columns. Therefore it is required to have two versions of the same application.

It is not possible to prompt the user on application startup to select a department I must use separate EXEs.

What is the best approach (concept) to do that within Delphi 2010 or XE3 (will upgrade later) ? Is it possible to compile with different exe names ?

like image 667
zac Avatar asked Dec 01 '22 19:12

zac


1 Answers

Sounds like a maintenance nightmare, so please consider other solutions such as suggested in the comments like a login or settings file.

If you do want to make separate exe's then you could use compiler defines and based on the define in/exclude parts of the code:

Add a new configuration:

enter image description here

Add the define to the configuration: enter image description here

Use the define in your code:

{$IFNDEF ADVANCED}
   // Remove Event Handler
   Button1.OnClick := nil;
   // Hide Button
   Button1.Visible := False;
{$ENDIF}
like image 173
Remko Avatar answered Dec 10 '22 14:12

Remko