//Скрипт создан через Мастер Inno Setup Script.
//ИСПОЛЬЗУЙТЕ ДОКУМЕНТАЦИЮ ДЛЯ ПОДРОБНОСТЕЙ ИСПОЛЬЗОВАНИЯ INNO SETUP!
#define MyAppName "My Program"
#define MyAppVersion "1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "MyProg.exe"
[Setup]
//Примечание: Значение AppId идентифицирует это приложение.
//Не используйте одно и тоже значение в разных установках.
//(Для генерации значения GUID, нажмите Инструменты | Генерация GUID.)
AppId={{DDDA5602-14C2-4999-8A4B-2E92644FE766}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
[CustomMessages]
Comp0 = Tasks1
Comp1 = Обновление DirectX
Comp2 = Установка Microsoft Visual C++...
[Languages]
Name: "default"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "C:\Program Files (x86)\Inno Setup 5\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion
//Примечание: Не используйте "Flags: ignoreversion" для системных файлов
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
Filename: {src}\Redist\DirectX.exe; Parameters: /q; StatusMsg: Обновление DirectX...; Flags: skipifdoesntexist unchecked; Check: CheckListBoxChecked(ExpandConstant('{cm:Comp1}'));
Filename: {src}\Redist\Vcredist_x64.exe; Parameters: /q; StatusMsg: Установка Microsoft Visual C++...; Flags: skipifdoesntexist unchecked; Check: CheckListBoxChecked(ExpandConstant('{cm:Comp2}'));
[code]
var
CheckListBox: TNewCheckListBox;
//===============Неправельно==========================
//function CheckListBoxChecked(int: integer): boolean;
//begin
//if (int >= 0) and (int < CheckListBox.ItemCount) then
// Result:= CheckListBox.Checked[int]
//else
// Result:= false;
//end;
//====================================================
Function CheckListBoxChecked(Name: String): Boolean;
var
I: Integer;
begin
Result := False;
for I := 0 to CheckListBox.ItemCount - 1 do
begin
if (I <= CheckListBox.ItemCount) then
Result := CheckListBox.Checked[CheckListBox.Items.IndexOf(Name)];
end;
end;
procedure InitializeWizard();
begin
CheckListBox := TNewCheckListBox.Create(WizardForm);
with CheckListBox do
begin
BorderStyle:= bsNone;
Cursor := crHand;
Parent := WizardForm;
TreeViewStyle := false;
SetBounds(170,165,280,100);
Font.Name:='Calibri';
Font.Color:=clRed;
Font.Height := -14;
// Color:= clRed;
WantTabs:= True;
// Font.Style:=[fsBold];
AddCheckBox(CustomMessage('Comp0'), '', 0, False, True, False, True, nil);
AddCheckBox(CustomMessage('Comp1'), '', 1, False, True, False, True, nil);
AddCheckBox(CustomMessage('Comp2'), '', 1, False, True, False, True, nil);
AddCheckBox(CustomMessage('Comp2'), '', 2, False, True, False, True, nil);
end;
end;