Click here to Skip to main content
15,888,802 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I need to user to browse to folder while in installation, select it, and then have this folder copied from selected source to application folder.

C#
ExistfilePage := CreateInputDirPage(OptionPage.ID,
    'Select File Location', 'Where should personal data files be stored?',
  'Personal data files will be stored in the following folder.'#13#10#13#10 +
  'To continue, click Next. If you would like to select a different folder, click Browse.',False, 'New Folder');
     ExistfilePage.Add('');
ExistfilePage.Values[0] := ExpandConstant('E:\Source_Inno');
// retrive folder name....
Folderpath := ExistfilePage.Values[0];
end;


From "Folderpath" variable retrive the folder path
Now I want to copy the browsed file in to my application directory.

Please any one suggest an idea to accomplish this

What I have tried:

function GetFilename(const Value: string): string;
begin
Result := '';
if FileExists(ExistfilePage.Values[0]) then
Result := (ExistfilePage.Values[0]);
end;

and
[File]
Source: "{code:GetFilename}"; DestDir: "{app}"; Flags: external
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900