inno-setup

Inno Setup: how to use {app} in InitializeWizard Procedure


How can I gain access to the {app} variable in the InitializeWizard procedure ?

When I use ExpandConstant('{app}'); I get the next error message:

An attempt to expand the {app} constant was made before it was initialized


Solution

  • Found the answer :)

    Prototype:

    function WizardDirValue: String;
    

    Description:

    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.

    ref. https://jrsoftware.org/ishelp/index.php?topic=isxfunc_wizarddirvalue