InnoSetup - Erroneous "File in use by another process..." message while compiling
I had the same problem. It was due to McAfee antivirus running the realtime scanning on the exe file being compiled... As it doesn't seem possible to exclude a directory from realtime scanning, I shut it down in McAfee SecurityCenter, and now it's good. Hope this help
The problem is often an explorer window being open viewing the folder where the output files will reside.
Explorer continually opens the executable as it is built trying to fetch its icon and other metadata. Close any open explorer windows which are viewing the output folder and try again.
For this reason you are best running your inno setup file from the command line or part of a visual studio or other automated build process.
This is not a bug, this is only bad design of application (or bad documentation) :)
Use the OutputDir
directive in your [Setup]
section to avoid this wrong behaviour.
OutputDir=c:\output
OutputDir
specifies the "output" directory for the script, which is where the Setup Compiler will place the resulting SETUP.*
files. By default, it creates a directory named Output
under the directory containing the script for this.
You ask why?
If you do not use OutputDir
in your script file (and many people do not use it) Inno Setup tries to create resulting setup in the "userdocs:" folder which causes a lot of troubles on all Windows systems.
Always use this parameter, even if you want to have resulting setup in current folder, in that case use:
OutputDir=output