This is not easy to do by default. But it can be done, the following code has created a page similar to this one. 
[Setup] AppName=Test AppVersion=1.5 DefaultDirName={code:AppDir} ;Disable all of the default wizard pages DisableDirPage=yes DisableProgramGroupPage=yes DisableReadyMemo=yes DisableReadyPage=yes DisableStartupPrompt=yes DisableWelcomePage=yes ;May want this, after install. DisableFinishedPage=no [Messages] ButtonNext=Install [Files] Source:"e:\test.txt"; DestDir: "{app}" Source:"e:\test.txt"; DestDir: "{app}"; DestName: "test1.txt"; Check: Option1; Source:"e:\test.txt"; DestDir: "{app}"; DestName: "test2.txt"; Check: Option2; [Code] var MainPage : TWizardPage; edtFolderToInstall : TEdit; InstallLocation : String; Opt1, Opt2 : Boolean; ChkOption1 : TCheckBox; ChkOption2 : TCheckBox; function AppDir(Param: String): String; begin // Set Default if not set. if InstallLocation = '' then InstallLocation := ExpandConstant('{pf}') + 'test'; result := InstallLocation; end; function Option1 : Boolean; begin result := Opt1; end; function Option2 : Boolean; begin result := Opt2; end; procedure BrowseClick(Sender : TObject); var Dir : String; begin Dir := edtFolderToInstall.Text; if BrowseForFolder('Select Folder',Dir,false) then edtFolderToInstall.Text := Dir; end; procedure InitializeWizard(); var lblFolderToInstall : TLabel; btnFolderToInstall : TButton; begin MainPage := CreateCustomPage(wpWelcome,'Setup - Test App Name','This will install "Test App Name" to your computer'); lblFolderToInstall := TLabel.Create(MainPage); lblFolderToInstall.Parent := MainPage.Surface; lblFolderToInstall.Top := 10; lblFolderToInstall.Left := 10; lblFolderToInstall.Caption := 'If you would like to select a different folder, Click Browse.' edtFolderToInstall := TEdit.Create(MainPage); edtFolderToInstall.Parent := MainPage.Surface; edtFolderToInstall.Top := 25; edtFolderToInstall.Left := 10; edtFolderToInstall.Width := 250; edtFolderToInstall.Text := WizardDirValue; btnFolderToInstall := TButton.Create(MainPage); btnFolderToInstall.Parent := MainPage.Surface; btnFolderToInstall.top := 25; btnFolderToInstall.Left := 275; btnfolderToInstall.Caption := 'Browse...'; btnFolderToInstall.OnClick := @BrowseClick; ChkOption1 := TCheckBox.Create(MainForm); ChkOption1.Parent := MainPage.Surface; ChkOption1.Top := 50; ChkOption1.Left := 10; ChkOption1.Caption := 'Option 1'; ChkOption2 := TCheckBox.Create(MainForm); ChkOption2.Parent := MainPage.Surface; ChkOption2.Top := 75; ChkOption2.Left := 10; ChkOption2.Caption := 'Option 2'; end; function NextButtonClick(CurPageID: Integer): Boolean; begin result := True; // Next pressed, better make sure selected items are correct. if CurPageId = MainPage.ID then begin InstallLocation := edtFolderToInstall.Text; Opt1 := ChkOption1.Checked; Opt2 := ChkOption2.Checked; end; end;
To disable this, I use {code:AppDir} as the default directory. This tells InnoSetup to use the AppDir function to retrieve the installation directory. Then I can install it using my custom dialog.
Instead of using [Components] and / or [Tasks] I need to use Check in the [Files] section.
source share