lazarus/ide/include/win32/lazconf.inc
lazarus 09ca1546a5 MG: updated licenses
git-svn-id: trunk@1399 -
2002-02-09 02:30:23 +00:00

136 lines
4.8 KiB
PHP

{***************************************************************************
lazconf.inc
***************************************************************************
***************************************************************************
* *
* This source is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This code is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* General Public License for more details. *
* *
* A copy of the GNU General Public License is available on the World *
* Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
* obtain it by writing to the Free Software Foundation, *
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
***************************************************************************
}
var
PrimaryConfigPath,
SecondaryConfigPath: string;
{---------------------------------------------------------------------------
getPrimaryConfigPath function
---------------------------------------------------------------------------}
function GetPrimaryConfigPath: String;
begin
Result := PrimaryConfigPath;
end;
{---------------------------------------------------------------------------
getSecondaryConfigPath function
---------------------------------------------------------------------------}
function GetSecondaryConfigPath: String;
begin
Result := SecondaryConfigPath;
end;
{---------------------------------------------------------------------------
createPrimaryConfigPath procedure
---------------------------------------------------------------------------}
procedure createPrimaryConfigPath;
begin
CreateDir(GetPrimaryConfigPath);
end;
{---------------------------------------------------------------------------
SetPrimaryConfigPath procedure
---------------------------------------------------------------------------}
procedure SetPrimaryConfigPath(const NewValue: String);
begin
PrimaryConfigPath:=NewValue;
end;
{---------------------------------------------------------------------------
SetSecondaryConfigPath procedure
---------------------------------------------------------------------------}
procedure SetSecondaryConfigPath(const NewValue: String);
begin
SecondaryConfigPath:=NewValue;
end;
{---------------------------------------------------------------------------
CopySecondaryConfigFile procedure
---------------------------------------------------------------------------}
procedure CopySecondaryConfigFile(const AFilename: String);
var
PrimaryFilename, SecondaryFilename: string;
SrcFS, DestFS: TFileStream;
begin
PrimaryFilename:=GetPrimaryConfigPath+PathDelim+AFilename;
SecondaryFilename:=GetSecondaryConfigPath+PathDelim+AFilename;
if not FileExists(PrimaryFilename) then begin
try
SrcFS:=TFileStream.Create(SecondaryFilename,fmOpenRead);
try
DestFS:=TFileStream.Create(PrimaryFilename,fmCreate);
try
DestFS.CopyFrom(SrcFS,SrcFS.Size);
finally
DestFS.Free;
end;
finally
SrcFS.Free;
end;
except
end;
end;
end;
function FindDefaultCompilerPath: string;
begin
Result:='';
end;
initialization
PrimaryConfigPath:=ExtractFilePath(Paramstr(0));
{ This might need some work because on WinNT the
the path is called something different on almost every
version of Windows. Probably can use the Windows API to
get the system path. }
SecondaryConfigPath:='\windows\system';
{
$Log$
Revision 1.5 2002/05/10 06:57:51 lazarus
MG: updated licenses
Revision 1.4 2001/12/16 22:24:55 lazarus
MG: changes for new compiler 20011216
Revision 1.3 2001/12/10 08:44:23 lazarus
MG: added search for compiler, if not set
Revision 1.2 2001/05/27 11:52:01 lazarus
MG: added --primary-config-path=<filename> cmd line option
Revision 1.1 2000/07/13 10:28:22 michael
+ Initial import
Revision 1.1 2000/04/21 05:12:42 lazarus
Added lazconf.pp file.
Added include/linux and include/win32 directories.
Added lazconf.inc files for both linux and win32.
}