简体   繁体   English

如何在ini文件中设置Inno设置中的DefaultDirName?

[英]How do I set DefaultDirName in an Inno setup from an ini file?

我需要从Windows目录中的ini文件中提取DefaultDirName信息,我该怎么做?


I use following code in [code] section to get string from INI file (in example: [InstallSettings] section, variable name: DefDirName): 我在[code]部分使用以下代码从INI文件中获取字符串(例如:[InstallSettings]部分,变量名:DefDirName):

[code]
function GetDefDirName(Param: String): String;
begin
  Result := GetIniString('InstallSettings', 'DefDirName', '', 'c:\your_app_dir\file_with_info.ini'));
end;

and, at the very top of script in [Setup] section: 并且,在[Setup]部分的脚本顶部:

DefaultDirName={code:GetDefDirName}

you can also do. 你也可以。

[Setup]
DefaultDirName={ini:Filename,Section,Key|DefaultValue}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM