[Setup]
AppName=Test
AppVerName=Test
CreateAppDir=no
OutputDir=.
[Code]
var
AllValue: TStringList;
procedure CreateValueList(s: String);
var
tmp: String;
i: Integer;
begin
if not Assigned(AllValue) then AllValue:=TStringList.Create;
if Assigned(AllValue) then AllValue.Clear;
for i:=1 to Length(s) do begin
if s[i] <> '@' then tmp:=tmp+s[i]
else begin
if s[i] = ',' then Continue;
AllValue.Add(tmp);
tmp:='';
end;
if i>=Length(s) then AllValue.Add(tmp);
end;
end;
function ReadAllValue(FileName, Section: String): Boolean;
var
i, f: Integer;
tmp: AnsiString;
begin
if not FileExists(Filename) then Result:=False
else begin
LoadStringFromFile(FileName, tmp);
for i:=Pos(Section, tmp) + Length(Section) to Length(tmp)-1 do begin
if tmp[i] <> #13 then f:=f+1 else Break;
end;
CreateValueList(Copy(tmp, Pos(Section, tmp)+Length(Section), f));
Result:=True;
end;
end;
procedure InitializeWizard;
begin
with WizardForm do begin
Position:=poScreenCenter;
OuterNotebook.Hide; Bevel.Hide;
WelcomeLabel2.SetBounds(ScaleX(10), ScaleY(10), ScaleX(300), ScaleY(300));
WelcomeLabel2.Parent:=WizardForm;
WelcomeLabel2.Caption:='';
end;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
WizardForm.NextButton.Caption:='Read File';
end;
function NextButtonClick(CurPageID: Integer): Boolean;
var
i: Integer;
begin
if not ReadAllValue(ExpandConstant('{src}\file.inf'), 'CopyFiles') then WizardForm.WelcomeLabel2.Caption:='нет файла или значений'
else begin
WizardForm.WelcomeLabel2.Caption:='';
for i:=1 to AllValue.Count-1 do WizardForm.WelcomeLabel2.Caption:=WizardForm.WelcomeLabel2.Caption+'Значение '+IntToStr(i)+': '+AllValue.Strings[i]+#13;
end;
end;