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?
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.
Inno Setup is a free software script-driven installation system created in Delphi by Jordan Russell. The first version was released in 1997.
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.
[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 ...
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With