1

I'm using AfterInstall on a [Files] entry with a wildcard Source parameter. Calling CurrentSourceFilename simply gives me the source pattern -- not the actual file that is being processed. Is there any way to get the actual filename?

The following example would log {code:DirName}\*.ext once for each file, not {code:DirName}\file1.ext, {code:DirName}\file2.ext etc.

[Files]
Source: "{code:DirName}\*.ext"; Flags: external; AfterInstall: LogName
[Code]
procedure LogName;
begin
  Log(CurrentSourceFilename);
end;

function DirName(Param: String): String;
begin
  Result := 'dir';
end;
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
jacwah
  • 2,727
  • 2
  • 21
  • 42

1 Answers1

1

There's indeed no way to retrieve that information, when external flag is used - seems like a bug to me.

Without external flag, you can find out a file name using CurrentFilename.


Instead, you can code the file copy (including the logging) in Pascal script.

See Inno Setup: copy folder, subfolders and files recursively in Code section.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992