Inno Setup 中 CreateInputDirPage 的默认值

问题描述 投票:0回答:1

以下内容直接取自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
1个回答
3
投票

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

请使用绝对路径。

Page.Values[1] := 'C:\path\to\default\folder';
© www.soinside.com 2019 - 2024. All rights reserved.