Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to allow a user to skip a TInputDirWizardPage in Inno Setup?

I have an installer using Inno Setup that allows the user to select a file location, at install time. The file is kind of like an answers file to help with installation.

For this prompt, I'm using the TInputDirWizardPage.

It works fine when the user is using this file, but if he doesn't wish to, it automatically throws an error telling him that he must enter a path.

Is there a way to NOT force validation so that the user can just hit next and let me figure out that he doesn't have a file?

like image 774
Mike Avatar asked Jul 29 '14 21:07

Mike


People also ask

How do I add a checkbox in Inno?

You need to make a Check function which will return state of the check box from the [Code] section of your script. Something like this might do what you want, but before the code script I would correct you in the following: use TNew... classes where you're able to, so in your case use TNewEdit instead of TEdit.

What language is Inno Setup?

It defines two languages: English, based on the standard Default. isl file, and Dutch, based on a third-party translation.

What is Inno Setup compiler?

Inno Setup is a free software script-driven installation system created in Delphi by Jordan Russell. The first version was released in 1997. Inno Setup. Screenshot of the Inno Setup IDE running on Windows 7. Developer(s)

How do I Setup an Inno Setup?

Go to Menu, Project, then Compile to compile and create the setup file. This will create a complete installer. Run the Setup and your application will be installed correctly.


1 Answers

Unfortunately no. This is hardcoded in the TInputDirWizardPage.NextButtonClick method, which internally validates all the edit boxes by calling ValidateCustomDirEdit function, which doesn't care if the edit has been left intentionally empty; it just checks if it contains a valid directory path. Or, in other words, the TInputDirWizardPage fields are not optional, they must contain valid paths at this time.

Well, I don't feel this was an expected behavior. If you compare file and dir input page, they differ. Whilst in the file input page you can leave edit boxes empty, in dir input page you cannot. I think, that would be enough if there would be a check if the edit box is not empty and only if it's not, validate its content. You would be able to check whether the edit is empty by yourself (if you'd require mandatory field), and stop the user on that page, but you are not able to suppress that validation if the edit is empty.

In your situation I would consider using TInputFileWizardPage as you were talking about a file input, or creating your own directory input page.

like image 187
TLama Avatar answered Nov 23 '22 02:11

TLama