Inno Setup - How to get the path to the current copied file from the Files section

I have a .iss script with the following code:

[Files]
Source: "..\*.ext"; DestDir: "{tmp}\Test\"; \
   AfterInstall: DoSomething('{path}'); Flags: ignoreversion recursesubdirs createallsubdirs;

[Code]

procedure DoSomething(path: string)
...
end;

I need to call a procedure DoSomething()and pass it the path to the current copied file for each file. How can I get the path to the current file from the section [Files]?

+4
source share
1 answer

Quoting the parameter documentationAfterInstall :

Use CurrentFilenameto check which file the function is called for.

(link added by me)


[Files]
Source: "..\*.ext"; DestDir: "{tmp}\Test\"; \
   AfterInstall: DoSomething; Flags: ignoreversion recursesubdirs createallsubdirs;

[Code]

procedure DoSomething;
var
  Path: string;
begin
  Path := CurrentFilename;
  { ... }
end;
+1
source

Source: https://habr.com/ru/post/1663742/


All Articles