Repository navigation
Expand file tree
/
Copy pathDN.Installer.IDE.pas
More file actions
112 lines (99 loc) · 3.06 KB
/
Copy pathDN.Installer.IDE.pas
File metadata and controls
112 lines (99 loc) · 3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
{
#########################################################
# Copyright by Alexander Benikowski #
# This unit is part of the Delphinus project hosted on #
# https://github.com/Memnarch/Delphinus #
#########################################################
}
unit DN.Installer.IDE;
interface
uses
Classes,
Types,
DN.Installer,
DN.ProjectInfo.Intf,
DN.Compiler.Intf;
type
TDNIDEInstaller = class(TDNInstaller)
protected
procedure AddSearchPath(const ASearchPath: string; const APlatforms: TDNCompilerPlatforms); override;
procedure AddBrowsingPath(const ABrowsingPath: string; const APlatforms: TDNCompilerPlatforms); override;
function InstallProject(const AProject: IDNProjectInfo; const ABPLDirectory: string): Boolean; override;
public
function Install(const ASourceDirectory: string;
const ATargetDirectory: string): Boolean; override;
end;
implementation
uses
Windows,
SysUtils,
IOUtils,
Registry,
DN.Types,
ToolsApi,
DN.ToolsApi.Extension.Intf;
{ TDNIDEInstaller }
procedure TDNIDEInstaller.AddBrowsingPath(const ABrowsingPath: string;
const APlatforms: TDNCompilerPlatforms);
var
LService: IDNEnvironmentOptionsService;
LPlatform: TDNCompilerPlatform;
LPathes: string;
begin
inherited;
LService := GDelphinusIDEServices as IDNEnvironmentOptionsService;
for LPlatform in APlatforms do
begin
if LPlatform in LService.SupportedPlatforms then
begin
LPathes := LService.Options[LPlatform].BrowingPath;
if LPathes <> '' then
LPathes := LPathes + ';' + ABrowsingPath
else
LPathes := ABrowsingPath;
LService.Options[LPlatform].BrowingPath := LPathes;
end;
end;
end;
procedure TDNIDEInstaller.AddSearchPath(const ASearchPath: string; const APlatforms: TDNCompilerPlatforms);
var
LService: IDNEnvironmentOptionsService;
LPlatform: TDNCompilerPlatform;
LPathes: string;
begin
inherited;
LService := GDelphinusIDEServices as IDNEnvironmentOptionsService;
for LPlatform in APlatforms do
begin
if LPlatform in LService.SupportedPlatforms then
begin
LPathes := LService.Options[LPlatform].SearchPath;
if LPathes <> '' then
LPathes := LPathes + ';' + ASearchPath
else
LPathes := ASearchPath;
LService.Options[LPlatform].SearchPath := LPathes;
end;
end;
end;
function TDNIDEInstaller.Install(const ASourceDirectory,
ATargetDirectory: string): Boolean;
var
LService: IDNEnvironmentOptionsService;
begin
LService := GDelphinusIDEServices as IDNEnvironmentOptionsService;
LService.BeginUpdate();
try
Result := inherited;
finally
LService.EndUpdate();
end;
end;
function TDNIDEInstaller.InstallProject(const AProject: IDNProjectInfo; const ABPLDirectory: string): Boolean;
var
LService: IOTAPackageServices;
begin
LService := BorlandIDEServices as IOTAPackageServices;
Result := LService.InstallPackage(TPath.Combine(ABPLDirectory, AProject.BinaryName));
end;
end.