TheBoegl / gradle-launch4j

A gradle-plugin to create windows executables with launch4j
Apache License 2.0
311 stars 42 forks source link

IOException: Cannot run program "windres": error=2, No such file or directory #52

Closed javydreamercsw closed 7 years ago

javydreamercsw commented 7 years ago

I'm using version 2.3.0, but was failing on previous versions as well. I verified the file is there.

I'm running Ubuntu 16.04. The source can be obtained here.

Here's the full stack trace:

`FAILURE: Build failed with an exception.

TheBoegl commented 7 years ago

This seems to be an issue with windres and ld as described in this launch4j issue. The following work-around from @bflorat works in xenial:

sudo apt-get install binutils-mingw-w64-x86-64
ln -sf /usr/bin/x86_64-w64-mingw32-ld /home/javydreamercsw/NetBeansProjects/pcgen/build/tmp/launch4j/bin-launch4j-3.9/bin/ld
ln -sf /usr/bin/x86_64-w64-mingw32-windres /home/javydreamercsw/NetBeansProjects/pcgen/build/tmp/launch4j/bin-launch4j-3.9/bin/windres
javydreamercsw commented 7 years ago

That will be really hard to make portable it seems. I.e. setup in CI server.

TheBoegl commented 7 years ago

@javydreamercsw in https://github.com/lukaszlenart/launch4j-maven-plugin/issues/4#issuecomment-27678499 could be another work around for you in the meantime until my PR gets merged and published.

javydreamercsw commented 7 years ago

Thanks. I can wait.

javydreamercsw commented 7 years ago

Any updates?

TheBoegl commented 7 years ago

We are waiting on Grzegorz to publish a new release. See his comment

Riggs333 commented 7 years ago

launch4j 3.10 is out and the merge request is integrated. Any plan when the Gradle plugin will be updated?

TheBoegl commented 7 years ago

Launch4j 3.10 was removed due to AV false positives. We are waiting for 3.11 to be released to maven.

ttsiebzehntt commented 7 years ago

@TheBoegl Any Updates on this? 3.11 seams to be released since 2017-06-27 but not on mavencentral.

I came across this error on my CI Server: "Could not find launch4j-workdir-linux64.jar (net.sf.launch4j:launch4j:3.9)" Since there is no linux64 version in 3.9.

PS: I need the 2.4 SNAPSHOT to customize the classpath :(

Thanks

TheBoegl commented 7 years ago

@ttsiebzehntt I asked Grzegorz in launch4j/#171 to publish the artifacts for launch4j 3.11 to MavenCentral. In the meantime you could use the unzipped launch4j-3.9-workdir-linux64.zip.

ttsiebzehntt commented 7 years ago

@TheBoegl Thanks, I tried it with your provided jar, the resolve works now but somehow the extracting doesn't seem to work. The folder 'tmp/launch4j' doesn't get created, therefor the workdir jar isn't extracted and I end up with the error: "build/tmp/launch4j/bin-launch4j-3.9/bin/windres No such file or directory"

The creation of the 'tmp/launch4j' dir and the extraction work in the plugin version 2.3.0. There seems to be a bug in 2.4.0-1-SNAPSHOT.

TheBoegl commented 7 years ago

@ttsiebzehntt, @javydreamercsw: I've created a new test snapshot 2.4.0-2-SNAPSHOT which uses the latest launch4j version 3.11. Because this is still in the staging area, it would be great if you could test it on your setup and provide feedback. Add the staging repo to your repositories setting in your gradle script and in the buildscript:

buildscript {
    repositories {
        jcenter()
        maven { url = 'https://oss.sonatype.org/content/repositories/netsflaunch4j-1006/' }
        maven { url "https://oss.jfrog.org/artifactory/oss-snapshot-local/" }
    }
    dependencies {
        classpath 'edu.sc.seis.gradle:launch4j:2.4.0-2-SNAPSHOT'
    }
}

apply plugin: 'edu.sc.seis.launch4j'

repositories {
    jcenter()
    maven { url = 'https://oss.sonatype.org/content/repositories/netsflaunch4j-1006/' }
}
TheBoegl commented 7 years ago

@ttsiebzehntt I think you tried to run ./gradlew clean createAllExecutables which cleans the tmp files but does not recreate them... I'll take a look into this.

ttsiebzehntt commented 7 years ago

@TheBoegl clean is the problem, yes. My CI builds are always run on clean environments so I cannot test the new SNAPSHOT on linux64. But it's working fine on my Windows machine. Thanks for the effort.

javydreamercsw commented 7 years ago

I'll try it during the week

On Jul 16, 2017 9:43 AM, "Martin Sadowski" notifications@github.com wrote:

@TheBoegl https://github.com/theboegl clean is the problem, yes. My CI builds are always run on clean environments so I cannot test the new SNAPSHOT on linux64. But it's working fine on my Windows machine. Thanks for the effort.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/TheBoegl/gradle-launch4j/issues/52#issuecomment-315613665, or mute the thread https://github.com/notifications/unsubscribe-auth/ACr9P6Qlue9n0gug72mLQ59KE7ctQ5tCks5sOiGWgaJpZM4MI5IR .

TheBoegl commented 7 years ago

@ttsiebzehntt version 2.4.0-3-SNAPSHOT should now work in your CI build.

ttsiebzehntt commented 7 years ago

@TheBoegl Thank you very much. The new SNAPSHOT works perfectly (extraction and exe creation) 👍

TheBoegl commented 7 years ago

@javydreamercsw This issue should should be fixed in version 2.4.0. Could you please test it in your setup and provide feedback or close this issue?

javydreamercsw commented 7 years ago

Will do and report back.

javydreamercsw commented 7 years ago

Got an error:

FAILURE: Build failed with an exception.

Just changed to version 2.4.0. Works fine with 2.3.0.

TheBoegl commented 7 years ago

I've opened #60 to track the issue, though I found a work around already.