I have a question about using the launch4j Ant task. I have a build.xml that calls the launch4j Ant task in the parent directory of the launch4j directory. When I try to call the launch4j Ant task, it fails with this error:
C:\wspaces\wspace\test-launch4j\build.xml:16: net.sf.launch4j.BuilderException: net.sf.launch4j.ExecException: java.io.IOException: Cannot run program ".\bin\windres.exe": CreateProcess error=2, The system cannot find the file specified
It looks like the launch4j Ant task assumes that the working directory is the launch4j directory. However, Ant sets the working directory to the directory containing the build.xml. I've verified that by moving my build.xml inside the launch4j directory, it will then work fine.
I'd like to keep the launch4j directory with the unmodified contents of the zip, though. Does anyone know of a way to call the launch4j Ant task from a directory outside of the launch4j directory? Ant doesn't seem to offer an easy way to change the working directory when launching a task defined with taskdef. Thanks in advance,
Having had the same problem with launch4j 3.1.0-beta1 and Ant task, I've reverted to the stable launch4j 3.0.2 and it resolved the issue. Hope, this helps you!
Or if you want to use 3.1.0-beta1, you can fix the launch4j code as described in this bug, and recompile:
Thanks, I modified the 3.1.0-beta1 code with the fix described in the bug, recompiled, and things are now working well!
Fixed in 3.0.1-beta2.