#define FolderName "MyPogram"
[Setup]
AppName=My program
AppVerName=My program 1.5
DefaultDirName={pf}
[Languages]
Name: rus; MessagesFile: compiler:Languages\Russian.isl
;[Files]
;Source: "1.txt"; DestDir: "{app}"; Flags: ignoreversion; Check: CheckPath1
;Source: "2.txt"; DestDir: "{app}"; Flags: ignoreversion; Check: CheckPath2
;Source: "3.txt"; DestDir: "{app}"; Flags: ignoreversion; Check: CheckPath3
;Source: "4.txt"; DestDir: "{app}"; Flags: ignoreversion; Check: CheckPath4
[code]
var
CustomPage: TInputOptionWizardPage;
function CheckPath1: Boolean; begin Result:= CustomPage.SelectedValueIndex = 0; end;
function CheckPath2: Boolean; begin Result:= CustomPage.SelectedValueIndex = 1; end;
function CheckPath3: Boolean; begin Result:= CustomPage.SelectedValueIndex = 2; end;
function CheckPath4: Boolean; begin Result:= CustomPage.SelectedValueIndex = 3; end;
Procedure InitializeWizard;
Begin
CustomPage:= CreateInputOptionPage(wpInfoBefore,
'', '',
'Выберите путь расположения и нажмите <<Далее>>:',
True, False);
CustomPage.Add('в папке с установщиком');
CustomPage.Add('на системном диске');
CustomPage.Add('в папке Program Files');
if IsWin64 then CustomPage.Add('в папке Program Files x64');
CustomPage.SelectedValueIndex:= 1;
end;
procedure CurPageChanged(CurPageID: Integer);
var
S: String;
begin
case CustomPage.SelectedValueIndex of
0: S:= ExpandConstant('{src}\{#FolderName}');
1: S:= ExpandConstant('{sd}\{#FolderName}');
2: S:= ExpandConstant('{pf32}\{#FolderName}');
3: S:= ExpandConstant('{pf64}\{#FolderName}');
end;
case CurPageID of
wpSelectDir:
begin
WizardForm.DirEdit.Text:= S;
end;
end;
end;