Inno Setup 中 CreateInputDirPage 的默认值

Default value for CreateInputDirPage in Inno Setup

以下直接摘自http://www.jrsoftware.org/ishelp/index.php?topic=isxfunc_createinputdirpage

{ Create the page }
Page := CreateInputDirPage(wpWelcome,
  'Select Personal Data Location', 'Where should personal data files be stored?',
  'Personal data files will be stored in the following folder.'#13#10#13#10 +
  'To continue, click Next. If you would like to select a different folder, click Browse.',
  False, 'New Folder');

{ Add item (with an empty caption) }
Page.Add('');
Page.Add('');

Page.Values[1] := 'DefaultValue';

这将创建一个包含两个文本框的页面。第一个文本框是空的,第二个是 "DefaultValue" 一个带有当前目录前缀的字符串。

如何创建一个没有前置当前目录的默认值?

如果您使用相对路径,Inno Setup 会相对于当前工作目录解析它(就像所有 Windows 应用程序一样)。

改用绝对路径。

Page.Values[1] := 'C:\path\to\default\folder';