Sign in Join
Wiki copytemporary

Multiple Lazarus: what changed

Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11## Multiple Lazarus instances
22
3-You can have one directory with Lazarus in it on your system or more. These directories can contain the same or different versions of Lazarus and can be made to work independent of each other (see the section dealing with **--primary-config-dir** below). Because you don't have to install Lazarus and the versions may be the same, the concept of having more than one Lazarus directory on your system will be called "multiple instances" in this article.\
4-Runthrough for Linux at [[DualLaz]].
3+You can have one directory with Lazarus in it on your system or more. These directories can contain the same or different versions of Lazarus and can be made to work independent of each other (see the section dealing with **\--primary-config-dir** below). Because you don't have to install Lazarus and the versions may be the same, the concept of having more than one Lazarus directory on your system will be called "multiple instances" in this article.
4+Runthrough for Linux at [[DualLaz]].
55
66## Important
77
8-- Make Backups of
9- - Your primary config (e.g. ~/.lazarus under Unix)
10- - Your projects *.lpi and *.lps
8+ * Make Backups of
9+ * Your primary config (e.g. ~/.lazarus under Unix)
10+ * Your projects *.lpi and *.lps
1111
1212## Who needs multiple Lazarus instances and who does not?
1313
14-You need multiple Lazarus instances...
14+You need multiple Lazarus instances...
1515
16-- to have several versions of Lazarus
17-- to have one Lazarus version compiled with several different versions of [[FPC]]
16+ * to have several versions of Lazarus
17+ * to have one Lazarus version compiled with several different versions of [[FPC]]
1818
19-You don't need multiple instances...
19+You don't need multiple instances...
2020
21-- to test your project with different [[Widgetset|widgetsets]]
22-- to [[Cross compiling|cross compile]]
21+ * to test your project with different [[Widgetset|widgetsets]]
22+ * to [[Cross compiling|cross compile]]
2323
2424## The Lazarus directory
2525
26-The Lazarus directory (i.e. the directory where the Lazarus application is) is overridable using --lazarusdir, this is useful when running Lazarus from e.g. USB sticks with varying mountpoints or driveletters.
26+The Lazarus directory (i.e. the directory where the Lazarus application is) is overridable using --lazarusdir, this is useful when running Lazarus from e.g. USB sticks with varying mountpoints or driveletters.
2727
2828## The config directory
2929
30-All IDE options for an instance are saved to a config directory. Under Linux, macOS and BSD the default config directory is ~/.lazarus. Note the beginning dot, which makes it a hidden directory.
31-
32-On Windows, settings are saved to the User AppData folder, which maps to a different directory depending on the Windows version (and language, in Windows XP and earlier). See also information here: Windows. Note that you won't see the configuration directory in Windows unless you select to see hidden and system files. To view the directory, type:
30+All IDE options for an instance are saved to a config directory. Under Linux, macOS and BSD the default config directory is ~/.lazarus. Note the beginning dot, which makes it a hidden directory.
3331
34-```dos
32+On Windows, settings are saved to the User AppData folder, which maps to a different directory depending on the Windows version (and language, in Windows XP and earlier). See also information here: Windows. Note that you won't see the configuration directory in Windows unless you select to see hidden and system files. To view the directory, type:
33+```
3534%localappdata%
3635```
3736
38-in the Start/Run box or in the address bar of Windows Explorer, which should bring you to the Local Application Data directory. For default installs, the settings are stored in the Lazarus directory shown there.
39-
40-| Operating System | Default location for the config directory | Remarks |
41-|----|----|----|
42-| Linux, macOS, BSD, other UNIXes | ~/.lazarus | Hidden directory |
43-| Windows XP | C:\Documents and Settings\\\<User name\>\Local Settings\Application Data\lazarus | English Windows; others may have different paths |
44-| Windows Vista and higher | C:\Users\\\<User name\>\AppData\Local\lazarus\\ | Regardless of selected language |
37+in the Start/Run box or in the address bar of Windows Explorer, which should bring you to the Local Application Data directory. For default installs, the settings are stored in the Lazarus directory shown there.
4538
46-The config directory can **not** be shared between different Lazarus versions. A newer Lazarus can read older configs and will update them automatically. There is no guarantee that an older version can read config files of a newer version. It is always a good idea to make a backup of your configs from time to time for time you might’ve change something weird and not know what it was.
39+Operating System | Default location for the config directory | Remarks
40+---|---|---
41+Linux, macOS, BSD, other UNIXes | ~/.lazarus | Hidden directory
42+Windows XP | C:\Documents and Settings\<User name>\Local Settings\Application Data\lazarus | English Windows; others may have different paths
43+Windows Vista and higher | C:\Users\<User name>\AppData\Local\lazarus\ | Regardless of selected language
44+
45+The config directory can **not** be shared between different Lazarus versions. A newer Lazarus can read older configs and will update them automatically. There is no guarantee that an older version can read config files of a newer version. It is always a good idea to make a backup of your configs from time to time for time you might’ve change something weird and not know what it was.
4746
4847### Solution for separating instances using multiple config dirs
4948
50-The config directory can be given on the command line with the --primary-config-path parameter (shorter version: --pcp). For example:
51-
52-``` bash
49+The config directory can be given on the command line with the --primary-config-path parameter (shorter version: --pcp). For example:
50+```
5351lazarus --primary-config-path=~/.lazarus2
5452```
5553
56-will start an IDE using *~/.lazarus2* as config directory. This way you can have an arbitrary number of config directories and start several independent Lazarus instances. As Lazarus creates the settings files from default if they don't exist, you can specify empty directories if you want.
57-
58-If you use this often, then a small shell script can be created:
54+will start an IDE using _~/.lazarus2_ as config directory. This way you can have an arbitrary number of config directories and start several independent Lazarus instances. As Lazarus creates the settings files from default if they don't exist, you can specify empty directories if you want.
5955
60-``` bash
56+If you use this often, then a small shell script can be created:
57+```
6158#!/bin/sh
62-/path/to/lazarus --primary-config-path=~/.lazarus2
59+ /path/to/lazarus --primary-config-path=~/.lazarus2
6360```
6461
65-In Windows you cannot use ~ so use instead, for example, a shortcut on the desktop with the following parameters to call Lazarus:
66-
67-``` bash
62+In Windows you cannot use ~ so use instead, for example, a shortcut on the desktop with the following parameters to call Lazarus:
63+```
6864\path\to\lazarus.exe --primary-config-path=lazarusconf
6965```
7066
71-This will place the lazarus configuration directory inside the lazarus directory.
67+This will place the lazarus configuration directory inside the lazarus directory.
7268
7369### Using lazarus.cfg file
7470
75-Another way for setting config directory is using a “lazarus.cfg" file and putting it into the folder with the Lazarus executable and putting this line into it :
71+Another way for setting config directory is using a `lazarus.cfg` file and putting it into the folder with the Lazarus executable and putting this line into it:
72+```
73+--primary-config-path=<path>
74+```
7675
77-``` bash
78---primary-config-path=\path\to\config\folder
76+or
7977```
78+--pcp=<path>
79+```
8080
81-You can make a config folder any where you like and set it's path to the cfg file. After that Lazarus will use this lazarus.cfg file and there is no need to make a shell script or use shortcut file with the —-pcp parameter.
81+Do not add quotes to the entire line (`"--pcp=path"`) or to the parameter value (`--pcp="path"`) - all content is read to the end of the line, even if it contains spaces. Quotation marks can be read as part of the path, which will lead to errors.
8282
83-For example, for a Windows installation it will be like this : A config folder and a lazarus.cfg file near the Lazarus executable and put a value like this for example into the cfg file :
83+You can make a config folder any where you like and set it's path to the `lazarus.cfg` file. After that Lazarus will use this file and there is no need to make a shell script or use shortcut file with the `--pcp` parameter.
8484
85-```Dos
85+For example, for a Windows installation it will be like this: a config folder and a `lazarus.cfg` file near the Lazarus executable and put a value like this for example into the cfg file:
86+```
8687--primary-config-path=C:\Lazarus2\config\
8788```
8889
89-And run Lazarus. It will ask for some config values and after that you can make a simple shortcut for later use without any parameters.
90+And run Lazarus. It will ask for some config values and after that you can make a simple shortcut for later use without any parameters.
9091
9192### Config directory files
9293
93-See the [[pcp|Primary Config Path]] page.
94+See the [[pcp|Primary Config Path]] page.
9495
95-*lazarus.dci* - stores the Lazarus Code Templates
96+_lazarus.dci_ \- stores the Lazarus Code Templates
9697
97-*editoroptions.xml* - information about colors, fonts and other editor options
98+_editoroptions.xml_ \- information about colors, fonts and other editor options
9899
99-*miscellaneousoptions.xml* - packages information
100+_miscellaneousoptions.xml_ \- packages information
100101
101-*environmentoptions.xml* - stores the history of opened projects and files (Recent Opened Files and Projects)
102+_environmentoptions.xml_ \- stores the history of opened projects and files (Recent Opened Files and Projects)
102103
103104## The Lazarus files
104105
105-The Lazarus source archive is contained in a single directory. You can simply compile Lazarus (eg, for [[Installing Lazarus on Linux|Linux]] or for [[Installing Lazarus on Windows|Windows]]) and a lot of files and subdirectories will be created, but and all will be below that single subdirectory.
106+The Lazarus source archive is contained in a single directory. You can simply compile Lazarus (eg, for [[Installing Lazarus on Linux|Linux]] or for [[Installing Lazarus on Windows|Windows]]) and a lot of files and subdirectories will be created, but and all will be below that single subdirectory.
106107
107-A Lazarus instance (sources and resources) is a single subdirectory. Just copy this directory and you get a whole new Lazarus instance.
108+A Lazarus instance (sources and resources) is a single subdirectory. Just copy this directory and you get a whole new Lazarus instance.
108109
109-You don't need to *install* Lazarus to be able to run it. But if you do indeed *install* Lazarus, you get some nice shortcuts on your desktop and some file types (e.g. lpk, lpi, pas) are associated with that Lazarus installation. These things are platform dependent. You can have only one formally installed Lazarus but secondary installs work just as well, typically you will start the one you want with a script or cd-ing to its own directory and starting it there. A formal install is typically added to your PATH so care might be needed, when using a secondary copy, that you don't get the 'on path' executable, some users prefer to have no formally installed copies for that reason, Lazarus, built from source works fine from its source directory.
110+You don't need to _install_ Lazarus to be able to run it. But if you do indeed _install_ Lazarus, you get some nice shortcuts on your desktop and some file types (e.g. lpk, lpi, pas) are associated with that Lazarus installation. These things are platform dependent. You can have only one formally installed Lazarus but secondary installs work just as well, typically you will start the one you want with a script or cd-ing to its own directory and starting it there. A formal install is typically added to your PATH so care might be needed, when using a secondary copy, that you don't get the 'on path' executable, some users prefer to have no formally installed copies for that reason, Lazarus, built from source works fine from its source directory.
110111
111-Newer installers support *installing* Lazarus multiple times. Alternatively, You can also add another Lazarus instance **manually** quite easily. Of course, file associations etc. can only be linked to one single Lazarus instance.
112+Newer installers support _installing_ Lazarus multiple times. Alternatively, You can also add another Lazarus instance **manually** quite easily. Of course, file associations etc. can only be linked to one single Lazarus instance.
112113
113114### Linux
114115
115-See the instructions for [[Installing Lazarus on Linux|Installing Lazarus from Source]] and repeat that as many times, each in a new directory, as you like. It often makes sense to use your distro provided version of FPC (as long as its up to date) and build your Lazarus from source. Don't bother to "install" Lazarus, its fine to just have it all in your own file space, cd into the desired directory and launch lazarus from the command line. Just make sure each Lazarus directory has its own config directory (and knows how to find it).
116+See the instructions for [[Installing Lazarus on Linux|Installing Lazarus from Source]] and repeat that as many times, each in a new directory, as you like. It often makes sense to use your distro provided version of FPC (as long as its up to date) and build your Lazarus from source. Don't bother to "install" Lazarus, its fine to just have it all in your own file space, cd into the desired directory and launch lazarus from the command line. Just make sure each Lazarus directory has its own config directory (and knows how to find it).
116117
117-If you do decide to have one or more Lazarus "installs", its a good idea not to have a package installed version as well. They tend to cause some PATH confusion.
118+If you do decide to have one or more Lazarus "installs", its a good idea not to have a package installed version as well. They tend to cause some PATH confusion.
118119
119-Find a 2015 run-through for Linux 64 bit at [[DualLaz]].
120+Find a 2015 run-through for Linux 64 bit at [[DualLaz]].
120121
121122#### Example 1 : A normally installed Lazarus instance plus the git version
122123
123-Download and install the Lazarus debian- & .rpm - packages as normal.
124-
125-Then download the Lazarus git archive to a directory of your choice, preferably somewhere in your home directory (e.g. ~/lazarus). See here [[Getting Lazarus|Getting Lazarus from the GitLab server]].
124+Download and install the Lazarus debian- & .rpm - packages as normal.
126125
127-Start your **secondary** Lazarus with:
126+Then download the Lazarus git archive to a directory of your choice, preferably somewhere in your home directory (e.g. ~/lazarus). See here [[Getting Lazarus|Getting Lazarus from the GitLab server]].
128127
129-```text
128+Start your **secondary** Lazarus with:
129+```
130130/home/you/lazarus/startlazarus --pcp=~/.lazarus2nd
131131```
132132
133133#### Example 2 : A normally installed Lazarus instance plus a manual copy
134134
135-i.e. you obtain two subdirectories:
136-
137-```text
135+i.e. you obtain two subdirectories:
136+```
138137/usr/lib/lazarus original copy via debian install
139-/home/you/lazarus secondary copy
138+ /home/you/lazarus secondary copy
140139```
141140
142-or you may look at:
143-
144-```text
141+or you may look at:
142+```
145143/home/you/development/lazarus original copy via fpcUP install
146-/home/you/lazarus secondary copy
144+ /home/you/lazarus secondary copy
147145```
148146
149-Download and install the Lazarus debian-packages as usual.
150-
151-Then copy the Lazarus directory to your home directory and change the ownership of the files:
147+Download and install the Lazarus debian-packages as usual.
152148
153-``` bash
149+Then copy the Lazarus directory to your home directory and change the ownership of the files:
150+```
154151cp -a /usr/lib/lazarus $(HOME)/
155-chown $USER:$USER -R $(HOME)/lazarus
152+ chown $USER:$USER -R $(HOME)/lazarus
156153```
157154
158-(Note: The chown line assumes that your group has the same name as your username. If not, replace \$USER:\$USER with your username:groupname)
159-
160-Now change your Lazarus desktop/menu shortcut to start the **secondary** copy
155+(Note: The chown line assumes that your group has the same name as your username. If not, replace $USER:$USER with your username:groupname)
161156
162-```text
157+Now change your Lazarus desktop/menu shortcut to start the **secondary** copy
158+```
163159/home/you/lazarus/startlazarus --pcp=~/.lazarus2nd
164160```
165161
166-Then start the IDE and change the environment options: Tools -\> Options -\> Environment / Lazarus directory to the **secondary** subdir, namely /home/you/lazarus
162+Then start the IDE and change the environment options: Tools -> Options -> Environment / Lazarus directory to the **secondary** subdir, namely /home/you/lazarus
167163
168-In recent Lazarus versions, you are also given a screen to name the other important paths, so you would name the secondary sudirs in the 2ndary config.
164+
165+In recent Lazarus versions, you are also given a screen to name the other important paths, so you would name the secondary sudirs in the 2ndary config.
169166
170-Also, inside the /home/you/development/fpc/bin/x86_64-linux/**fpc.cfg** text file, all paths should rather point to your secondary copy. To make sure everything is fine, run **startlazarus** from within xterm and watch the errormessages. make sure all paths are found (very difficult currently).
167+Also, inside the /home/you/development/fpc/bin/x86_64-linux/**fpc.cfg** text file, all paths should rather point to your secondary copy. To make sure everything is fine, run **startlazarus** from within xterm and watch the errormessages. make sure all paths are found (very difficult currently).
171168
172-You now have a secondary copy that which you can edit and recompile. Don't forget to close source files of the primary /usr/lib/lazarus.
169+
170+You now have a secondary copy that which you can edit and recompile. Don't forget to close source files of the primary /usr/lib/lazarus.
173171
174172### Windows
175173
176174#### Example 1: GIT and Release
177175
178-This is to have both GIT and last release version of Lazarus.
179-
180-1\) Install Lazarus last release and check setup option 'create desktop shortcut', you will get 'Lazarus.lnk' on the desktop.
176+This is to have both GIT and last release version of Lazarus.
181177
182-2\) Get Lazarus from GIT and compile, then create a shortcut on your desktop for 'lazarus.exe' and rename it to 'Lazarus GIT.lnk'.
178+1) Install Lazarus last release and check setup option 'create desktop shortcut', you will get 'Lazarus.lnk' on the desktop.
183179
184-Then you can set the config dir for each version editing the shortcut path to the executable:
180+2) Get Lazarus from GIT and compile, then create a shortcut on your desktop for 'lazarus.exe' and rename it to 'Lazarus GIT.lnk'.
185181
186-This is for release, because you don't change the primary config path parameter, the config will be saved in the default path:
182+Then you can set the config dir for each version editing the shortcut path to the executable:
187183
188-```dos
184+This is for release, because you don't change the primary config path parameter, the config will be saved in the default path:
185+```
189186C:\lazarus\startlazarus.exe
190187```
191188
192-For GIT, store the settings e.g. in the folder 'C:\lazgitcfg\\':
193-
194-```dos
189+For GIT, store the settings e.g. in the folder 'C:\lazgitcfg\':
190+```
195191C:\FPC\laz\startlazarus.exe --primary-config-path=C:\lazgitcfg
196192```
197193
198194## Installation of multiple Lazarus
199195
200196### Windows - Using the installer
201197
202-On Windows the installer (Version 1.1) can create a secondary installation. And it will ask for a folder to store the config.
198+On Windows the installer (Version 1.1) can create a secondary installation. And it will ask for a folder to store the config.
203199
204-- Install:
205- - Make sure you back up ALL your existing configurations BEFORE you install.
206- - AGAIN: Make sure you back up ALL your existing configurations BEFORE you install.
207- - After install check that the correct config is used\
208- See the file "lazarus.cfg" in the installation directory. And Menu "View" \> "IDE Internals" \> "About IDE"
209- - If you see a message about upgrading/downgrading the config, then the installation is incorrect. Press "Cancel"
210-- Usage
211- - Do not share packages between installations; rather you must have several independent copies of each package
212- - Backup lpi and lps files (if you share projects). Ideally store sessions (lps) in the "IDE config directory"\
213- Menu: "Project" \> "Project Options" \> Session
214-- Uninstall:
215- - If you plan to uninstall: back up everything again
216-- Update:
217- - If you plan to update, back up everything again
218- - After updating, check that the correct config is still being used\
219- See the file "lazarus.cfg" in the installation directory. And Menu "View" \> "IDE Internals" \> "About IDE"
200+ * Install:
201+ * Make sure you back up ALL your existing configurations BEFORE you install.
202+ * AGAIN: Make sure you back up ALL your existing configurations BEFORE you install.
203+ * After install check that the correct config is used
204+See the file "lazarus.cfg" in the installation directory. And Menu "View" > "IDE Internals" > "About IDE"
205+ * If you see a message about upgrading/downgrading the config, then the installation is incorrect. Press "Cancel"
206+ * Usage
207+ * Do not share packages between installations; rather you must have several independent copies of each package
208+ * Backup lpi and lps files (if you share projects). Ideally store sessions (lps) in the "IDE config directory"
209+Menu: "Project" > "Project Options" > Session
210+ * Uninstall:
211+ * If you plan to uninstall: back up everything again
212+ * Update:
213+ * If you plan to update, back up everything again
214+ * After updating, check that the correct config is still being used
215+See the file "lazarus.cfg" in the installation directory. And Menu "View" > "IDE Internals" > "About IDE"
220216
221-The Windows Installer is able to create secondary installations, which allows you to have different versions installed that do not interfere with each other.
217+The Windows Installer is able to create secondary installations, which allows you to have different versions installed that do not interfere with each other.
222218
223-All you need to do is tick the checkbox "secondary installation" (when choosing the install directory), and follow the instructions. You will then be asked for a new empty folder where the config will be stored (this can be a subfolder in the install directory).
219+All you need to do is tick the checkbox "secondary installation" (when choosing the install directory), and follow the instructions. You will then be asked for a new empty folder where the config will be stored (this can be a subfolder in the install directory).
224220
225-If you update an installation using the Windows Installer, it will detect when the selected directory contains a secondary install.
221+If you update an installation using the Windows Installer, it will detect when the selected directory contains a secondary install.
226222
227-In order to always be able to quickly see which IDE you are using, and also to check that the correct config is loaded, it is advisable to make changes to some visual attributes. A possibility is to change the gutter color in the editor.
223+In order to always be able to quickly see which IDE you are using, and also to check that the correct config is loaded, it is advisable to make changes to some visual attributes. A possibility is to change the gutter color in the editor.
228224
229225#### Windows - Adding a cross compiler install
230226
231-The installation packages for cross compilers can be added to secondary installations, too. However, they will currently give a warning that the folder is not empty. This warning can be ignored.
227+The installation packages for cross compilers can be added to secondary installations, too. However, they will currently give a warning that the folder is not empty. This warning can be ignored.
232228
233229# Visually distinguish
234230
235-To distinguish each Lazarus visually you can:
231+To distinguish each Lazarus visually you can:
236232
237-- Set a different color for the gutter - the left column of the source editor where the line numbers and break points are shown.
238-- Set the title of the IDE
233+ * Set a different color for the gutter - the left column of the source editor where the line numbers and break points are shown.
234+ * Set the title of the IDE
239235
240236---
241-*From the Free Pascal wiki, page "Multiple Lazarus", as it stood on 2023-11-08 after a change by Dbannon, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
237+*From the Free Pascal wiki, page "Multiple Lazarus", as the Internet Archive kept it on 2026-01-13, last changed on 2025-07-22. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history