inno-setup

Default value for CreateInputDirPage in Inno Setup


The following was taken directly from 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';

This creates a page with two textboxes. The first textbox is empty, the second is "DefaultValue" a string with the current directory prepended to it.

How do I create a default value that does not have the current directory prepended?


Solution

  • If you use a relative path, the Inno Setup resolves it relatively to the current working directory (as all Windows applications do).

    Use an absolute path instead.

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