;------------------------------------------------------------------------------------------------------------------------------------------------
#define FilesCheck /* проверка на наличие файлов */
#define File1 "{src}\DirectX\DXSETUP.exe" /* путь и название файла 1 */
#define File2 "{src}\VC\2012\vcredist_x64.exe" /* путь и название файла 2 */
#define File3 "{src}\PhysX\physx_9.10.0513_systemsoftware.exe" /* путь и название файла 3 */
; и так далее
;------------------------------------------------------------------------------------------------------------------------------------------------
[Setup]
AppName=My Program
AppVerName=My Program 1.5
DefaultDirName={pf}\My Program
OutputDir=.
[Languages]
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
[Types]
Name: full; Description: Full installation; Flags: iscustom
[Components]
Name: comp; Description: Компоненты:; Types: full; Check: (CheckFile1 or CheckFile2 or CheckFile3);
Name: comp; Description: Нет установочных файлов; Flags: fixed; Types: full; Check: not (CheckFile1 or CheckFile2 or CheckFile3);
Name: comp\DirectX; Description: Microsoft DirectX; Types: full; Check: (CheckFile1);
Name: comp\VCRedist; Description: Microsoft VCRedist; Types: full; Check: (CheckFile2);
Name: comp\PhysX; Description: PhysX; Types: full; Check: (CheckFile3);
Код:
function CheckFile1:boolean;
begin
#ifdef File1
result:= FileExists(ExpandConstant('{#File1}'));
#else
result:= false;
#endif
end;
function CheckFile2:boolean;
begin
#ifdef File2
result:= FileExists(ExpandConstant('{#File2}'));
#else
result:= false;
#endif
end;
function CheckFile3:boolean;
begin
#ifdef File3
result:= FileExists(ExpandConstant('{#File3}'));
#else
result:= false;
#endif
end;
// и так далее
procedure CurPageChanged(CurPageID: Integer);
begin
case CurPageID of
wpSelectComponents:
begin
#ifdef FilesCheck
if not (CheckFile1 or CheckFile2 or CheckFile3) then
WizardForm.NextButton.Enabled:=false;
#endif
end;
end;
end;
[/SPOILER]