How do you find the user-selected installation path in Inno Setup?

I need to get the path that the user chose to install my application.

If I set CreateAppDir=yes and set DefaultDirName=C:\MyApp\ , the user can change it to another directory. After that, I should know which directory they selected in the next step of the installation wizard. How can I get this value?

+6
source share
1 answer

Use the constant {app} . The link describes this as:

The application directory that the user selects on the Select Destination Location page of the wizard. For example: if you used {app} \ MYPROG.EXE to write, and the user selected "C: \ MYPROG" as the application directory, the installation program will transfer it to "C: \ MyProg \ MYPROG.EXE".

Optionally, you can use the WizardDirValue function. It is described as:

Gets the current contents of the edit control in the Select Page of the destination of the wizard.

Unlike ExpandConstant ('{app}'), this function will not work if called after the wizard shows, but before the user selects the directory. Rather, it will return the default directory name.

+8
source

Source: https://habr.com/ru/post/982054/


All Articles