您如何在Inno Setup中找到用户选择的安装路径? [英] 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.
如果我设置了CreateAppDir=yes
并设置了DefaultDirName=C:\MyApp\
,则用户可以将其更改为其他目录.完成此操作后,我需要知道他们在下一步安装向导步骤中选择的目录.我如何获得该价值?
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?
推荐答案
使用 {app}
常量.该参考文献将其描述为:
Use the {app}
constant. The reference describes it as:
用户在Select上选择的应用程序目录 向导的目标位置"页面.例如:如果您使用 {app} \ MYPROG.EXE,并且用户选择"C:\ MYPROG"作为 应用程序目录,安装程序会将其转换为 "C:\ MYPROG \ MYPROG.EXE".
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".
(可选)您可以使用 WizardDirValue
函数.这个描述为:
Optionally you can use the WizardDirValue
function. This one is described as:
返回Select上编辑控件的当前内容 向导的目标位置"页面.
Returns the current contents of the edit control on the Select Destination Location page of the wizard.
与ExpandConstant('{app}')不同,此函数在调用时不会失败 在显示向导之后但在用户选择目录之前. 相反,它将返回默认目录名称.
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.
这篇关于您如何在Inno Setup中找到用户选择的安装路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!