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