Distributing Lazarus - Installers: what changed
Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | - | ||
| 2 | - | ||
| 3 | - | ||
| 4 | - | ||
| 5 | - | ||
| 1 | + | This page is for expert users who know how to use/install Lazarus and want to write an installer for a platform. | |
| 6 | 2 | ||
| 7 | - | ||
| 8 | - | ||
| 9 | - | ||
| 10 | - | ||
| 11 | - | ||
| 3 | + | If you have trouble installing Lazarus see [[Lazarus Documentation|Installation]]. | |
| 12 | 4 | ||
| 13 | 5 | # Primary and secondary config files | |
| 14 | 6 | ||
| 15 | - | ||
| 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). | |
| 16 | 8 | ||
| 17 | 9 | # Config files | |
| 18 | 10 | ||
| 19 | - | ||
| 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. | |
| 20 | 12 | ||
| 21 | - | ||
| 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. | |
| 22 | 14 | ||
| 23 | 15 | ## environmentoptions.xml | |
| 24 | 16 | ||
| 25 | - | ||
| 26 | - | ||
| 17 | + | Here is an example for the environmentoptions.xml: | |
| 18 | + | ||
| 19 | + | ``` xml | |
| 27 | 20 | <?xml version="1.0"?> | |
| 28 | - | ||
| 29 | - | ||
| 30 | - | ||
| 31 | - | ||
| 32 | - | ||
| 33 | - | ||
| 34 | - | ||
| 35 | - | ||
| 36 | - | ||
| 37 | - | ||
| 38 | - | ||
| 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> | |
| 39 | 32 | ``` | |
| 40 | 33 | ||
| 41 | 34 | **Notes:** | |
| 42 | 35 | ||
| 43 | - | ||
| 44 | - | ||
| 45 | - | ||
| 46 | - | ||
| 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. | |
| 47 | 40 | ||
| 48 | 41 | ## Changing/Creating a config file | |
| 49 | - | ||
| 42 | + | ||
| 43 | + | ``` pascal | |
| 50 | 44 | uses laz2_xmlcfg; | |
| 51 | - | ||
| 52 | - | ||
| 53 | - | ||
| 54 | - | ||
| 55 | - | ||
| 56 | - | ||
| 57 | - | ||
| 58 | - | ||
| 59 | - | ||
| 60 | - | ||
| 61 | - | ||
| 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; | |
| 62 | 56 | ``` | |
| 63 | 57 | ||
| 64 | - | ||
| 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. | |
| 65 | 59 | ||
| 66 | 60 | # Include third party packages | |
| 67 | 61 | ||
| 68 | 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. | |
| 69 | 63 | ||
| 70 | 64 | --- | |
| 71 | - | ||
| 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 |
