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

限于喜欢 提交于 2019-12-03 18:03:56

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/28349106/how-do-you-find-the-user-selected-install-path-in-inno-setup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!