is there a "Lazarus.ini"? lazarus / 9-Editor ---------------------------------------------------------------------- Nicole · 2023-01-26 17:08 Yes, there is, but it does not contain, what I want to save. What I want to save is the configuration of the IDE, everything if I click (I hope these are the correct word in English): IDE- configuration and read: environment, editor,.... There I can set the position of my new methods as well as I can click, if I want to change the configuration of my icons. I searched a while for "ini" and "xml", but nothing seems to hold this information. Which file to backup to save this? Thanks. And a wish to Santa-Clause: What about an icon "backup my IDE- settings"? ---------------------------------------------------------------------- Martin_fr · 2023-01-26 17:32 The config is in the primary-config-path. And it is stored in several xml files. Default Linux: ~/.lazarus Win: C:\Users\USERNAME\AppData\Local\lazarus If non-default: Menu: View > Ide Internals > About Ide There is an optional lazarus.cfg (search wiki), that can be used to set an alternative primary-conf-path ---------------------------------------------------------------------- Martin_fr · 2023-01-26 17:35 Note, some xml files may contain absolute path (eg to the lazarus dir, or to fpc). So if you copy them to a 2nd install, you need to check those path. ---------------------------------------------------------------------- KodeZwerg · 2023-01-26 19:20 Quote from: Martin_fr on January 26, 2023, 06:32:02 pmWin: C:\Users\USERNAME\AppData\Local\lazarusNot when installed with fpcupdeluxe application but thanks god that you also wrote Quote from: Martin_fr on January 26, 2023, 06:32:02 pmIf non-default: Menu: View > Ide Internals > About Idethanks for that tip, I did not knew that one ---------------------------------------------------------------------- qk · 2023-01-26 19:53 Have you tried Desktops ? https://wiki.freepascal.org/IDE_Window:_Desktops ---------------------------------------------------------------------- Nicole · 2023-01-27 08:59 Thank you for all answers. To my mind: "desktop" does it all, but where is it? There is no file by such a name as the name I chose for it. About this deluxe Lazarus: Would this mean, that I have to start from the beginning again? Plain VM, all components new and setting all options again? ---------------------------------------------------------------------- CharlyTango · 2023-01-27 09:58 No, you don't really have to. You'll find Desktops under Menu: Tools - Desktops fpcupdeluxe is an advanced installer for Lazarus that also allows you to have multiple independent Lazarus installations on the same machine or VM. Leave your Lazarus installation as it is and download fpcupdeluxe in the latest version. I install my Lazarus instances like this: Create a directory where you want to put all instances. Mine is /lazarus Create another directory where you want to store one instance. for example /lazarus/laz224_fpc322_stable copy the exe or executable of fpcupdeluxe into the new directory and run it from there. When fpcupdeluxe is started choose the install directory (button "Set InstallDir") Be sure that the checkbox "GitLab" is checked and press the big button with the green thumbs up. You can play with the many installation options later. Get a cup of tea and let fpcupdeluxe do the work. Everything is fetched up to date from the net and compiled correctly. When fpcupdeluxe is done select the tab "Modules" and install OPM (Online Package Manager) with which you can later automatically fetch the necessary components from the net. In my opinion the best way to install Lazarus. You can delete your old Lazarus installation if needed by simply deleting the directory because Lazarus does not install anything outside of its directory. This way you can run different versions of Lazarus side by side. For example one with which you develop and another one in which you can look at the latest news (trunk). With a version change one can also let the old and new version exist until one really wants to change. ---------------------------------------------------------------------- TRon · 2023-01-27 10:08 Quote from: CharlyTango on January 27, 2023, 10:58:15 amYou can delete your old Lazarus installation if needed by simply deleting the directory because Lazarus does not install anything outside of its directory. afaik that is a untrue statement. The configuration of lazarus will be installed (by default) outside the Lazarus directory (and becomes a global setting). If you truly wish for Lazarus to be 'standalone' then start Lazarus with the --pcp option. You have to do that anyway if you are using multiple installations of Lazarus. Neglecting to do so will mess up your Lazarus configuration (between multiple installations). ---------------------------------------------------------------------- Martin_fr · 2023-01-27 10:11 The desktop settings are likely stored in one of the xml files. Make a backup, change desktop settings, save. Then diff to the backup. That should tell you. Editor Colors, and keymap are in EditorOptions.xml Take care when reusing EnvironmentOptions.xml => you may have to adjust some paths. ----------------- If you need more than one Lazarus install: https://wiki.freepascal.org/Multiple_Lazarus#Using_lazarus.cfg_file You create that lazarus.cfg once for each install, pointing to a new empty directory (or a dir containing some of the xml that you copied). You have to check the startup file from fpc deluxe. Maybe it already sets a config path?? Then you wouldn't need the lazarus.cfg. I don't use fpcupdeluxe, so I don't know. ---------------------------------------------------------------------- Nicole · 2023-01-27 17:14 Thank you for the explanation of best install. I'll keep this for a rainy day. What I do not understand: What will the deLuxe version do for me in points of backup? I want a KISS, keep it simple, keep it stupid. Only one installation. I am no programmer, but am forced programming to realize a project of mine. My idea is this: If there is a rainy day and I loose all my data, which files shall be found in my out-of-house-backup? They shall enable me to work on in the most quickest way how I was used to work. ---------------------------------------------------------------------- TRon · 2023-01-27 17:44 Quote from: Nicole on January 27, 2023, 06:14:51 pmWhat I do not understand: What will the deLuxe version do for me in points of backup? afaik nothing at all. fpcdeluxe is a very convenient way of installing FPC and/or Lazarus especially when targeting multiple targets (cross-compilers). It is very helpful for installing different versions of FPC/Lazarus and doing so in such a way that they can work independent of eachother. QuoteMy idea is this: If there is a rainy day and I loose all my data, which files shall be found in my out-of-house-backup? They shall enable me to work on in the most quickest way how I was used to work. 1. backup your own projects (better use a VCS for that). 2. backup your Lazarus/FPC configuration files 3. if you do not wish to redo your Lazarus install, then install/configure it once. Backup the whole thing and restore it in case of problems. Unfortunately 3 depends on what 3th party components you have installed. The IDE get recompiled each time you add/remove components and thus isn't stable. So, when you have Lazarus setup in a way that is stable enough for you then make a backup of the whole installation directory so that you can return to a state that you consider happy/stable. Personally I do not bother wrt 3. If all goes havoc I extract the source-code and rebuild Lazarus. ---------------------------------------------------------------------- Nicole · 2023-01-27 19:26 What is a "VCS"? From context it should be a third party provider. I have one and can recommend it very much: Personal Backup. This freeware was written by a Delphi-programmer for the purpose to backup - projects. It has all those filters for types, which we need for a slim backup. "slim", this is the word. "2. backup your Lazarus/FPC configuration files" - I have a backup of my colors and an instruction how to restore. Then I am back at the root of this question: Where are they? The ones I inspected, do NOT contain the work-intensive things as "where is the option which does...." There are hundreds of options and a dozens of them I changed. Some took me a day to find. I do not want to spend a week by re-searching. "3. if you do not wish to redo your Lazarus install, then install/configure it once. Backup the whole thing and restore it in case of problems." I can save the whole VM, - but it is that huge. And I may want to install the next version and keep my settings. It would be helpful if anybody can tell me at least: In which file are the desktops saved? About the xmls: I used a search-tool to find all xml - files. No one of it seemed to contain those environment-values. ---------------------------------------------------------------------- KodeZwerg · 2023-01-27 20:36 Quote from: Nicole on January 27, 2023, 08:26:58 pmWhat is a "VCS"?Version Control System ---------------------------------------------------------------------- TRon · 2023-01-28 08:35 Quote from: Nicole on January 27, 2023, 08:26:58 pmWhat is a "VCS"? KodeZwerg explained the acronym perfectly. It is a piece of software that allows you to take care of different revisions of your source-code files. That is called a repository and allows you to store the files that belong to a project either locally (local hard drive or network drive/server) or online. But, do not worry about it. If you have never heard of it before then I assume you are not familiar with it. In that case better leave that part alone for the moment. Just make sure you backup your project directories on a regular base. QuoteThen I am back at the root of this question: Where are they? The ones I inspected, do NOT contain the work-intensive things as "where is the option which does...." There are hundreds of options and a dozens of them I changed. Some took me a day to find. I do not want to spend a week by re-searching. Indeed there are hundreds of options. Some options are global options and some options are project based (can be changed for every project). That is also why Lazarus allows for some project related options to be generalized and stored in a more global manner so that you can re-use those settings by selecting your preferences when configuring an individual project. Sounds complicated but it isn't. You simply can set some options that you prefer and store that under different settings that you can use for every project (If you so wish so). And that brings us to you issue because what option is stored where depends entirely on which option you are referring to (and how you have that configured). Having said that all Lazarus (global) settings are stored inside the Lazarus configuration directory while project related settings are stored inside the directory of a project. Quote"3. if you do not wish to redo your Lazarus install, then install/configure it once. Backup the whole thing and restore it in case of problems." You can ofc opt to make a backup of your whole VM (depending on your VM there even might be a some sort of snapshot function available that takes a momentary snapshot of your installation that can be restored). But backing up your lazarus directory (plus configuration directory) should be enough. QuoteIt would be helpful if anybody can tell me at least: In which file are the desktops saved? I would have to look into that if you wish for a detailed answer but believe it was answered by another user (here or in one of the other threads that you opened on this subject). QuoteAbout the xmls: I used a search-tool to find all xml - files. No one of it seemed to contain those environment-values. Sorry, perhaps I missed something that you wrote earlier. Could you elaborate of what environment variables you speak of exactly ? fwiw: user Martin_fr is one of the Lazarus developers/maintainers so take what he writes into consideration carefully. If he does not know or has a hunch then we are all doomed ---------------------------------------------------------------------- Nicole · 2023-01-28 09:05 Thank you for the hint about Martin. I re-read his post and found a directory with xml-files not in Lazarus, but in C:\Users\.....\AppData\Local\lazarus Those files I opened and they do not like encouraging to be copied over a new installation. They contain paths and much more, which looks to become messy in a new environment. Martin: Is there anywhere a wish-List where I can place my with: "let me backup my default editor settings"? I am aware, that such a thing may be quite huge, because the code seems not to be prepared for it. ---------------------------------------------------------------------- Martin_fr · 2023-01-28 09:16 Editor settings (not window settings) are in EditorOptions.xml. And that file shouldn't have any path. Also many/most of the path can be (with a bit of once off work) made relative by using "($LazarusDir)". But also you can remove sections that contain paths, after copying the file. Then the rest of the file will still be used. Also path to fpc (and gdb, if still used) can be edited in the IDE if needed. ----------------- I suggest not to copy files (to another install) if that contain packages and their paths. ---------------------------------------------------------------------- Nicole · 2023-01-28 09:43 Thank you for your reply. The options, worth while saving, are not there. Options are e.g. "jump into" or "where to place new methods" and so much more you prefer to work with. All those looong lists, if you hit on "configuration"-icon (hope the word is the one in English). The file you mention reads like this and does not look worth while saving: Code: XML  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i                                                                                                                                                                                     ---------------------------------------------------------------------- Martin_fr · 2023-01-28 09:57 Maybe codetoolsoptions.xml ? I haven't checked though. I don't know from the top of my head what goes into which of the xml files. But as I said, if you backup before making changes, then a (folder-) diff will give you the answer. Lazarus does not store anything in the registry (innosetup does, but that is only for the unistaller) There are more xml file in the PCP. (And it Lazarus 2.3 there now also is debuggeroptions.xml). And the settings should be in those xml files. The one xml file you do not wont to copy: packagefiles.xml Because it's just paths. You can put it in a backup, if you restore all installed packages too (and to the exact same location). But a new install, you probably install the packages from scratch, and then packagefiles.xml will be an annoyance. If you have your own code templates, they are in lazarus.dci The other NON-XML files are likely better not copied to new installs. ---------------------------------------------------------------------- Nicole · 2023-01-28 11:46 We share our feelings. Me too, I think: These setting SHOULD be in one of those files. So I opened them one by one... and cannot find anything. and hm: I want a slim backup, not huge VMs and complete installations of versions. To save my projects takes 100 MB and 10 seconds. The idea was  to add one more line into the backup-routine to save the IDE-settings. ---------------------------------------------------------------------- dseligo · 2023-01-28 18:17 Quote from: Nicole on January 28, 2023, 10:43:55 amOptions are e.g. "jump into" or "where to place new methods" and so much more you prefer to work with. If by this you mean 'Jump directly to method body', then this option is in 'codetoolsoptions.xml' file. Write English names of options you want to save and I can look up in which file they reside. User color schemes are saved in 'userschemes' subdirectory. Changes to key mappings are in 'editoroptions.xml'. ---------------------------------------------------------------------- Nicole · 2023-01-30 11:21 My file "codetoolsoptions.xml" reads Code: XML  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i                         I doubt, that there is anything of verbose options saved inside. ---------------------------------------------------------------------- dseligo · 2023-01-30 12:43 Quote from: Nicole on January 30, 2023, 12:21:07 pmMy file "codetoolsoptions.xml" reads Code: XML  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i                         I doubt, that there is anything of verbose options saved inside. Option 'Jump directly to method body' is here under the key 'JumpToMethodBody'. ---------------------------------------------------------------------- Martin_fr · 2023-01-30 12:47 Quote from: Nicole on January 28, 2023, 10:43:55 am"where to place new methods" Well that looks like: Though not checked... But, you can test: change the option and see if this key/value follows your change. The only other option is a long search through the sources. There is no complete map or the like. ---------------------------------------------------------------------- Nicole · 2023-01-30 15:28 Please slowly for dummies: WHERE is it? Does xml hide anything? What I posted is the complete file. I do not see anything, which I would think, it is an user-set option. ---------------------------------------------------------------------- Martin_fr · 2023-01-30 15:49 Quote from: Martin_fr on January 30, 2023, 01:47:15 pmQuote from: Nicole on January 28, 2023, 10:43:55 am"where to place new methods" Well that looks like: Though not checked... But, you can test: change the option and see if this key/value follows your change. The only other option is a long search through the sources. There is no complete map or the like. is a user set option. - "UsesInsertPolicy"  is the key (the internal name of the option) - "Last" is the value set by the user (the internal value, not the display value). And I believe (yet not verifyied) it is the one that spceifies where new methods are inserted. All Options are either stored as Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i or Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i The names of the key are an internal representation. They usually have some (vague) association with the English description. Though if the description changed over time, then the Key may still be based on a completely different wording. ---------------------------------------------------------------------- lainz · 2023-01-30 15:49 I marked in the file with <----HERE----> Quote from: Nicole on January 30, 2023, 04:28:30 pmPlease slowly for dummies: WHERE is it? Does xml hide anything? What I posted is the complete file. I do not see anything, which I would think, it is an user-set option. Quote from: Nicole on January 30, 2023, 12:21:07 pmMy file "codetoolsoptions.xml" reads Code: XML  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i               <--------- HERE ---------->          I doubt, that there is anything of verbose options saved inside. ---------------------------------------------------------------------- Martin_fr · 2023-01-30 15:53 Tough actually "UsesInsertPolicy " may be for the "uses unit, unit, ...;" clause. Maybe your value for "method insert order" is the default. If you have a an option at its default value, then it is not stored in the config. ---------------------------------------------------------------------- Nicole · 2023-01-30 18:10 There are lots of options NOT default. This has been the reason of my posting. They work, - but I cannot see them in the named file. ---------------------------------------------------------------------- Martin_fr · 2023-01-30 19:36 Well then it is probably in one of the other xml files. Some options were originally displayed in a different category than today. And while the display may have changed, they are still in there old xml file. There are only 2 ways to find out: 1) go through the source code 2) change the option, close the IDE (to save the file / though most files are saved when you close the options dlg), check which file changed. ---------------------------------------------------------------------- Nicole · 2023-01-31 11:47 You are aware, that this is much more work, than setting the options again in a new installation? ---------------------------------------------------------------------- balazsszekely · 2023-01-31 12:14 @Nicole QuoteYou are aware, that this is much more work, than setting the options again in a new installation?Much more work? No more then 30- 60 seconds, if you are using the right tools like WinMerge. 1. After everything is set up in your current installation, just backup the xml files from: c:\Users\%USERNAME%\AppData\Local\lazarus\ to a separate directory 2. After a reinstall, compare the two directories with WinMerge to see which config files has changed 3. Double click the changed files, then use the Copy and Advance feature to sync the two files ---------------------------------------------------------------------- Nicole · 2023-01-31 15:50 30 seconds are really few. So it does not take more time, than writing this post, right? It would be great, if you can do this for me and tell me the correct file-name. Thanks. ---------------------------------------------------------------------- balazsszekely · 2023-01-31 17:21 Quote from: Nicole on January 31, 2023, 04:50:46 pm30 seconds are really few. So it does not take more time, than writing this post, right? It would be great, if you can do this for me and tell me the correct file-name. Thanks. I'm under the impression that you don't believe me.  Anyways I did the following: 1. Backup config files to d:\aaaa\ 2. Open Lazarus 3. Options->CoodTools->General-> Checked "Jump directly to method body"(see config1.png) 4. Close Lazarus 5. Drag drop the two directories inside WinMerge(see config2.png) 6. After pressing OK, WinMerge indicates that Codetools.xml has changed(see config3.png) 7. Double clicking Codetools.xml reveals the difference(see config4.png) It really didn't take longer then 1 minute and you can do the same for other settings. but remember you cannot overwrite configuration files(old installation->new installation), because they might contain absolute paths. You have to merge them otherwise you may corrupt your new installation. ---------------------------------------------------------------------- Nicole · 2023-01-31 17:50 Thank you for doing this. Never the less, you have only proven, that the file changes, if you open and close the IDE / change the options. But you have not proven, that this file contains the options, - what it evidently does NOT. ---------------------------------------------------------------------- balazsszekely · 2023-01-31 18:05 Quote from: Nicole on January 31, 2023, 06:50:45 pmThank you for doing this. Never the less, you have only proven, that the file changes, if you open and close the IDE / change the options. But you have not proven, that this file contains the options, - what it evidently does NOT. You're welcome! It was already mentioned in one of the previous posts that default values are not saved. This is an xml feature to preserve disk space. For the "JumpToMethodBody" node, the default value is false and if it's missing from the configuration file you can be certain that is false. Anyways to restore configuration settings from an old lazarus to a new one, all the above is irrelevant. You will check for differences, if JumpToMethodBody is missing from both files then you don't have to do anything, if it's present in the old config file but missing from the new one you have to do a simple merge. Of course it would be nice to have an Export/Import settings feature, but believe me there are far more important things to implement currently. You can give it a try if you like, I promise I will help. ---------------------------------------------------------------------- Nicole · 2023-01-31 18:42 The problem is: The value is TRUE and not the default-one. Never the less, we cannot see it. We should, shouldn't we? About the try: I would want to, but I am afraid, this is far from my ability. ---------------------------------------------------------------------- Martin_fr · 2023-01-31 18:49 Quote from: Nicole on January 31, 2023, 07:42:21 pmThe problem is: The value is TRUE and not the default-one. Never the less, we cannot see it. We should, shouldn't we? If you mean, it is not present in YOUR config, then maybe your config is stored in a non-default location? Quote from: Martin_fr on January 26, 2023, 06:32:02 pmThe config is in the primary-config-path. And it is stored in several xml files. Default Linux: ~/.lazarus Win: C:\Users\USERNAME\AppData\Local\lazarus If non-default: Menu: View > Ide Internals > About Ide ---------------------------------------------------------------------- Nicole · 2023-01-31 18:55 I mean, there is no file by this name on my HD containing it, because I did not go into the configuration, but used a search tool to grab the the file by name. ---------------------------------------------------------------------- dseligo · 2023-01-31 19:37 Quote from: Nicole on January 31, 2023, 07:42:21 pmThe problem is: The value is TRUE and not the default-one. Never the less, we cannot see it. We should, shouldn't we? About the try: I would want to, but I am afraid, this is far from my ability. If you don't install Lazarus every few days, I suggest you make a list of your changes, go through list and set up Lazarus manually. I do it like that, it takes less than 10 minutes. And this gives me a chance to browse settings and see if there are some new interesting options in new version. E.g. this is my list (it is autotranslated from my language with Google translate, so there could be errors): Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i - in IDE options/Environment/Files, I set it to remember the last 10-15 projects- in IDE options/Environment/Window I include all three that start with IDE title- in IDE options/Editor/Completion and Hints, I turn on 'Auto remove emty methods' and reduce the delay for hints (0.1-0.2s)- Editor/Key Mappings:   Remove these (the fastest way to search is by typing "Ctrl+Alt+" in search and then qwfgvbn:     - Ctrl Alt V (@) - View Debuger Event Log     - Ctrl Alt W (|) - View Watches     - Ctrl Alt F ([) - Toggle view Search Results     - also check G, N, Q     - Ctrl Alt B ({) - View Breakpoints   - change Toggle Comment in Selection to Ctrl + /   - add to Undo (Ctrl + Z) - Alt + Backspace   - in 'Toggle view Search Results' I put the button to the left of 1   - in 'Toggle view Messages' I put Shift+key to the left of 1- in IDE options/Environment/Form Editor I turn on 'Ask name on create' and 'Switch to Object Inspector Favorites Tab'- in IDE options/Editor/General turn off 'Half Page Scroll'- in IDE options/Editor/General/Tab and Indent under Comments and Strings in String I include 'Extend strings on linebreak'- in IDE options/Editor/Display I set 'Visible right margin' to 100 because I have slightly longer lines.- in IDE options/Codetools/Line Splitting I put 'Max. line length' to 100 - here completion wraps- in IDE options/Editor/Display/Colors in 'Brackets highlight' I turn on 'Background', change to 'Highlight' and set Alpha to 120- in IDE options/Codetools/Space, I include 'Symbol' in two places (at Insert space in front of and at Insert space after)- in IDE options/Editor/Display/Markup and Matches, I include If/then/else, For/do, While/do, With/do - if it annoys me, I can turn it off- in IDE options/Editor/Display/Markup and Matches, turn on Outline (global) - in Procedure and Begin/End (procedures) below, turn off Outline- in IDE options/Editor/Divider Drawing, I can set it if I want it to highlight the beginnings/ends of the blocks more, I haven't touched it yet- in IDE options/Editor/Code Folding you can include additional blocks that can fold (case, try, repeat, ...)- in IDE options/Code Tools there are interesting things, e.g. turn on 'Jump directly to method body'- in IDE options/Environment/Component Palette, I set the sequence- in IDE options/Editor/Display/Colors I created my color scheme - I have it in this directory: lazarus_schema_boja.xml   - I create the directory userschemes in the configuration (c:\users\damir\appdata\lazarus or e.g. c:\lazarus224\config), inside I copy the color scheme and then I will be able to choose ---------------------------------------------------------------------- Martin_fr · 2023-01-31 19:43 Quote from: Nicole on January 31, 2023, 07:55:36 pmI mean, there is no file by this name on my HD containing it, because I did not go into the configuration, but used a search tool to grab the the file by name. Afaik "AppData" is a hidden folder. So maybe it wasn't searched. ---------------------------------------------------------------------- Nicole · 2023-02-01 18:01 my search doesn't care about what windows wants to hide.