dgiagio / warp

Create self-contained single binary applications
MIT License
1.91k stars 92 forks source link

when start Java warped on windows, there is a cmd window, how to hide it? #61

Open zenos879 opened 2 years ago

zenos879 commented 2 years ago

thank you for great work ! i have followed:https://github.com/dgiagio/warp/issues/51 to wrap my java program on windows 10. and i succeed to build my "exe“. but when start the ”exe“, it always started with a cmd window. this is not elegant for my customers. i tried to hide it in the way below ,but failed, all this can do is to minimize the window.

@ECHO OFF
:: below is to minimized cmd window
if not DEFINED IS_MINIMIZED set IS_MINIMIZED=1 && start "" /min "%~dpnx0" %* && exit
SETLOCAL
SET "JAVA_EXE=%~dp0\jre\bin\java.exe"
SET "APP_JAR=%~dp0\demo.jar"
%JAVA_EXE% -jar %APP_JAR% -Djava.ext.dirs=%~dp0\jre\lib

this is the cmd i used to wrap my exe, i think the key is the param "exec", need your help~~ warp-packer.exe --arch windows-x64 --input_dir "./bundle" --exec run.cmd --output cntvFtpClientV5.exe

thank you for tool by the way.

trixon commented 1 year ago

Hi @zenos879 , You could try to use javaw instead. SET "JAVA_EXE=%~dp0\jre\bin\javaw.exe"