Difference between revisions of "Distributing Lazarus - Installers"

From Lazarus wiki
Jump to navigationJump to search
Line 13: Line 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.
 
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.
 +
 +
==environmentoptions.xml==
  
 
Here is an example for the environmentoptions.xml:
 
Here is an example for the environmentoptions.xml:
Line 36: Line 38:
 
*The other values can use macros.
 
*The other values can use macros.
 
*See [[IDE_Macros_in_paths_and_filenames|Macros]], especially the '''env''' macro.
 
*See [[IDE_Macros_in_paths_and_filenames|Macros]], especially the '''env''' macro.
 +
 +
==Changing/Creating a config file==
 +
 +
<Delphi>
 +
uses laz2_xmlcfg;
 +
var
 +
  cfg: TXMLConfig;
 +
begin
 +
  cfg:=TXMLConfig.Create('/home/username/.lazarus/environmentoptions.xml');
 +
  try
 +
    cfg.SetDeleteValue('EnvironmentOptions/LazarusDirectory/Value','/home/username/new/path/lazarus','');
 +
    cfg.Flush;
 +
  finally
 +
    cfg.Free;
 +
  end;
 +
end;
 +
</Delphi>
  
 
=Include third party packages=
 
=Include third party packages=
  
 
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.
 
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.

Revision as of 17:58, 4 February 2012

This page is for expert users who know how to use/install Lazarus and want to write an installer for a platform.

If you have trouble installing Lazarus see Installation.

Primary and secondary config files

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).

Config files

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.

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.

environmentoptions.xml

Here is an example for the environmentoptions.xml:

<?xml version="1.0"?>
<CONFIG>
  <EnvironmentOptions>
    <Version Value="106"/>
    <LazarusDirectory Value="/usr/share/lazarus"/>
    <CompilerFilename Value="/usr/bin/fpc"/>
    <FPCSourceDirectory Value="/usr/share/fpcsrc/$(FPCVer)/fpc/"/>
    <MakeFilename Value="make"/>
    <TestBuildDirectory Value="/tmp"/>
    <DebuggerFilename Value="/usr/bin/gdb"/>
  </EnvironmentOptions>
</CONFIG>

Notes:

  • LazarusDirectory can not contain any macro.
  • 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.
  • The other values can use macros.
  • See Macros, especially the env macro.

Changing/Creating a config file

<Delphi> uses laz2_xmlcfg; var

 cfg: TXMLConfig;

begin

 cfg:=TXMLConfig.Create('/home/username/.lazarus/environmentoptions.xml');
 try
   cfg.SetDeleteValue('EnvironmentOptions/LazarusDirectory/Value','/home/username/new/path/lazarus',);
   cfg.Flush;
 finally
   cfg.Free;
 end;

end; </Delphi>

Include third party packages

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.