mirror of
				https://gitlab.com/freepascal.org/lazarus/lazarus.git
				synced 2025-10-31 02:42:33 +01: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.lrs 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.rc svneol=native#text/plain | ||||
| ide/startlazopts.pas svneol=native#text/pascal | ||||
| ide/sysvaruseroverridedlg.lfm svneol=native#text/plain | ||||
| ide/sysvaruseroverridedlg.lrs svneol=native#text/plain | ||||
| ide/sysvaruseroverridedlg.pas svneol=native#text/pascal | ||||
|  | ||||
| @ -1,7 +1,7 @@ | ||||
| <?xml version="1.0"?> | ||||
| <CONFIG> | ||||
|   <ProjectOptions> | ||||
|     <PathDelim Value="/"/> | ||||
|     <PathDelim Value="\"/> | ||||
|     <Version Value="5"/> | ||||
|     <General> | ||||
|       <Flags> | ||||
| @ -22,7 +22,7 @@ | ||||
|     <RunParams> | ||||
|       <local> | ||||
|         <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> | ||||
|     </RunParams> | ||||
|     <Units Count="1"> | ||||
| @ -35,11 +35,12 @@ | ||||
|   </ProjectOptions> | ||||
|   <CompilerOptions> | ||||
|     <Version Value="5"/> | ||||
|     <PathDelim Value="\"/> | ||||
|     <Target> | ||||
|       <Filename Value="../lazarus"/> | ||||
|     </Target> | ||||
|     <SearchPaths> | ||||
|       <UnitOutputDirectory Value="$(LazarusDir)/units/$(TargetCPU)-$(TargetOS)"/> | ||||
|       <UnitOutputDirectory Value="$(LazarusDir)\units\$(TargetCPU)-$(TargetOS)"/> | ||||
|     </SearchPaths> | ||||
|     <CodeGeneration> | ||||
|       <Generate Value="Faster"/> | ||||
|  | ||||
| @ -83,8 +83,7 @@ uses | ||||
| {$ENDIF} | ||||
|   Classes, SysUtils, Process, | ||||
|   LCLProc, FileUtil, Forms, Controls, Dialogs, | ||||
|   LazConf, | ||||
|   StartLazOpts, Splash; | ||||
|   LazConf, Splash; | ||||
|    | ||||
| type | ||||
|   TLazarusProcess = class | ||||
| @ -104,7 +103,6 @@ type | ||||
| type | ||||
|   TLazarusManager = class(TComponent) | ||||
|   private | ||||
|     FStartLazarusOptions: TStartLazarusOptions; | ||||
|     FLazarusProcess: TLazarusProcess; | ||||
|     FLazarusPath: string; | ||||
|     FLazarusPID: Integer; | ||||
| @ -130,14 +128,12 @@ begin | ||||
|   inherited Create(nil); | ||||
|   SplashForm := nil; | ||||
|   ShowSplash; | ||||
|   FStartLazarusOptions := TStartLazarusOptions.Create; | ||||
|   ParseCommandLine; | ||||
| end; | ||||
| 
 | ||||
| destructor TLazarusManager.Destroy; | ||||
| begin | ||||
|   FreeAndNil(FCmdLineParams); | ||||
|   FreeAndNil(FStartLazarusOptions); | ||||
|   inherited Destroy; | ||||
| end; | ||||
| 
 | ||||
| @ -184,8 +180,14 @@ end; | ||||
| 
 | ||||
| function TLazarusManager.GetLazarusPath(const FileName: string) : string; | ||||
| begin | ||||
|   Result := AppendPathDelim(FStartLazarusOptions.LazarusDir) + FileName + | ||||
|     GetExecutableExt; | ||||
|   // first try in the bin dir of the primary config directory | ||||
|   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; | ||||
| 
 | ||||
| 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
	 vincents
						vincents