Yes, it runs once for each file. reference says this (emphasized by me):
The BeforeInstall or AfterInstall function to write the [Files] section uses a wildcard once per file , matching the pattern. using CurrentFileName to check for which file the function is being called.
And no, there is no way to call it once after all the files are installed. If you intend to run it only once, this will not be a problem, since you can declare a flag variable indicating that the function has already been called, but you want to determine if it was the last call, and there is no workaround for this.
Well, maybe if you find out which file will be the last to be installed from this folder, you can check this for the result of CurrentFileName , but I doubt that you can determine which one will be installed last at compile time (since at runtime in There is currently no way to get a list of files to install).
TLama source share