Title: How to disable "browse" button on defaultDirectory wizard page
Tags: inno-setup
Question: I want to show the user to wich directory the program will be installed. But I do not want to allow him to change that directory. So I thought about disabling the "browse" button and greying the field where you can type a path (disabling anyone from typing in there).

I have read this question, which is about preventing the user to select a wrong directory. In a comment by TLama I saw this:

```
  Wouldn't be the Next button is greyed until the user chooses the right folder quite misleading ? What if I as the user forget the right directory ? Wouldn't be better to disable the choose folder edit box or skip that page at all ?
```

But the User asking the Question did not want to do it the suggested way so there is no further hint for this solution. Could you please tell me how to do this?

(Note: Sorry for opening a new question on such a similar topic, but as a new user I can't see another way of asking for help)


Here is the accepted answer: You can disable the directory edit box with the browse button this way:

```[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program

[Code]
procedure InitializeWizard;
begin
  WizardForm.DirEdit.Enabled := False;
  WizardForm.DirBrowseButton.Enabled := False;
end;
```



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2015:00:06/09/15', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<inno-setup>', 'Title': 'How to disable "browse" button on defaultDirectory wizard page', 'ViewCount': 807, 'id': 30728195, 'user_AboutMe': '<p>BY DAY: Studying electronics and working as a student in a Comany which includes lots of programming.\nBY NIGHT: I try to sleep, because working is a lot more fun if you don\'t need two litres of coffee in the morning, especially as I do not drink any coffee\nFOR FUN: I\'m a member of the local "Royal Rangers" outpost, which is a scouting group.</p>\n', 'user_AccountId': 6263083.0, 'user_DisplayName': 'Viki Stepinfaith', 'user_Reputation': 37.0, 'user_Views': 11.0, 'user_id': 4869637.0}}