Recent

Author Topic: How to set default options when installing Laz components?  (Read 4377 times)

Stephan P.

  • New Member
  • *
  • Posts: 14
How to set default options when installing Laz components?
« on: January 08, 2015, 12:03:28 pm »
Hi guys,

I'm fairly new to Lazarus, coming from Delphi. I'm currently porting a Delphi VCL component library to Lazarus.

I'm currently figuring out how I need to adapt my Delphi-specific installation procedure (using Inno Setup) for my components to Lazarus. One thing I don't know exactly how to do is how to provide default/custom environment options. Specifically, I want to set a system-wide (i.e. for all users of Lazarus) debugger language exception.

It seems to me that debugger language exceptions are stored in the .lpi files for each project, but where are the defaults stored that are used when a user creates a new project?

I hope this is the right (sub-)forum, I was looking for one that deals with deployment topics, but couldn't find one...

I'm currently using 1.2.4 on Windows (XP, 7, 8 ).

Thanks in advance for any pointers,

Stephan


typo

  • Hero Member
  • *****
  • Posts: 3051
Re: How to set default options when installing Laz components?
« Reply #1 on: January 08, 2015, 01:55:44 pm »
Maybe in the file "environmentoptions.xml" in Lazarus main directory.

Stephan P.

  • New Member
  • *
  • Posts: 14
Re: How to set default options when installing Laz components?
« Reply #2 on: January 08, 2015, 03:28:45 pm »
Maybe in the file "environmentoptions.xml" in Lazarus main directory.

Hmm, I'm not sure...

The language exceptions ignored by default in every newly created project are EAbort, ECodetoolError, and EFOpenError. I figured these 3 must be specified in some master/template option file somewhere too, right? But not in "environmentoptions.xml" in the Lazarus main directory...

Stephan


howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: How to set default options when installing Laz components?
« Reply #3 on: January 08, 2015, 04:42:34 pm »
They are hard coded near line 10320 in
.../lazarus/debugger/debugger.pp

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: How to set default options when installing Laz components?
« Reply #4 on: January 08, 2015, 05:50:08 pm »
- Open any project (or a new empty)
- Edit them in Tools/Options
- Go to Project/ProjectOptions
- Tick the chekbox "Save as default" (bottom of the dialog)
- Close dialog wint ox

Should do / not tested.

Otherwise "primary config path"  projectoptions.xml

e.g
C:\Users\martin\AppData\Local\lazarus\projectoptions.xml
~/.lazarus/projectoptions.xml

Stephan P.

  • New Member
  • *
  • Posts: 14
Re: How to set default options when installing Laz components?
« Reply #5 on: January 09, 2015, 09:47:07 am »
Hi Martin,

thanks for your quick reply.

- Open any project (or a new empty)
- Edit them in Tools/Options
- Go to Project/ProjectOptions
- Tick the chekbox "Save as default" (bottom of the dialog)
- Close dialog wint ox

Should do / not tested.

I tried it, it doesn't seem to work.

I also see a problem here. Options such as this (debugger language exceptions) could be set in 2 different ways:

a) As general IDE option (the way Delphi does it). This way it applies to every project. The option would be set in a IDE-specific config file, such as environmentoptions.xml.

b) As project-specific option, then there should be a transparent, configurable way to set defaults for new projects.

Since debugger language exceptions are more relevant for working in the IDE than anything else, I strongly favor a). As far as I know, this is also how Delphi has done it ever since.

Currently Lazarus uses a mix, as far as I can see, and that's a problem. The debugger language exceptions are set in Tools -> Options, so as such they should be assumed to be an IDE wide option, but are in fact stored for every project individually in the project's .lpi (!). Yet under Project -> Project Options there's no trace of them. I don't know what project specific options have to do in Tools -> Options, especially considering that they are *not* used as defaults.

But I am new to Lazarus, so I'm not sure if all these observations are correct...

Otherwise "primary config path"  projectoptions.xml

e.g
C:\Users\martin\AppData\Local\lazarus\projectoptions.xml
~/.lazarus/projectoptions.xml

Hum, I can't find any info on this... I created a projectoptions.xml file and put the <Debugging> section in, and the file does get added to by Lazarus, but they doesn't seem to be considered when a new project is created. And even if they would, this still leaves the inconsistency regarding the fact that they are normally set via Tools -> Options.

All the best,

Stephan

 

TinyPortal © 2005-2018