Menu

#147 Error File locked during exe generation - Antivirus

Next release
open
nobody
None
5
2023-08-08
2023-08-08
No

Hello,
For a few weeks I have intermittent issue to generate exe with launch4j due to my infrastructure.
The issue is related to the anti-virus which is locking the generated exe file between the linking and the wrapping phases.

I am getting following error:
[INFO] launch4j: Compiling resources
[INFO] launch4j: Linking
[INFO] launch4j: Wrapping
WARNING: Sign the executable to minimize antivirus false positives or use launching instead of wrapping.
[INFO] launch4j: E:\JENKINS\workspace\xxx.exe (The process cannot access the file because it is being used by another process)
[ERROR]
net.sf.launch4j.BuilderException: java.io.FileNotFoundException: E:\JENKINS\workspace\xxx.exe (The process cannot access the file because it is being used by another process)
at net.sf.launch4j.Builder.build (Builder.java:135)

It would be great if you could add some delay + retry within Builder.java at
os = new FileOutputStream(outfile, true);

To wait the .exe file to be unlocked before trying to append the .jar

Many thanks for your help.

Kind regards
Patrice

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.