program driverx;

uses
  Forms,
  windows,
  Unit1 in 'Unit1.pas' {Form1},
  parseinf in 'parseinf.pas',
  Settings in 'Settings.pas' {Form2},
  JclCompression in 'JclCompression.pas',
  sevenzip in 'sevenzip.pas',
  mysetupApi in 'mysetupApi.pas',
  SysUtils,
  dialogs,
  unFileMapping in 'unFileMapping.pas',
  Indexobj in 'Indexobj.pas',
  Unit3 in 'Unit3.pas' {Form3},
  splash in 'splash.pas' {SplashForm},
  about in 'about.pas' {AboutBox},
  Gauges in 'Gauges.pas',
  NewParser in 'NewParser.pas',
  emulate in 'emulate.pas' {Form4},
  ulog in 'ulog.pas';

{$R *.res}
{$R UAC_Manifest.RES}


{$SETPEFlAGS IMAGE_FILE_RELOCS_STRIPPED or IMAGE_FILE_DEBUG_STRIPPED or
  IMAGE_FILE_LINE_NUMS_STRIPPED or IMAGE_FILE_LOCAL_SYMS_STRIPPED or
  IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP or IMAGE_FILE_NET_RUN_FROM_SWAP}

///{$R vista.RES}

var
msg:string;
Files_Exist:array[1..3] of boolean;
i:integer;
//Map12:TMappedFile;
//P1:pchar;
//k:char;
Appdir:string;

const
  Files:array[1..3] of string= (
'.\tools\7z.dll',
'.\tools\devcon.exe',
'.\tools\devcon64.exe');
  Files_mes:array[1..3] of string= (
'Не наиден 7z.dll в папке tools.'+#13+'Распаковка файлов будет недоступна.'+#13#13,
'Не наиден devcon.exe в папке tools.'+#13+'Установка на 32-битных системах будет недоступна.'+#13#13,
'Не наиден devcon64.exe в папке tools.'+#13+'Установка на 64-битных системах будет недоступна.');



begin


Appdir:=ExtractFilePath( paramstr(0));

  for i:=1 to 3 do
    begin
    Files_exist[i]:=false;
    Files_exist[i]:=fileExists(Appdir+Files[i]);

      if Files_Exist[i]=false then
        msg:=msg+Files_mes[i];
    end;

  for i:=1 to 3 do
    if Files_exist[i]=false then
    begin
    MessageDlg(msg,mtError,[mbOK],0);
    break;
    end;


  Application.Initialize;
  Application.Title := 'DriverX';
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(TForm2, Form2);
  Application.CreateForm(TForm3, Form3);
  Application.CreateForm(TAboutBox, AboutBox);
  Application.CreateForm(TForm4, Form4);
  Application.Run;

end.
