Working directory and the launch4j Ant task

  • Jake

    Jake - 2013-01-02


    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: 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,


  • Max B

    Max B - 2013-02-18

    Hello Jake,

    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!


  • Jake

    Jake - 2013-05-02

    Thanks, I modified the 3.1.0-beta1 code with the fix described in the bug, recompiled, and things are now working well!


  • Grzegorz Kowal

    Grzegorz Kowal - 2013-08-21

    Fixed in 3.0.1-beta2.



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks