Open Cervator opened 9 years ago
Bump - after we experimented some with this it remains overly tricky. It may be worth considering this issue a request to pop up a super simple window with the text instead when launched from .exe
Really I can't think of any noteworthy use case where a player would be launching the game via exe without a graphical head on the launching machine. Even running a headless server on Windows via .exe could pop up a window, and actually should when we have some actual admin tools to attach to that.
The only scenario I can think of is a headless Windows Core server - but honestly if you actually manage to have a Core server available you can probably figure out launching from the .jar directly instead ... :-)
Yup - I agree with that. Just show a JOptionPane message box with the help text if (!headless).
Seeing as this is a pretty old Bug/Enhancement, I'm guessing nobody is working on this. I'll start giving it a go here, and I'll attempt what was mentioned above; opening a new, simple window that will display the text
Just stumbled over this and tried to reproduce it and indeed, on executing the .exe from Windows Powershell via .\TerasologyLauncher.x64.exe
, the Terasology launcher does start, but doesn't log anything on command line.
It's also not "blocking" the shell, I directly get a new prompt line.
The TerasologyLauncher.x64.exe
executable comes from MovingBlocks/TerasologyJavaLauncher. It is compiled for the Windows
subsystem (see TerasologyJavaLauncher.vcxproj#L309), which does not spawn a console, therefore there will not be any console output. That project was archived in favour of the launcher a while ago. Running Terasology.bat
should still work as intended.
No logs may not be a bug in this case then, but maybe still something desirable for cases where the .exe is (or needs to be) used directly instead of the launcher...? If we archived the project, we could consider removing the .exe but I think windows users are more used to executing .exe files than .bat files. Should we change this issue to a feature request?
Actually, I do not believe that we bundle the executable with distributions anymore anyway. The launch executables were removed years ago in #4347. This issue is obsolete.
As noted in #1395 running the game via exe trying out the new -help flag (or its other variants) doesn't print any actual output. Even hacking in System.out.println anywhere in the class gets nothing.
One link posted (http://stackoverflow.com/questions/24694275/how-can-i-make-exe-file-to-write-text-on-the-command-line) suggests it might be Launch4J being set for either console or gui mode, can't have both.
I also wonder if that relates to #1339 where you get the command prompt back immediately (so no wonder nothing is output). I still could swear using the exe blocked the command prompt not that long ago. Maybe a combination with how we start the game. Yet
java -jar Terasology.jar
is fine and logs right to the command prompt.Rather than necessarily try to figure this out for Launch4j we might want to attach this to @shartte's launcher project for bundling the jre (https://github.com/MovingBlocks/TerasologyLauncher/issues/260 + https://github.com/MovingBlocks/TerasologyLauncher/issues/259). I figure when it works there we might want the same option for the game :-)