Recent

Author Topic: Can Lazarus Hold Different AppSettings for each Buuild Option  (Read 1343 times)

Josh

  • Hero Member
  • *****
  • Posts: 1344
Hi

I have an app that has numerous builds for simplicity say Prog1,Prog2,Prog3.

Each of these builds set various defines that customize the executable for a particular usage.
I can change the executable name to be x,y,z in project options for each build mode.
I can give each one its own title and icon in the lpr file.
ie
Code: Pascal  [Select][+][-]
  1. {$IFDEF Prog1}
  2. Application.Title:='Prog 1';
  3. Application.Icon.LoadFromFile('Icon_prog1.ico');
  4. {$endif}
  5. {$IFDEF Prog2}
  6.  Application.Title:='Prog 2';
  7.  Application.Icon.LoadFromFile('Icon_prog2.ico');
  8. {$endif}        



However what I wish is for each build mode to have its own version number and product name etc, but these seem to be global.

Any thoughts ideas.

The best way to get accurate information on the forum is to post something wrong and wait for corrections.

domasz

  • Hero Member
  • *****
  • Posts: 553
Re: Can Lazarus Hold Different AppSettings for each Buuild Option
« Reply #1 on: March 10, 2023, 01:33:30 pm »
Perhaps you don't need to put company name and version for the exe at all and instead just put company and version name in the title or in about dialog box?

zeljko

  • Hero Member
  • *****
  • Posts: 1668
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Can Lazarus Hold Different AppSettings for each Buuild Option
« Reply #2 on: March 10, 2023, 05:26:40 pm »
Hi

I have an app that has numerous builds for simplicity say Prog1,Prog2,Prog3.

Each of these builds set various defines that customize the executable for a particular usage.
I can change the executable name to be x,y,z in project options for each build mode.
I can give each one its own title and icon in the lpr file.
ie
Code: Pascal  [Select][+][-]
  1. {$IFDEF Prog1}
  2. Application.Title:='Prog 1';
  3. Application.Icon.LoadFromFile('Icon_prog1.ico');
  4. {$endif}
  5. {$IFDEF Prog2}
  6.  Application.Title:='Prog 2';
  7.  Application.Icon.LoadFromFile('Icon_prog2.ico');
  8. {$endif}        



However what I wish is for each build mode to have its own version number and product name etc, but these seem to be global.

Any thoughts ideas.

You can have different defines per build mode, so yes it's possible.

Josh

  • Hero Member
  • *****
  • Posts: 1344
Re: Can Lazarus Hold Different AppSettings for each Buuild Option
« Reply #3 on: March 11, 2023, 09:58:08 am »
Hi

I use buld modes for various builds, but buildmodes seems to be lacking, as it does not allow having different options for the ones highlighted.

So I was trying to find a way to adjust these at compile time from the lpr file.
« Last Edit: March 11, 2023, 10:00:40 am by Josh »
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

 

TinyPortal © 2005-2018