Changeset 5 for trunk/UInstance.pas
- Timestamp:
- Feb 3, 2011, 2:18:11 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 1 1 lib 2 2 FreePascalManager.exe 3 SourceList.xml4 3 Config.xml 4 Source 5 Instance
-
- Property svn:ignore
-
trunk/UInstance.pas
r4 r5 6 6 7 7 uses 8 Classes, SysUtils, USource, Contnrs; 8 Classes, SysUtils, USource, Contnrs, Process, Forms, Controls, 9 FileUtil; 9 10 10 11 type … … 12 13 13 14 TInstance = class 15 private 16 function GetDownloaded: Boolean; 17 public 14 18 Id: Integer; 15 19 Name: string; 16 Downloaded: Boolean;17 20 Compiled: Boolean; 18 21 IDESource: TSource; … … 24 27 procedure Build; 25 28 procedure Start; 26 procedure Update;27 pro cedure Download;29 function GetPath: string; 30 property Downloaded: Boolean read GetDownloaded; 28 31 end; 29 32 … … 35 38 36 39 implementation 40 41 uses 42 UOperationProgress, UMainForm; 37 43 38 44 { TInstanceList } … … 50 56 { TInstance } 51 57 58 function TInstance.GetDownloaded: Boolean; 59 begin 60 Result := DirectoryExistsUTF8(GetPath + DirectorySeparator + FPCSource.ProjectShortName); 61 if Assigned(IDESource) then Result := Result and 62 DirectoryExistsUTF8(GetPath + DirectorySeparator + IDESource.ProjectShortName); 63 end; 64 52 65 procedure TInstance.Build; 53 66 begin 67 OperationProgressForm.Environment := 'path=' + //GetEnvironmentVariable('PATH') + ';' + 68 MainForm.GetBinUtilsDir; 69 OperationProgressForm.Path := GetPath + DirectorySeparator + FPCSource.ProjectShortName; 70 OperationProgressForm.CommandLine := 71 '"' + MainForm.GetBinUtilsDir + DirectorySeparator + 'make.exe" clean all PP="' + 72 MainForm.GetBinUtilsDir + '"'; 73 OperationProgressForm.ShowModal; 54 74 75 OperationProgressForm.Path := GetPath + DirectorySeparator + FPCSource.ProjectShortName; 76 OperationProgressForm.CommandLine := 77 '"' + MainForm.GetBinUtilsDir + DirectorySeparator + 'make.exe" install PREFIX="' + 78 GetPath + DirectorySeparator + FPCSource.ProjectShortName + '"' + 79 ' PP="' + MainForm.GetBinUtilsDir + '"'; 80 OperationProgressForm.ShowModal; 81 82 if Assigned(IDESource) then begin 83 OperationProgressForm.Path := GetPath + DirectorySeparator + IDESource.ProjectShortName; 84 OperationProgressForm.CommandLine := 85 '"' + MainForm.GetBinUtilsDir + DirectorySeparator + 'make.exe" bigideclean bigide OPT="-Xg"'; 86 OperationProgressForm.ShowModal; 87 end; 55 88 end; 56 89 57 90 procedure TInstance.Start; 91 var 92 Process: TProcess; 58 93 begin 59 94 if Assigned(IDESource) then 95 try 96 Process := TProcess.Create(nil); 97 Process.CurrentDirectory := GetPath + DirectorySeparator + IDESource.ProjectShortName; 98 Process.CommandLine := IDESource.GetExecutableFile; 99 Process.Execute; 100 finally 101 Process.Free; 102 end; 60 103 end; 61 104 62 procedure TInstance.Update;105 function TInstance.GetPath: string; 63 106 begin 64 65 end; 66 67 procedure TInstance.Download; 68 begin 69 107 Result := ExtractFileDir(Application.ExeName) + DirectorySeparator + 108 MainForm.InstanceDir + DirectorySeparator + IntToStr(Id); 70 109 end; 71 110
Note:
See TracChangeset
for help on using the changeset viewer.