TheBoegl / gradle-launch4j

A gradle-plugin to create windows executables with launch4j

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Running resulting app as a console command

willow512 opened this issue · comments

Hey I'm trying to use launch4j via gradle-launch4j as a way to create a console command. It's similar to git in it's interface, though not in it's function.

This is the config I'm using:
launch4j {
mainClassName = 'willow.Dizzer'
outfile = 'diz.exe'
headerType 'console'
}

However, the program always reports the current running directory to be the folder where I installed the program. So if it's installed in C:\tools\diz\diz.exe and I run it from C:\ it reports the current folder to be C:\tools\diz

This url https://sourceforge.net/p/launch4j/discussion/332684/thread/bd4993f1/ describes how to solve a similar problem using the launch4j GUI. And you've made the commandline parameters available via chDir and jvmOptions. However I cannot get them to work. Doing anything via chDir means the executable can no longer find my libraries upon starting. And changing the jvmOptions doesn't seem to have an effect.

Is it possible to use gradle-launch4j in the way I am trying to use it? If so, a helpful hint would mean the world to me!

As is traditional for a 2 day problem solving binge you find the answer an hour after asking for help. ;)

I'm using mingw64 as a commandline prompt which behaves differently from windows cmd.
Windows cmd doesn't have the problem.
Using mingw64 you can get around it by reading System.getenv("pwd") and using that as your path

Thanks for your time anyway