[Lazarus] Creating config files in primary config path for bootstrap installer

Reinier Olislagers reinierolislagers at gmail.com
Sun Feb 5 12:29:07 CET 2012


On 4-2-2012 18:19, Reinier Olislagers wrote:
> On 4-2-2012 17:59, Mattias Gaertner wrote:
>> On Sat, 04 Feb 2012 12:03:28 +0100
>> If you need a tool to set some config variables, then please write one.
> Ok.

> 
> I'll report back when I have something usable...

Mattias & all,

Seems I've got FPCUp
https://bitbucket.org/reiniero/fpcup
working now for bare metal installs on Windows.

I didn't write a command line tool to create/modify configs as I had
planned, but was able to incorporate that functionality within my code.

Attached FYI/for reference is the class I wrote that creates a simple
config if it doesn't yet exist and updates it if it does.

I use it like this (indentation/try..except removed for clarity):
// Set up a minimal config so we can use LazBuild
LazarusConfig:=TUpdateLazConfig.Create(LazarusPrimaryConfigPath);
LazarusConfig.CompilerFilename:=FInstalledCompiler;
LazarusConfig.LazarusDirectory:=LazarusDirectory;

{$IFDEF WINDOWS}
LazarusConfig.DebuggerFilename:=FBinutilsDir+'gdb'+FExecutableExtension;
LazarusConfig.MakeFilename:=FBinutilsDir+'make'+FExecutableExtension;
{$ENDIF WINDOWS}
{$IFDEF UNIX}
//todo: fix this for more variants?!?
azarusConfig.DebuggerFilename:='gdb'+FExecutableExtension;
LazarusConfig.MakeFilename:='make'+FExecutableExtension;

{$ENDIF UNIX}
LazarusConfig.FPCSourceDirectory:=FPCDirectory;
LazarusConfig.Free;

Hints, suggestions, criticism welcome as always,

Thanks a lot,
Reinier
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: updatelazconfig.pas
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20120205/8a7ecf52/attachment-0003.ksh>


More information about the Lazarus mailing list