Sign in Join
Wiki copytemporary

Distributing Lazarus - Installers: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: Distributing Lazarus - Installers

OldNewLine
1+This page is for expert users who know how to use/install Lazarus and want to write an installer for a platform.
2+
3+If you have trouble installing Lazarus see [[Lazarus Documentation|Installation]].
4+
5+# Primary and secondary config files
6+
7+For a multi user environment you can install default config files in the **secondary config path**. When a user starts the IDE, Lazarus will automatically copy these files to the primary config path. It does not copy all files; it copies each file when needed (i.e. the primary file does not exist).
8+
9+# Config files
10+
11+All config files are created on the fly. They only contain values that differ from defaults. Note: If they contain more, then it means there is no default or you found a bug.
12+
13+The easiest way to get the config files is to start an IDE, setup and install packages and then use the created configs. You should remove everything personal.
14+
15+## environmentoptions.xml
16+
17+Here is an example for the environmentoptions.xml:
18+
19+``` xml
20+<?xml version="1.0"?>
21+<CONFIG>
22+ <EnvironmentOptions>
23+ <Version Value="106"/>
24+ <LazarusDirectory Value="/usr/share/lazarus"/>
25+ <CompilerFilename Value="/usr/bin/fpc"/>
26+ <FPCSourceDirectory Value="/usr/share/fpcsrc/$(FPCVer)/fpc/"/>
27+ <MakeFilename Value="make"/>
28+ <TestBuildDirectory Value="/tmp"/>
29+ <DebuggerFilename Value="/usr/bin/gdb"/>
30+ </EnvironmentOptions>
31+</CONFIG>
32+```
33+
34+**Notes:**
35+
36+- **LazarusDirectory** can not contain any macro.
37+- **CompilerFilename** can use macros, sets the macro **CompPath**. You can not use the **FPCVer** macro, because the IDE fetches it from the compiler using the CompilerFilename.
38+- The other values can use macros.
39+- See [[IDE Macros in paths and filenames|Macros]], especially the **env** macro.
40+
41+## Changing/Creating a config file
42+
43+``` pascal
44+uses laz2_xmlcfg;
45+var
46+ cfg: TXMLConfig;
47+begin
48+ cfg:=TXMLConfig.Create('/home/username/.lazarus/environmentoptions.xml');
49+ try
50+ cfg.SetDeleteValue('EnvironmentOptions/LazarusDirectory/Value','/home/username/new/path/lazarus','');
51+ cfg.Flush;
52+ finally
53+ cfg.Free;
54+ end;
55+end;
56+```
57+
58+The IDE saves all file names as relative file names(except for history lists and some minor items). So stop the IDE, change the value in the xml and start the IDE and that's it. The IDE will automatically load the new lpk files, the new fpdoc files, etc.
59+
60+# Include third party packages
61+
62+If you want to use third party packages, you can put them somewhere and create a **lpl** file in **packager/globallinks**. You can put the package into the **components** directory or at a fixed location on the users machine.
63+
64+---
65+*From the Free Pascal wiki, page "Distributing Lazarus - Installers", as it stood on 2020-02-13 after a change by Trev, 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).*
66+Category: Lazarus internals

Back to history