
[Setup]
AppName=Denkovi JExtraPack - Ver 1.1
AppVerName=Denkovi JExtraPack - Ver 1.1
DefaultDirName={pf32}\Denkovi A. E. LTD\Denkovi JExtraPack\Ver 1.1
DefaultGroupName=Denkovi A. E. LTD\Denkovi JExtraPack

[Files]
Source: "jre-6u24-windows-i586-s.exe";   DestDir:  "{app}\Platforms\Java"
Source: "CDM20802_Setup.exe";            DestDir:  "{app}\Drivers\FTDI"

;Icon
Source: "JExtraPack.ico";                DestDir:  "{app}"

;Manager
Source: "ftd2xx.dll";                    DestDir:  "{app}\Manager"
Source: "JD2XX.dll";                     DestDir:  "{app}\Manager"
Source: "Manager\Manager.jar";           DestDir:  "{app}\Manager"


;Alarm
Source: "ftd2xx.dll";                    DestDir:  "{app}\Alarm"
Source: "JD2XX.dll";                     DestDir:  "{app}\Alarm"
Source: "Alarm\Alarm.jar";               DestDir:  "{app}\Alarm"

 
;Timer
Source: "ftd2xx.dll";                    DestDir:  "{app}\Timer"
Source: "JD2XX.dll";                     DestDir:  "{app}\Timer"
Source: "Timer\Timer.jar";               DestDir:  "{app}\Timer"


[Icons]
;Manager
Name: "{commondesktop}\Manager v1.1"; Filename: "{app}\Manager\Manager.jar"; IconFilename: "{app}\JExtraPack.ico";  WorkingDir: "{app}\Manager"
Name: "{group}\Manager"; Filename: "{app}\Manager\Manager.jar"; IconFilename: "{app}\JExtraPack.ico";  WorkingDir: "{app}\Manager"

;Alarm
Name: "{commondesktop}\Alarm v1.1"; Filename: "{app}\Alarm\Alarm.jar"; IconFilename: "{app}\JExtraPack.ico";  WorkingDir: "{app}\Alarm"
Name: "{group}\Alarm"; Filename: "{app}\Alarm\Alarm.jar"; IconFilename: "{app}\JExtraPack.ico";  WorkingDir: "{app}\Alarm"

;Timer
Name: "{commondesktop}\Timer v1.1"; Filename: "{app}\Timer\Timer.jar"; IconFilename: "{app}\JExtraPack.ico";  WorkingDir: "{app}\Timer"
Name: "{group}\Timer"; Filename: "{app}\Timer\Timer.jar"; IconFilename: "{app}\JExtraPack.ico";  WorkingDir: "{app}\Timer"

;Uninstall
Name: "{group}\Uninstall"; Filename: "{app}\unins000.exe";  WorkingDir: "{app}\"

[Run]
Filename: "{app}\Platforms\Java\jre-6u24-windows-i586-s.exe"; Check: JVM_Check
Filename: "{app}\Drivers\FTDI\CDM20802_Setup.exe"; Check: FTDIDRIVERS_Check
 
[Code]
var
  MyProgChecked1: Boolean;
  MyProgCheckResult1: Boolean;
  
  MyProgChecked2: Boolean;
  MyProgCheckResult2: Boolean;


function JVM_Check(): Boolean;
begin
  if not MyProgChecked1 then begin
    MyProgCheckResult1 := MsgBox('This software requires Java Virtual Machine (JVM), do you want to install it?', mbConfirmation, MB_YESNO) = idYes;
    MyProgChecked1 := True;
  end;
  Result := MyProgCheckResult1;
end;

function FTDIDRIVERS_Check(): Boolean;
begin
  if not MyProgChecked2 then begin
    MyProgCheckResult2 := MsgBox('Do you want to install FTDI VCP Drivers ?', mbConfirmation, MB_YESNO) = idYes;
    MyProgChecked2 := True;
  end;
  Result := MyProgCheckResult2;
end;
