1 | unit UModularSystem;
|
---|
2 |
|
---|
3 | {$mode Delphi}{$H+}
|
---|
4 |
|
---|
5 | interface
|
---|
6 |
|
---|
7 | uses
|
---|
8 | Classes, SysUtils, URegistry, SpecializedList;
|
---|
9 |
|
---|
10 | type
|
---|
11 | TModuleManager = class;
|
---|
12 | TModule = class;
|
---|
13 | TListModule = class;
|
---|
14 |
|
---|
15 | TAPI = class(TComponent)
|
---|
16 |
|
---|
17 | end;
|
---|
18 |
|
---|
19 | TModuleCondition = (mcAll, mcEnabled, mcNotEnabled, mcInstalled, mcNotInstalled,
|
---|
20 | mcRunning, mcNotRunning);
|
---|
21 | TModuleConditions = set of TModuleCondition;
|
---|
22 | TModuleAction = (maStart, maStop, maInstall, maUninstall, maUpgrade, maEnable,
|
---|
23 | maDisable);
|
---|
24 | TModuleActions = array of TModuleAction;
|
---|
25 |
|
---|
26 | { TModule }
|
---|
27 |
|
---|
28 | TModule = class(TComponent)
|
---|
29 | private
|
---|
30 | FCategory: string;
|
---|
31 | FEnabled: Boolean;
|
---|
32 | FReleaseTime: TDateTime;
|
---|
33 | FRunning: Boolean;
|
---|
34 | FInstalled: Boolean;
|
---|
35 | FManager: TModuleManager;
|
---|
36 | FVersion: string;
|
---|
37 | FIdentification: string;
|
---|
38 | FTitle: string;
|
---|
39 | FLicense: string;
|
---|
40 | FAuthor: string;
|
---|
41 | FDependencies: TListString;
|
---|
42 | FDescription: TListString;
|
---|
43 | FFileName: string;
|
---|
44 | FWebSite: string;
|
---|
45 | FStartUpTime: TDateTime;
|
---|
46 | procedure SetEnabled(AValue: Boolean);
|
---|
47 | procedure SetInstalled(AValue: Boolean);
|
---|
48 | procedure SetManager(AValue: TModuleManager);
|
---|
49 | procedure SetRunning(AValue: Boolean);
|
---|
50 | protected
|
---|
51 | procedure DoStart; virtual;
|
---|
52 | procedure DoStop; virtual;
|
---|
53 | procedure DoInstall; virtual;
|
---|
54 | procedure DoUninstall; virtual;
|
---|
55 | procedure DoUpgrade; virtual;
|
---|
56 | public
|
---|
57 | API: TAPI;
|
---|
58 | procedure Enable;
|
---|
59 | procedure Disable;
|
---|
60 | procedure Start;
|
---|
61 | procedure Stop;
|
---|
62 | procedure Restart;
|
---|
63 | procedure Install;
|
---|
64 | procedure Uninstall;
|
---|
65 | procedure Reinstall;
|
---|
66 | procedure Upgrade;
|
---|
67 | procedure EnumDependenciesCascade(ModuleList: TListModule;
|
---|
68 | Conditions: TModuleConditions = [mcAll]);
|
---|
69 | procedure EnumSuperiorDependenciesCascade(ModuleList: TListModule;
|
---|
70 | Conditions: TModuleConditions = [mcAll]);
|
---|
71 | procedure SetInstalledState(Value: Boolean);
|
---|
72 | constructor Create(Owner: TComponent); override;
|
---|
73 | destructor Destroy; override;
|
---|
74 | property Running: Boolean read FRunning write SetRunning;
|
---|
75 | property Installed: Boolean read FInstalled write SetInstalled;
|
---|
76 | property Enabled: Boolean read FEnabled write SetEnabled;
|
---|
77 | property StartUpTime: TDateTime read FStartUpTime;
|
---|
78 | published
|
---|
79 | property Identification: string read FIdentification write FIdentification; // Unique system name
|
---|
80 | property Manager: TModuleManager read FManager write SetManager;
|
---|
81 | property Version: string read FVersion write FVersion;
|
---|
82 | property ReleaseTime: TDateTime read FReleaseTime write FReleaseTime;
|
---|
83 | property Title: string read FTitle write FTitle;
|
---|
84 | property License: string read FLicense write FLicense;
|
---|
85 | property Author: string read FAuthor write FAuthor;
|
---|
86 | property Dependencies: TListString read FDependencies write FDependencies;
|
---|
87 | property Description: TListString read FDescription write FDescription;
|
---|
88 | property FileName: string read FFileName write FFileName;
|
---|
89 | property Category: string read FCategory write FCategory;
|
---|
90 | property WebSite: string read FWebSite write FWebSite;
|
---|
91 | // Screenshots, reviews, icon, weak dependencies, ...
|
---|
92 | end;
|
---|
93 |
|
---|
94 | { TListModule }
|
---|
95 |
|
---|
96 | TListModule = class(TListObject)
|
---|
97 | private
|
---|
98 | public
|
---|
99 | procedure Perform(Actions: array of TModuleAction; Conditions: TModuleConditions = [mcAll]);
|
---|
100 | function FindByName(Name: string): TModule;
|
---|
101 | end;
|
---|
102 |
|
---|
103 | TModuleManagerOption = (moAutoInstallOnRun, moAuto);
|
---|
104 | TModuleManagerOptions = set of TModuleManagerOption;
|
---|
105 | { TModuleManager }
|
---|
106 |
|
---|
107 | TModuleManager = class(TComponent)
|
---|
108 | private
|
---|
109 | FAPI: TAPI;
|
---|
110 | FOnUpdate: TNotifyEvent;
|
---|
111 | FOptions: TModuleManagerOptions;
|
---|
112 | procedure SetAPI(AValue: TAPI);
|
---|
113 | procedure DoUpdate(Sender: TObject);
|
---|
114 | public
|
---|
115 | Modules: TListModule; // TObjectList<TModule>
|
---|
116 | function ModuleRunning(Name: string): Boolean;
|
---|
117 | procedure EnumDependenciesCascade(Module: TModule; ModuleList: TListModule;
|
---|
118 | Conditions: TModuleConditions = [mcAll]);
|
---|
119 | procedure EnumSuperiorDependenciesCascade(Module: TModule;
|
---|
120 | ModuleList: TListModule; Conditions: TModuleConditions = [mcAll]);
|
---|
121 | procedure RegisterModule(Module: TModule);
|
---|
122 | procedure UnregisterModule(Module: TModule);
|
---|
123 | procedure LoadFromRegistry(AContext: TRegistryContext);
|
---|
124 | procedure SaveToRegistry(AContext: TRegistryContext);
|
---|
125 | constructor Create(AOwner: TComponent); override;
|
---|
126 | destructor Destroy; override;
|
---|
127 | property API: TAPI read FAPI write SetAPI;
|
---|
128 | published
|
---|
129 | property OnUpdate: TNotifyEvent read FOnUpdate write FOnUpdate;
|
---|
130 | property Options: TModuleManagerOptions read FOptions write FOptions;
|
---|
131 | end;
|
---|
132 |
|
---|
133 | procedure Register;
|
---|
134 |
|
---|
135 |
|
---|
136 | implementation
|
---|
137 |
|
---|
138 | resourcestring
|
---|
139 | SModuleNotFound = 'Module "%1:s" not found as dependency for module "%0:s"';
|
---|
140 | SInvalidModuleName = 'Invalid module name';
|
---|
141 |
|
---|
142 | procedure Register;
|
---|
143 | begin
|
---|
144 | RegisterComponents('ModularSystem', [TModuleManager, TModule]);
|
---|
145 | end;
|
---|
146 |
|
---|
147 | { TListModule }
|
---|
148 |
|
---|
149 | procedure TListModule.Perform(Actions: array of TModuleAction;
|
---|
150 | Conditions: TModuleConditions = [mcAll]);
|
---|
151 | var
|
---|
152 | I: Integer;
|
---|
153 | A: Integer;
|
---|
154 | begin
|
---|
155 | try
|
---|
156 | BeginUpdate;
|
---|
157 | for I := 0 to Count - 1 do
|
---|
158 | with TModule(Items[I]) do
|
---|
159 | if (mcAll in Conditions) or
|
---|
160 | (Running and (mcRunning in Conditions)) or
|
---|
161 | (not Running and (mcNotRunning in Conditions)) or
|
---|
162 | (Installed and (mcInstalled in Conditions)) or
|
---|
163 | (not Installed and (mcNotInstalled in Conditions)) or
|
---|
164 | (Enabled and (mcEnabled in Conditions)) or
|
---|
165 | (not Enabled and (mcNotEnabled in Conditions)) then
|
---|
166 | for A := 0 to High(Actions) do begin
|
---|
167 | if Actions[A] = maStart then Start;
|
---|
168 | if Actions[A] = maStop then Stop;
|
---|
169 | if Actions[A] = maInstall then Install;
|
---|
170 | if Actions[A] = maUninstall then Uninstall;
|
---|
171 | if Actions[A] = maUpgrade then Upgrade;
|
---|
172 | if Actions[A] = maEnable then Enable;
|
---|
173 | if Actions[A] = maDisable then Disable;
|
---|
174 | end;
|
---|
175 | finally
|
---|
176 | EndUpdate;
|
---|
177 | end;
|
---|
178 | end;
|
---|
179 |
|
---|
180 | function TListModule.FindByName(Name: string): TModule;
|
---|
181 | var
|
---|
182 | I: Integer;
|
---|
183 | begin
|
---|
184 | I := 0;
|
---|
185 | while (I < Count) and (TModule(Items[I]).Identification <> Name) do Inc(I);
|
---|
186 | if I < Count then Result := TModule(Items[I])
|
---|
187 | else Result := nil;
|
---|
188 | end;
|
---|
189 |
|
---|
190 | { TModuleManager }
|
---|
191 |
|
---|
192 | procedure TModuleManager.SetAPI(AValue: TAPI);
|
---|
193 | var
|
---|
194 | I: Integer;
|
---|
195 | begin
|
---|
196 | if FAPI = AValue then Exit;
|
---|
197 | FAPI := AValue;
|
---|
198 | for I := 0 to Modules.Count - 1 do
|
---|
199 | TModule(Modules[I]).API := FAPI;
|
---|
200 | end;
|
---|
201 |
|
---|
202 | procedure TModuleManager.DoUpdate(Sender: TObject);
|
---|
203 | begin
|
---|
204 | if Assigned(FOnUpdate) then FOnUpdate(Self);
|
---|
205 | end;
|
---|
206 |
|
---|
207 | function TModuleManager.ModuleRunning(Name: string): Boolean;
|
---|
208 | var
|
---|
209 | Module: TModule;
|
---|
210 | begin
|
---|
211 | Module := Modules.FindByName(Name);
|
---|
212 | if Assigned(Module) then begin
|
---|
213 | Result := Module.Running;
|
---|
214 | end else Result := False;
|
---|
215 | end;
|
---|
216 |
|
---|
217 | procedure TModuleManager.EnumDependenciesCascade(Module: TModule;
|
---|
218 | ModuleList: TListModule; Conditions: TModuleConditions = [mcAll]);
|
---|
219 | var
|
---|
220 | DepModule: TModule;
|
---|
221 | I: Integer;
|
---|
222 | begin
|
---|
223 | for I := 0 to Module.Dependencies.Count - 1 do begin
|
---|
224 | DepModule := Modules.FindByName(Module.Dependencies[I]);
|
---|
225 | if Assigned(DepModule) then
|
---|
226 | with DepModule do begin
|
---|
227 | if (ModuleList.IndexOf(DepModule) = -1) and
|
---|
228 | ((mcAll in Conditions) or
|
---|
229 | (Running and (mcRunning in Conditions)) or
|
---|
230 | (not Running and (mcNotRunning in Conditions)) or
|
---|
231 | (Installed and (mcInstalled in Conditions)) or
|
---|
232 | (not Installed and (mcNotInstalled in Conditions)) or
|
---|
233 | (Enabled and (mcEnabled in Conditions)) or
|
---|
234 | (not Enabled and (mcNotEnabled in Conditions))) then begin
|
---|
235 | ModuleList.Add(DepModule);
|
---|
236 | Self.EnumDependenciesCascade(DepModule, ModuleList);
|
---|
237 | end;
|
---|
238 | end else raise Exception.CreateFmt(SModuleNotFound, [DepModule.Identification]);
|
---|
239 | end;
|
---|
240 | end;
|
---|
241 |
|
---|
242 | procedure TModuleManager.EnumSuperiorDependenciesCascade(Module: TModule;
|
---|
243 | ModuleList: TListModule; Conditions: TModuleConditions = [mcAll]);
|
---|
244 | var
|
---|
245 | I: Integer;
|
---|
246 | begin
|
---|
247 | for I := 0 to Modules.Count - 1 do
|
---|
248 | with TModule(Modules[I]) do begin
|
---|
249 | if (Dependencies.IndexOf(Module.Identification) <> -1) and
|
---|
250 | (ModuleList.IndexOf(TModule(Modules[I])) = -1) and
|
---|
251 | ((mcAll in Conditions) or
|
---|
252 | (Running and (mcRunning in Conditions)) or
|
---|
253 | (not Running and (mcNotRunning in Conditions)) or
|
---|
254 | (Installed and (mcInstalled in Conditions)) or
|
---|
255 | (not Installed and (mcNotInstalled in Conditions)) or
|
---|
256 | (Enabled and (mcEnabled in Conditions)) or
|
---|
257 | (not Enabled and (mcNotEnabled in Conditions))) then begin
|
---|
258 | ModuleList.Add(TModule(Modules[I]));
|
---|
259 | Self.EnumSuperiorDependenciesCascade(TModule(Modules[I]), ModuleList);
|
---|
260 | end;
|
---|
261 | end;
|
---|
262 | end;
|
---|
263 |
|
---|
264 | procedure TModuleManager.RegisterModule(Module: TModule);
|
---|
265 | begin
|
---|
266 | if Module.Identification = '' then
|
---|
267 | raise Exception.Create(SInvalidModuleName);
|
---|
268 | Modules.Add(Module);
|
---|
269 | Module.FManager := Self;
|
---|
270 | Module.API := API;
|
---|
271 | Modules.Update;
|
---|
272 | end;
|
---|
273 |
|
---|
274 | procedure TModuleManager.UnregisterModule(Module: TModule);
|
---|
275 | begin
|
---|
276 | Modules.Remove(Module);
|
---|
277 | Modules.Update;
|
---|
278 | end;
|
---|
279 |
|
---|
280 | constructor TModuleManager.Create(AOwner: TComponent);
|
---|
281 | begin
|
---|
282 | inherited;
|
---|
283 | Modules := TListModule.Create;
|
---|
284 | Modules.OwnsObjects := False;
|
---|
285 | Modules.OnUpdate := DoUpdate;
|
---|
286 | end;
|
---|
287 |
|
---|
288 | destructor TModuleManager.Destroy;
|
---|
289 | begin
|
---|
290 | Modules.Perform([maStop]);
|
---|
291 | FreeAndNil(Modules);
|
---|
292 | inherited;
|
---|
293 | end;
|
---|
294 |
|
---|
295 | procedure TModuleManager.LoadFromRegistry(AContext: TRegistryContext);
|
---|
296 | var
|
---|
297 | I: Integer;
|
---|
298 | begin
|
---|
299 | with TRegistryEx.Create do
|
---|
300 | try
|
---|
301 | RootKey := AContext.RootKey;
|
---|
302 | for I := 0 to Modules.Count - 1 do
|
---|
303 | with TModule(Modules[I]) do begin
|
---|
304 | OpenKey(AContext.Key + '\' + Identification, True);
|
---|
305 | Installed := ReadBoolWithDefault('Installed', Installed);
|
---|
306 | Enabled := ReadBoolWithDefault('Enabled', Enabled);
|
---|
307 | end;
|
---|
308 | finally
|
---|
309 | Free;
|
---|
310 | end;
|
---|
311 | end;
|
---|
312 |
|
---|
313 | procedure TModuleManager.SaveToRegistry(AContext: TRegistryContext);
|
---|
314 | var
|
---|
315 | I: Integer;
|
---|
316 | begin
|
---|
317 | with TRegistryEx.Create do
|
---|
318 | try
|
---|
319 | RootKey := AContext.RootKey;
|
---|
320 | for I := 0 to Modules.Count - 1 do
|
---|
321 | with TModule(Modules[I]) do begin
|
---|
322 | OpenKey(AContext.Key + '\' + Identification, True);
|
---|
323 | WriteBool('Enabled', Enabled);
|
---|
324 | WriteBool('Installed', Installed);
|
---|
325 | end;
|
---|
326 | finally
|
---|
327 | Free;
|
---|
328 | end;
|
---|
329 | end;
|
---|
330 |
|
---|
331 | { TModule }
|
---|
332 |
|
---|
333 | procedure TModule.SetRunning(AValue: Boolean);
|
---|
334 | begin
|
---|
335 | if FRunning = AValue then Exit;
|
---|
336 | if AValue then Start else Stop;
|
---|
337 | end;
|
---|
338 |
|
---|
339 | procedure TModule.DoStart;
|
---|
340 | begin
|
---|
341 |
|
---|
342 | end;
|
---|
343 |
|
---|
344 | procedure TModule.DoStop;
|
---|
345 | begin
|
---|
346 |
|
---|
347 | end;
|
---|
348 |
|
---|
349 | procedure TModule.DoInstall;
|
---|
350 | begin
|
---|
351 |
|
---|
352 | end;
|
---|
353 |
|
---|
354 | procedure TModule.DoUninstall;
|
---|
355 | begin
|
---|
356 |
|
---|
357 | end;
|
---|
358 |
|
---|
359 | procedure TModule.DoUpgrade;
|
---|
360 | begin
|
---|
361 |
|
---|
362 | end;
|
---|
363 |
|
---|
364 | procedure TModule.Enable;
|
---|
365 | var
|
---|
366 | List: TListModule;
|
---|
367 | begin
|
---|
368 | if Enabled then Exit;
|
---|
369 | FEnabled := True;
|
---|
370 | try
|
---|
371 | List := TListModule.Create;
|
---|
372 | List.OwnsObjects := False;
|
---|
373 | EnumDependenciesCascade(List, [mcNotEnabled]);
|
---|
374 | List.Perform([maEnable], [mcNotEnabled]);
|
---|
375 | finally
|
---|
376 | List.Free;
|
---|
377 | end;
|
---|
378 | Start; // Auto start enabled modules
|
---|
379 | //Manager.Update;
|
---|
380 | end;
|
---|
381 |
|
---|
382 | procedure TModule.Disable;
|
---|
383 | var
|
---|
384 | List: TListModule;
|
---|
385 | begin
|
---|
386 | if not Enabled then Exit;
|
---|
387 | if FRunning then Stop; // Auto stop running modules
|
---|
388 | FEnabled := False;
|
---|
389 | try
|
---|
390 | List := TListModule.Create;
|
---|
391 | List.OwnsObjects := False;
|
---|
392 | EnumSuperiorDependenciesCascade(List, [mcEnabled]);
|
---|
393 | List.Perform([maDisable], [mcEnabled]);
|
---|
394 | finally
|
---|
395 | List.Free;
|
---|
396 | end;
|
---|
397 | Manager.Modules.Update;
|
---|
398 | end;
|
---|
399 |
|
---|
400 | procedure TModule.SetInstalled(AValue: Boolean);
|
---|
401 | begin
|
---|
402 | if FInstalled = AValue then Exit;
|
---|
403 | if AValue then Install else Uninstall;
|
---|
404 | end;
|
---|
405 |
|
---|
406 | procedure TModule.SetManager(AValue: TModuleManager);
|
---|
407 | begin
|
---|
408 | if FManager = AValue then Exit;
|
---|
409 | if Assigned(FManager) then FManager.UnregisterModule(Self);
|
---|
410 | FManager := AValue;
|
---|
411 | if Assigned(FManager) then AValue.RegisterModule(Self);
|
---|
412 | end;
|
---|
413 |
|
---|
414 | procedure TModule.SetEnabled(AValue: Boolean);
|
---|
415 | begin
|
---|
416 | if FEnabled = AValue then Exit;
|
---|
417 | if AValue then Enable else Disable;
|
---|
418 | end;
|
---|
419 |
|
---|
420 | procedure TModule.Start;
|
---|
421 | var
|
---|
422 | List: TListModule;
|
---|
423 | StartTime: TDateTime;
|
---|
424 | begin
|
---|
425 | if not Enabled or Running then Exit;
|
---|
426 | if not Installed then Install; // Auto install not installed modules
|
---|
427 | try
|
---|
428 | List := TListModule.Create;
|
---|
429 | List.OwnsObjects := False;
|
---|
430 | EnumDependenciesCascade(List, [mcNotRunning]);
|
---|
431 | List.Perform([maStart], [mcNotRunning]);
|
---|
432 | finally
|
---|
433 | List.Free;
|
---|
434 | end;
|
---|
435 | StartTime := Now;
|
---|
436 | DoStart;
|
---|
437 | FStartUpTime := Now - StartTime;
|
---|
438 | FRunning := True;
|
---|
439 | Manager.Modules.Update;
|
---|
440 | end;
|
---|
441 |
|
---|
442 | procedure TModule.Stop;
|
---|
443 | var
|
---|
444 | List: TListModule;
|
---|
445 | begin
|
---|
446 | if not Running then Exit;
|
---|
447 | FRunning := False;
|
---|
448 | try
|
---|
449 | List := TListModule.Create;
|
---|
450 | List.OwnsObjects := False;
|
---|
451 | EnumSuperiorDependenciesCascade(List, [mcRunning]);
|
---|
452 | List.Perform([maStop], [mcRunning]);
|
---|
453 | finally
|
---|
454 | List.Free;
|
---|
455 | end;
|
---|
456 | DoStop;
|
---|
457 | Manager.Modules.Update;
|
---|
458 | end;
|
---|
459 |
|
---|
460 | procedure TModule.Restart;
|
---|
461 | begin
|
---|
462 | Stop;
|
---|
463 | Start;
|
---|
464 | end;
|
---|
465 |
|
---|
466 | procedure TModule.Install;
|
---|
467 | var
|
---|
468 | List: TListModule;
|
---|
469 | begin
|
---|
470 | if Installed then Exit;
|
---|
471 | try
|
---|
472 | List := TListModule.Create;
|
---|
473 | List.OwnsObjects := False;
|
---|
474 | EnumDependenciesCascade(List, [mcNotInstalled]);
|
---|
475 | List.Perform([maInstall], [mcNotInstalled]);
|
---|
476 | finally
|
---|
477 | List.Free;
|
---|
478 | end;
|
---|
479 | FInstalled := True;
|
---|
480 | DoInstall;
|
---|
481 | //Enable; // Auto enable installed module
|
---|
482 | Manager.Modules.Update;
|
---|
483 | end;
|
---|
484 |
|
---|
485 | procedure TModule.Uninstall;
|
---|
486 | var
|
---|
487 | List: TListModule;
|
---|
488 | begin
|
---|
489 | if not Installed then Exit;
|
---|
490 | if Enabled then Disable; // Auto disable uninstalled module
|
---|
491 | try
|
---|
492 | List := TListModule.Create;
|
---|
493 | List.OwnsObjects := False;
|
---|
494 | EnumSuperiorDependenciesCascade(List, [mcInstalled]);
|
---|
495 | List.Perform([maUninstall], [mcInstalled]);
|
---|
496 | finally
|
---|
497 | List.Free;
|
---|
498 | end;
|
---|
499 | FInstalled := False;
|
---|
500 | DoUninstall;
|
---|
501 | Manager.Modules.Update;
|
---|
502 | end;
|
---|
503 |
|
---|
504 | procedure TModule.Reinstall;
|
---|
505 | begin
|
---|
506 | Uninstall;
|
---|
507 | Install;
|
---|
508 | end;
|
---|
509 |
|
---|
510 | procedure TModule.Upgrade;
|
---|
511 | begin
|
---|
512 | if not Enabled or not Installed then Exit;
|
---|
513 | if Running then try
|
---|
514 | Stop;
|
---|
515 | DoUpgrade;
|
---|
516 | finally
|
---|
517 | Start;
|
---|
518 | end else DoUpgrade;
|
---|
519 | Manager.Modules.Update;
|
---|
520 | end;
|
---|
521 |
|
---|
522 | procedure TModule.EnumDependenciesCascade(ModuleList: TListModule;
|
---|
523 | Conditions: TModuleConditions = [mcAll]);
|
---|
524 | begin
|
---|
525 | ModuleList.Clear;
|
---|
526 | Manager.EnumDependenciesCascade(Self, ModuleList, Conditions);
|
---|
527 | end;
|
---|
528 |
|
---|
529 | procedure TModule.EnumSuperiorDependenciesCascade(ModuleList: TListModule;
|
---|
530 | Conditions: TModuleConditions = [mcAll]);
|
---|
531 | begin
|
---|
532 | ModuleList.Clear;
|
---|
533 | Manager.EnumSuperiorDependenciesCascade(Self, ModuleList, Conditions);
|
---|
534 | end;
|
---|
535 |
|
---|
536 | procedure TModule.SetInstalledState(Value: Boolean);
|
---|
537 | begin
|
---|
538 | FInstalled := Value;
|
---|
539 | Manager.Modules.Update;
|
---|
540 | end;
|
---|
541 |
|
---|
542 | constructor TModule.Create(Owner: TComponent);
|
---|
543 | begin
|
---|
544 | inherited;
|
---|
545 | Dependencies := TListString.Create;
|
---|
546 | Description := TListString.Create;
|
---|
547 | end;
|
---|
548 |
|
---|
549 | destructor TModule.Destroy;
|
---|
550 | begin
|
---|
551 | Running := False;
|
---|
552 | FreeAndNil(FDescription);
|
---|
553 | FreeAndNil(FDependencies);
|
---|
554 | inherited;
|
---|
555 | end;
|
---|
556 |
|
---|
557 | end.
|
---|
558 |
|
---|