Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#117 3.1.0-beta1-linux: ./bin/windres not found

3.1.x
closed-fixed
None
3
2013-08-20
2013-03-05
Thomas Pasch
No

I found 2 issues in 3.1.0-beta1-linux:

1. The ant task does not make the launch4j installation directory the current working directory. Because of this, it is unable to find ./bin/windres, ./bin/ld, ./win32api etc.

2. The folders in the tgz distribution should be rwxr-xr-x but are rwxr-x---. (BTW the owner/group could be improved as well).

Discussion

  • Scott Plante
    Scott Plante
    2013-03-07

    This occurs when your current directory is not the launch4j directory. Launch4j attempts to find its own install directory by looking on the classpath for launch4j.properties. This is done in Util.java, at the top of the getJarBaseDir() method. It was changed to have these lines:

    URI uri = new URI(Util.class.getClassLoader()
    .getResource(Launch4jProperties)
    .getFile());

    String path = uri.getPath();

    if (path.startsWith("file:")) {
    String jarPath = path.substring(5, path.lastIndexOf('!'));

    The problem is uri.getPath() does not return the "file:" part for local files--it only returns the path portion of the uri beginning with /. I changed those last two lines to this, and it started working:

    if (path.startsWith("/")) {
    String jarPath = path.substring(0, path.lastIndexOf('!'));

    Note the 5 -> 0 in substring because we don't need to remove file: anymore.

     
  • Thomas Pasch
    Thomas Pasch
    2013-03-08

    Well, I used 3.1.0-beta1 as drop-in replacement for 3.0.2, where it has worked without problems. Hence this is at least a regression.

    Apart from this I would suggest a solution where it is possible to set a environment variable (let say LANCH4J_HOME) to point to the installation directory. This trick is successfully applied in many projects (ANT_HOME, MAVEN_HOME, or even JAVA_HOME).

     
  • Grzegorz Kowal
    Grzegorz Kowal
    2013-08-05

    • Priority: 5 --> 3
     
  • Grzegorz Kowal
    Grzegorz Kowal
    2013-08-05

    • assigned_to: Grzegorz Kowal
     
  • Marco
    Marco
    2013-08-20

    Hi,

    I have the same problem on my Linux and its really annoying. I have work arounded by placing symlinks to bin, w32api,head into each folder where I am running launch4j.

    I guess it should be easily fixable, since it was working fine in 3.0.x

    THX
    -Marco

     
  • Grzegorz Kowal
    Grzegorz Kowal
    2013-08-20

    Hi,

    Yes, I plan to fix the path issues. 2. point fixed already.

    BR,
    Grzegorz

     
  • Grzegorz Kowal
    Grzegorz Kowal
    2013-08-20

    Fixed both problems, thanks Scott.

     
  • Grzegorz Kowal
    Grzegorz Kowal
    2013-08-20

    • status: open --> closed-fixed