Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

If I set CreateAppDir=yes and set a DefaultDirName=C:\MyApp\ the user can change it to some other directory. After they do this, I need to know which directory they chose on the next install wizard step. How can I get this value?

like image 475
RichC Avatar asked Feb 05 '15 16:02

RichC


People also ask

What is an installation path?

The installation path is the folder, relative to your domain name's document root folder. For example, if the installation path is “/” this means that your website will appear when someone types in yourdomain.com in their browser.

What is an Inno Setup file?

Inno Setup is a free software script-driven installation system created in Delphi by Jordan Russell. The first version was released in 1997.

How do I make an inno file executable?

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. Innosetup offers an awesome alternative to create great looking Installers for free.

How do I add a checkbox in Inno?

[Code] procedure ExitProcess(uExitCode: UINT); external '[email protected] stdcall'; var MainPage : TWizardPage; FolderToInstall : TEdit; InstallLocation : String; procedure CancelClick(Sender: TObject); begin if ExitSetupMsgBox then begin ExitProcess(0); end; end; procedure BrowseClick(Sender : TObject); var ...


1 Answers

Use the {app} constant. The reference describes it as:

The application directory, which the user selects on the Select Destination Location page of the wizard. For example: If you used {app}\MYPROG.EXE on an entry and the user selected "C:\MYPROG" as the application directory, Setup will translate it to "C:\MYPROG\MYPROG.EXE".

Optionally you can use the WizardDirValue function. This one is described as:

Returns the current contents of the edit control on the Select Destination Location page of the wizard.

Unlike ExpandConstant('{app}'), this function will not fail if called after the wizard is shown but prior to the user selecting a directory. Rather, it will return the default directory name.

like image 102
TLama Avatar answered Nov 11 '22 14:11

TLama