I have to install an application that relies on a web server (XAMPP), so I'd like to add to my setup wizard a form that notifies the user if a given folder (of XAMPP) does not exist, then to provide a textbox and to ask the user to specify a folder name where this web server is installed.
I'd like to keep this folder name as a variable, since later I have to place some files in that folder.
Can you guide me how to do so?
Thank you
Use the CreateInputDirPage
function to create the page/form.
Use a scripted constant to install the files to the selected folder.
[Files]
Source: "somefile.txt"; DestDir: "{code:GetOtherDir}"
[Code]
var
OtherInputDirPage: TInputDirWizardPage;
procedure InitializeWizard;
begin
OtherInputDirPage :=
CreateInputDirPage(wpSelectDir, 'Select xampp directory', '', '', False, '');
OtherInputDirPage.Add('');
end;
function GetOtherDir(Param: String): String;
begin
Result := OtherInputDirPage.Values[0];
end;
You should add some validation.
See also the article Prompt for an additional folder for data on ISXKB.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With