Inno Setup CreateInputDirPage but don't check for folder existence

Dr.YSG

I have an Inno Setup Pascal script that prompts the user for 4 folders. Three of the folders should already exist. The 4th being used as a placeholder where I am going to mount a VHD disk in the future. So all I use is the string value of this folder.

When the user runs the script, he gets an error that the UNC path does not exist (well, yes, it should not exist. For example, if he said "L:\myfolder" then the L: drive is not loaded yet, and there is no disk there. That is correct. My Inno Setup script will load it for you later.

How can I disable checking for the folder?

FoldersPage := CreateInputDirPage(InfoPage.ID,
  'FoldersSettings', 'Customize folders settings for non-standard EGPL systems',
  'If the defaults are acceptable, then click Next.',
  False, 'New Folder');
FoldersPage.Add('GeoPackage Output Folder');
FoldersPage.Add('VHD Mount Path for GeoLibrarian');
FoldersPage.Add('EGPL Source Folder');
FoldersPage.Add('WWW Root Folder');
Martin Prikryl

You cannot disable the validation.

You can workaround that by adding only three inputs using the .Add. And add the fourth input manually, taking control of it.

var
  DataDirPage: TInputDirWizardPage;
  CustomDirEdit: TEdit;

procedure InitializeWizard;
var
  Index: Integer;
  Offset: Integer;
  PromptLabel: TNewStaticText;
  UltimateEdit: TEdit;
  PenultimateEdit: TEdit;
  UltimateLabel: TNewStaticText;
begin
  DataDirPage := CreateInputDirPage(wpSelectDir,
    'FoldersSettings', 'Customize folders settings for non-standard EGPL systems',
    'If the defaults are acceptable, then click Next.',
    False, 'New Folder');

  DataDirPage.Add('GeoPackage Output Folder');
  Index := DataDirPage.Add('VHD Mount Path for GeoLibrarian');
  PenultimateEdit := DataDirPage.Edits[Index];
  Index := DataDirPage.Add('EGPL Source Folder');
  UltimateEdit := DataDirPage.Edits[Index];
  UltimateLabel := DataDirPage.PromptLabels[Index];

  Offset := UltimateEdit.Top - PenultimateEdit.Top;

  PromptLabel := TNewStaticText.Create(WizardForm);
  PromptLabel.Top := UltimateLabel.Top + Offset;
  PromptLabel.Width := UltimateLabel.Width;
  PromptLabel.Height := UltimateLabel.Height;
  PromptLabel.Parent := DataDirPage.Surface;
  PromptLabel.Caption := 'WWW Root Folder';

  CustomDirEdit := TEdit.Create(WizardForm);
  CustomDirEdit.Top := UltimateEdit.Top + Offset;
  CustomDirEdit.Width := UltimateEdit.Width;
  CustomDirEdit.Parent := DataDirPage.Surface;

  PromptLabel.FocusControl := CustomDirEdit;
end;

function NextButtonClick(CurPageID: Integer): Boolean;
begin
  Result := True;

  if CurPageID = DataDirPage.ID then
  begin
    if CustomDirEdit.Text = '' then
    begin
      MsgBox('You must enter WWW Root Folder.', mbError, MB_OK);
      Result := False;
    end;

    // Any other validation
  end;
end;

This does not feature the Browse button. It's yet more work and I'm not sure, if it makes sense, as the input is used to input a path to a drive that does not exist.

enter image description here

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Inno Setup: Get 'Don't create a start menu folder' option

From Dev

Inno Setup: Get 'Don't create a start menu folder' option

From Dev

Checking existence of a file in Inno Setup Internal Temporary folder

From Dev

Check for existence of a shortcut pointing to a specific target in Inno Setup

From Dev

Check for existence of a shortcut pointing to a specific target in Inno Setup

From Dev

Inno setup: don't show option if it is not checked

From Dev

Inno setup: don't show option if it is not checked

From Dev

Inno setup: check for new updates

From Dev

Check System Architecture in Inno Setup

From Dev

Inno setup: check for new updates

From Dev

Check Existence of a folder using Dropbox SDK

From Dev

VBA Error Handling to check for folder existence

From Dev

How to delete a nonempty folder in inno setup

From Dev

Inno Setup: pack folder with all subfolders

From Dev

Inno Setup: Delete folder with Task function

From Dev

Inno Setup - Get a path to parent folder

From Dev

Inno Setup - How to set permissions of installation folder

From Dev

Creating shortcut in startup folder using Inno setup

From Dev

Inno Setup shortcuts for folder are not opening in Windows 10

From Dev

How to check for presence of a directory in Inno Setup preprocessor?

From Dev

How to check if port is usable in Inno Setup?

From Dev

Inno Setup: Check if component was previously downloaded

From Dev

Inno Setup check if a machine is joined to a Domain

From Dev

How to check partition type in inno setup?

From Dev

How to check Internet connection using Inno Setup

From Dev

Inno Setup Check function for Dirs section

From Dev

Inno Setup: Check if component was previously downloaded

From Dev

Inno Setup Check additional (Windows Installer) mutex

From Dev

AppMutex doesn't work on Inno Setup

Related Related

  1. 1

    Inno Setup: Get 'Don't create a start menu folder' option

  2. 2

    Inno Setup: Get 'Don't create a start menu folder' option

  3. 3

    Checking existence of a file in Inno Setup Internal Temporary folder

  4. 4

    Check for existence of a shortcut pointing to a specific target in Inno Setup

  5. 5

    Check for existence of a shortcut pointing to a specific target in Inno Setup

  6. 6

    Inno setup: don't show option if it is not checked

  7. 7

    Inno setup: don't show option if it is not checked

  8. 8

    Inno setup: check for new updates

  9. 9

    Check System Architecture in Inno Setup

  10. 10

    Inno setup: check for new updates

  11. 11

    Check Existence of a folder using Dropbox SDK

  12. 12

    VBA Error Handling to check for folder existence

  13. 13

    How to delete a nonempty folder in inno setup

  14. 14

    Inno Setup: pack folder with all subfolders

  15. 15

    Inno Setup: Delete folder with Task function

  16. 16

    Inno Setup - Get a path to parent folder

  17. 17

    Inno Setup - How to set permissions of installation folder

  18. 18

    Creating shortcut in startup folder using Inno setup

  19. 19

    Inno Setup shortcuts for folder are not opening in Windows 10

  20. 20

    How to check for presence of a directory in Inno Setup preprocessor?

  21. 21

    How to check if port is usable in Inno Setup?

  22. 22

    Inno Setup: Check if component was previously downloaded

  23. 23

    Inno Setup check if a machine is joined to a Domain

  24. 24

    How to check partition type in inno setup?

  25. 25

    How to check Internet connection using Inno Setup

  26. 26

    Inno Setup Check function for Dirs section

  27. 27

    Inno Setup: Check if component was previously downloaded

  28. 28

    Inno Setup Check additional (Windows Installer) mutex

  29. 29

    AppMutex doesn't work on Inno Setup

HotTag

Archive