mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-15 05:28:19 +02:00
starter: first check in the primary config directory for a Lazarus executable
git-svn-id: trunk@9882 -
This commit is contained in:
parent
193b2859bf
commit
ec83a5bd03
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -1374,9 +1374,9 @@ ide/sourcemarks.pas svneol=native#text/pascal
|
|||||||
ide/splash.lfm svneol=native#text/plain
|
ide/splash.lfm svneol=native#text/plain
|
||||||
ide/splash.lrs svneol=native#text/pascal
|
ide/splash.lrs svneol=native#text/pascal
|
||||||
ide/splash.pp svneol=native#text/pascal
|
ide/splash.pp svneol=native#text/pascal
|
||||||
|
ide/startlazarus.lpi svneol=native#text/plain
|
||||||
ide/startlazarus.lpr svneol=native#text/pascal
|
ide/startlazarus.lpr svneol=native#text/pascal
|
||||||
ide/startlazarus.rc svneol=native#text/plain
|
ide/startlazarus.rc svneol=native#text/plain
|
||||||
ide/startlazopts.pas svneol=native#text/pascal
|
|
||||||
ide/sysvaruseroverridedlg.lfm svneol=native#text/plain
|
ide/sysvaruseroverridedlg.lfm svneol=native#text/plain
|
||||||
ide/sysvaruseroverridedlg.lrs svneol=native#text/plain
|
ide/sysvaruseroverridedlg.lrs svneol=native#text/plain
|
||||||
ide/sysvaruseroverridedlg.pas svneol=native#text/pascal
|
ide/sysvaruseroverridedlg.pas svneol=native#text/pascal
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<CONFIG>
|
<CONFIG>
|
||||||
<ProjectOptions>
|
<ProjectOptions>
|
||||||
<PathDelim Value="/"/>
|
<PathDelim Value="\"/>
|
||||||
<Version Value="5"/>
|
<Version Value="5"/>
|
||||||
<General>
|
<General>
|
||||||
<Flags>
|
<Flags>
|
||||||
@ -22,7 +22,7 @@
|
|||||||
<RunParams>
|
<RunParams>
|
||||||
<local>
|
<local>
|
||||||
<FormatVersion Value="1"/>
|
<FormatVersion Value="1"/>
|
||||||
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
|
<LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
|
||||||
</local>
|
</local>
|
||||||
</RunParams>
|
</RunParams>
|
||||||
<Units Count="1">
|
<Units Count="1">
|
||||||
@ -35,11 +35,12 @@
|
|||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
<Version Value="5"/>
|
<Version Value="5"/>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
<Target>
|
<Target>
|
||||||
<Filename Value="../lazarus"/>
|
<Filename Value="../lazarus"/>
|
||||||
</Target>
|
</Target>
|
||||||
<SearchPaths>
|
<SearchPaths>
|
||||||
<UnitOutputDirectory Value="$(LazarusDir)/units/$(TargetCPU)-$(TargetOS)"/>
|
<UnitOutputDirectory Value="$(LazarusDir)\units\$(TargetCPU)-$(TargetOS)"/>
|
||||||
</SearchPaths>
|
</SearchPaths>
|
||||||
<CodeGeneration>
|
<CodeGeneration>
|
||||||
<Generate Value="Faster"/>
|
<Generate Value="Faster"/>
|
||||||
|
@ -83,8 +83,7 @@ uses
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
Classes, SysUtils, Process,
|
Classes, SysUtils, Process,
|
||||||
LCLProc, FileUtil, Forms, Controls, Dialogs,
|
LCLProc, FileUtil, Forms, Controls, Dialogs,
|
||||||
LazConf,
|
LazConf, Splash;
|
||||||
StartLazOpts, Splash;
|
|
||||||
|
|
||||||
type
|
type
|
||||||
TLazarusProcess = class
|
TLazarusProcess = class
|
||||||
@ -104,7 +103,6 @@ type
|
|||||||
type
|
type
|
||||||
TLazarusManager = class(TComponent)
|
TLazarusManager = class(TComponent)
|
||||||
private
|
private
|
||||||
FStartLazarusOptions: TStartLazarusOptions;
|
|
||||||
FLazarusProcess: TLazarusProcess;
|
FLazarusProcess: TLazarusProcess;
|
||||||
FLazarusPath: string;
|
FLazarusPath: string;
|
||||||
FLazarusPID: Integer;
|
FLazarusPID: Integer;
|
||||||
@ -130,14 +128,12 @@ begin
|
|||||||
inherited Create(nil);
|
inherited Create(nil);
|
||||||
SplashForm := nil;
|
SplashForm := nil;
|
||||||
ShowSplash;
|
ShowSplash;
|
||||||
FStartLazarusOptions := TStartLazarusOptions.Create;
|
|
||||||
ParseCommandLine;
|
ParseCommandLine;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TLazarusManager.Destroy;
|
destructor TLazarusManager.Destroy;
|
||||||
begin
|
begin
|
||||||
FreeAndNil(FCmdLineParams);
|
FreeAndNil(FCmdLineParams);
|
||||||
FreeAndNil(FStartLazarusOptions);
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -184,8 +180,14 @@ end;
|
|||||||
|
|
||||||
function TLazarusManager.GetLazarusPath(const FileName: string) : string;
|
function TLazarusManager.GetLazarusPath(const FileName: string) : string;
|
||||||
begin
|
begin
|
||||||
Result := AppendPathDelim(FStartLazarusOptions.LazarusDir) + FileName +
|
// first try in the bin dir of the primary config directory
|
||||||
GetExecutableExt;
|
Result := AppendPathDelim(GetPrimaryConfigPath) + 'bin' + PathDelim +
|
||||||
|
FileName + GetExeExt;
|
||||||
|
// if no lazarus executable exists in that directory, try the same directory
|
||||||
|
// as the startlazarus executable
|
||||||
|
if not FileExists(Result) then
|
||||||
|
Result := AppendPathDelim(ExtractFilePath(ExpandFileName(ParamStr(0)))) +
|
||||||
|
FileName + GetExeExt;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TLazarusManager.RenameLazarusExecutables: TModalResult;
|
function TLazarusManager.RenameLazarusExecutables: TModalResult;
|
||||||
|
83
ide/startlazarus.lpi
Normal file
83
ide/startlazarus.lpi
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<CONFIG>
|
||||||
|
<ProjectOptions>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<General>
|
||||||
|
<SessionStorage Value="InIDEConfig"/>
|
||||||
|
<MainUnit Value="0"/>
|
||||||
|
<IconPath Value="./"/>
|
||||||
|
<TargetFileExt Value=".exe"/>
|
||||||
|
</General>
|
||||||
|
<VersionInfo>
|
||||||
|
<UseVersionInfo Value="False"/>
|
||||||
|
<AutoIncrementBuild Value="False"/>
|
||||||
|
<CurrentVersionNr Value="0"/>
|
||||||
|
<CurrentMajorRevNr Value="0"/>
|
||||||
|
<CurrentMinorRevNr Value="0"/>
|
||||||
|
<CurrentBuildNr Value="0"/>
|
||||||
|
<ProjectVersion Value="1.0.0.0"/>
|
||||||
|
<Language Value="0409"/>
|
||||||
|
<CharSet Value="04E4"/>
|
||||||
|
<Comments Value=""/>
|
||||||
|
<CompanyName Value=""/>
|
||||||
|
<FileDescription Value=""/>
|
||||||
|
<InternalName Value=""/>
|
||||||
|
<LegalCopyright Value=""/>
|
||||||
|
<LegalTrademarks Value=""/>
|
||||||
|
<OriginalFilename Value=""/>
|
||||||
|
<ProductName Value=""/>
|
||||||
|
</VersionInfo>
|
||||||
|
<PublishOptions>
|
||||||
|
<Version Value="2"/>
|
||||||
|
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||||
|
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||||
|
</PublishOptions>
|
||||||
|
<RunParams>
|
||||||
|
<local>
|
||||||
|
<FormatVersion Value="1"/>
|
||||||
|
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
|
||||||
|
</local>
|
||||||
|
</RunParams>
|
||||||
|
<RequiredPackages Count="1">
|
||||||
|
<Item1>
|
||||||
|
<PackageName Value="LCL"/>
|
||||||
|
</Item1>
|
||||||
|
</RequiredPackages>
|
||||||
|
<Units Count="2">
|
||||||
|
<Unit0>
|
||||||
|
<Filename Value="startlazarus.lpr"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
</Unit0>
|
||||||
|
<Unit1>
|
||||||
|
<Filename Value="lazarusmanager.pas"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<UnitName Value="LazarusManager"/>
|
||||||
|
</Unit1>
|
||||||
|
</Units>
|
||||||
|
</ProjectOptions>
|
||||||
|
<CompilerOptions>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
|
<Target>
|
||||||
|
<Filename Value="D:\lazarus\source\lazarus\startlazarus.exe"/>
|
||||||
|
</Target>
|
||||||
|
<SearchPaths>
|
||||||
|
<UnitOutputDirectory Value="D:\lazarus\source\lazarus\units\i386-win32"/>
|
||||||
|
<SrcPath Value="$(LazarusDir)\lcl\;$(LazarusDir)\lcl\interfaces\$(LCLWidgetType)\"/>
|
||||||
|
</SearchPaths>
|
||||||
|
<CodeGeneration>
|
||||||
|
<Generate Value="Faster"/>
|
||||||
|
</CodeGeneration>
|
||||||
|
<Linking>
|
||||||
|
<Options>
|
||||||
|
<Win32>
|
||||||
|
<GraphicApplication Value="True"/>
|
||||||
|
</Win32>
|
||||||
|
</Options>
|
||||||
|
</Linking>
|
||||||
|
<Other>
|
||||||
|
<CompilerPath Value="$(CompPath)"/>
|
||||||
|
</Other>
|
||||||
|
</CompilerOptions>
|
||||||
|
</CONFIG>
|
@ -1,58 +0,0 @@
|
|||||||
{ $Id$ }
|
|
||||||
unit StartLazOpts;
|
|
||||||
|
|
||||||
{$mode objfpc}{$H+}
|
|
||||||
|
|
||||||
interface
|
|
||||||
|
|
||||||
uses
|
|
||||||
Classes, SysUtils,
|
|
||||||
XMLCfg;
|
|
||||||
|
|
||||||
type
|
|
||||||
TStartLazarusOptions = class
|
|
||||||
private
|
|
||||||
FFilename: string;
|
|
||||||
FLazarusDir: string;
|
|
||||||
procedure SetFilename(const AValue: string);
|
|
||||||
public
|
|
||||||
constructor Create;
|
|
||||||
destructor Destroy; override;
|
|
||||||
procedure Load;
|
|
||||||
procedure Save;
|
|
||||||
property LazarusDir: string read FLazarusDir write FLazarusDir;
|
|
||||||
property Filename: string read FFilename write SetFilename;
|
|
||||||
end;
|
|
||||||
|
|
||||||
implementation
|
|
||||||
|
|
||||||
{ TStartLazarusOptions }
|
|
||||||
|
|
||||||
procedure TStartLazarusOptions.SetFilename(const AValue: string);
|
|
||||||
begin
|
|
||||||
if FFilename=AValue then exit;
|
|
||||||
FFilename:=AValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
constructor TStartLazarusOptions.Create;
|
|
||||||
begin
|
|
||||||
FLazarusDir := ExtractFilePath(ExpandFileName(ParamStr(0)));
|
|
||||||
end;
|
|
||||||
|
|
||||||
destructor TStartLazarusOptions.Destroy;
|
|
||||||
begin
|
|
||||||
inherited Destroy;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TStartLazarusOptions.Load;
|
|
||||||
begin
|
|
||||||
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TStartLazarusOptions.Save;
|
|
||||||
begin
|
|
||||||
|
|
||||||
end;
|
|
||||||
|
|
||||||
end.
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user