[Setup]
AppVersion=1.5
AppName=My Prog
DefaultDirName=.\{#SetupSetting('AppName')}
OutputDir=.
Uninstallable=false
CreateUninstallRegKey=false
DirExistsWarning=false
[Run]
Filename: "{win}\system32\cmd.EXE"; Description: "Launch Console"; Flags: postinstall skipifsilent nowait
Filename: "{win}\system32\control.EXE"; Description: "Launch Panel"; Flags: postinstall skipifsilent unchecked nowait
Filename: "{win}\system32\notepad.EXE"; Description: "Launch Notepad"; Flags: postinstall skipifsilent unchecked
Filename: "{win}\system32\calc.EXE"; Description: "Launch Calculator"; Flags: postinstall skipifsilent unchecked
[Code]
type
TRunEntry = record
Caption: string;
Checked: Boolean;
Object: TObject;
end;
procedure RebuildRunList;
var
RunEntries: array of TRunEntry;
I: Integer;
begin
{ Save run list ... }
SetArrayLength(RunEntries, WizardForm.RunList.Items.Count);
for I := 0 to WizardForm.RunList.Items.Count - 1 do
begin
RunEntries[I].Caption := WizardForm.RunList.ItemCaption[I];
RunEntries[I].Checked := WizardForm.RunList.Checked[I];
RunEntries[I].Object := WizardForm.RunList.ItemObject[I];
end;
{ ... clear it ... }
WizardForm.RunList.Items.Clear;
{ ... and re-create }
for I := 0 to GetArrayLength(RunEntries) - 1 do
begin
{ the first two entries are radio buttons }
if (I = 2) or (I = 3) then
begin
WizardForm.RunList.AddRadioButton(
RunEntries[I].Caption, '', 0, RunEntries[I].Checked, True,
RunEntries[I].Object);
end
else
begin
WizardForm.RunList.AddCheckBox(
RunEntries[I].Caption, '', 0, RunEntries[I].Checked, True, True, True,
RunEntries[I].Object);
end;
end;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpFinished then
begin
RebuildRunList;
end;
end;