2019-01-12 17:05:16 +00:00
|
|
|
|
unit dMain;
|
|
|
|
|
|
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
uses
|
2019-01-12 20:24:13 +00:00
|
|
|
|
Classes, SysUtils, FileUtil, Controls, Menus, uPackage, uPackageList;
|
2019-01-12 17:05:16 +00:00
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
2019-01-12 20:24:13 +00:00
|
|
|
|
{ TdmMain }
|
2019-01-12 17:05:16 +00:00
|
|
|
|
|
2019-01-12 20:24:13 +00:00
|
|
|
|
TdmMain = class(TDataModule)
|
2019-01-12 17:05:16 +00:00
|
|
|
|
imgIcons: TImageList;
|
|
|
|
|
mmMain: TMainMenu;
|
|
|
|
|
mbInstallCheckAll: TMenuItem;
|
|
|
|
|
mbInstallExpandTree: TMenuItem;
|
|
|
|
|
mbInstallCollapseTree: TMenuItem;
|
|
|
|
|
mbInstallCheckInvert: TMenuItem;
|
|
|
|
|
mbInstallCheckNone: TMenuItem;
|
|
|
|
|
mbTree: TMenuItem;
|
|
|
|
|
mbCollapseTree: TMenuItem;
|
|
|
|
|
mbExpandTree: TMenuItem;
|
|
|
|
|
mbCheck: TMenuItem;
|
|
|
|
|
mbCheckAll: TMenuItem;
|
|
|
|
|
mbCheckInvert: TMenuItem;
|
|
|
|
|
mbCheckNone: TMenuItem;
|
|
|
|
|
mbOptions: TMenuItem;
|
|
|
|
|
mbHelp: TMenuItem;
|
|
|
|
|
mbOnlineHelp: TMenuItem;
|
|
|
|
|
mbAbout: TMenuItem;
|
|
|
|
|
mbOptonsMain: TMenuItem;
|
|
|
|
|
mbOptionsPkg: TMenuItem;
|
|
|
|
|
pmInstallTree: TPopupMenu;
|
|
|
|
|
pmInstallCheck: TPopupMenu;
|
2019-01-12 20:24:13 +00:00
|
|
|
|
procedure DataModuleCreate(Sender: TObject);
|
2019-01-12 17:05:16 +00:00
|
|
|
|
private
|
2019-01-12 20:24:13 +00:00
|
|
|
|
// Подготовка директорий
|
|
|
|
|
procedure PrepareDirs();
|
|
|
|
|
// Подготовка списков пакетов
|
|
|
|
|
procedure PreparePackages();
|
2019-01-12 17:05:16 +00:00
|
|
|
|
public
|
2019-01-12 20:24:13 +00:00
|
|
|
|
{ Публичные переменные, которые доступны во всех юнитах с подключенным uses ..., dMain }
|
2019-01-12 17:05:16 +00:00
|
|
|
|
|
2019-01-12 20:24:13 +00:00
|
|
|
|
// путь к файлу ABTool.exe
|
|
|
|
|
ABToolExePath: String;
|
|
|
|
|
// путь к директории ABTool
|
|
|
|
|
ABToolDataPath: String;
|
|
|
|
|
// путь к директории ABTool\Packages
|
|
|
|
|
ABToolPkgPath: String;
|
|
|
|
|
// путь к директории ABTool\Languages
|
|
|
|
|
ABToolLangPath: String;
|
|
|
|
|
// путь к директории ABTool\Logs
|
|
|
|
|
ABToolLogPath: String;
|
|
|
|
|
// Список объектов пакетов программ для установки
|
|
|
|
|
SoftPackages: TPackageList;
|
|
|
|
|
// Список объектов пакетов утилит для запуска
|
|
|
|
|
ToolsPackages: TPackageList;
|
2019-01-12 17:05:16 +00:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
var
|
2019-01-12 20:24:13 +00:00
|
|
|
|
dmMain: TdmMain;
|
2019-01-12 17:05:16 +00:00
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
{$R *.lfm}
|
|
|
|
|
|
2019-01-12 20:24:13 +00:00
|
|
|
|
{ TdmMain }
|
|
|
|
|
|
|
|
|
|
{------------------------------------------------------------------------------
|
|
|
|
|
Конструктор: TdmMain.Create()
|
|
|
|
|
Назначение: Создание датамодуля, подготовка путей и списков пакетов
|
|
|
|
|
Вх. параметры: Sender: TObject
|
|
|
|
|
------------------------------------------------------------------------------}
|
|
|
|
|
procedure TdmMain.DataModuleCreate(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
PrepareDirs();
|
|
|
|
|
PreparePackages();
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
{------------------------------------------------------------------------------
|
|
|
|
|
Процедура: TdmMain.PreparePackages()
|
|
|
|
|
Назначение: Подготовка директорий
|
|
|
|
|
------------------------------------------------------------------------------}
|
|
|
|
|
procedure TdmMain.PrepareDirs();
|
|
|
|
|
begin
|
|
|
|
|
ABToolExePath := ExtractFilePath(ParamStr(0));
|
|
|
|
|
ABToolDataPath := ABToolExePath + 'ABTool\';
|
|
|
|
|
ABToolPkgPath := ABToolDataPath + 'Packages\';
|
|
|
|
|
ABToolLangPath := ABToolDataPath + 'Languages\';
|
|
|
|
|
ABToolLogPath := ABToolDataPath + 'Logs\';
|
|
|
|
|
if not DirectoryExists(ABToolPkgPath) then
|
|
|
|
|
ForceDirectories(ABToolPkgPath);
|
|
|
|
|
if not DirectoryExists(ABToolLangPath) then
|
|
|
|
|
ForceDirectories(ABToolLangPath);
|
|
|
|
|
if not DirectoryExists(ABToolLogPath) then
|
|
|
|
|
ForceDirectories(ABToolLogPath);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
{------------------------------------------------------------------------------
|
|
|
|
|
Процедура: TdmMain.PreparePackages()
|
|
|
|
|
Назначение: Подготовка списков пакетов
|
|
|
|
|
------------------------------------------------------------------------------}
|
|
|
|
|
procedure TdmMain.PreparePackages();
|
|
|
|
|
begin
|
|
|
|
|
SoftPackages := TPackageList.Create;
|
|
|
|
|
SoftPackages.Load(ptSoft);
|
|
|
|
|
ToolsPackages := TPackageList.Create;
|
|
|
|
|
ToolsPackages.Load(ptTools);
|
|
|
|
|
end;
|
2019-01-12 17:05:16 +00:00
|
|
|
|
|
|
|
|
|
end.
|
|
|
|
|
|