#Jlink/Warppacker
1 messages · Page 1 of 1 (latest)
hey, does anyone know how to prevent the console window from opening in the jlink's bat file? (or in warp-packer's exe)?
A console window along with the GUI opens when I click the exe shortcut. I digged deeper and found a workaround. But that launches a console for 1 second, opens javaw then exits console.
I was wondering if there was a better solution to this.
Does anyone know how to circumvent this?
are you launching using the script generated by --module apple=a.b/c
if so, you can just edit that script directly to use javaw
other than that, no clue
jlink produces a bat, and I pass it to warp-packer.
So I try to edit the bat file
I'm posting more details in a min.
wait huh
why did tjbot delete my msg with bat file.
Imma rename to txt then send it
^^
so the 2nd one works or nah
start "" "%DIR%\javaw" %JLINK_VM_OPTIONS% -m ValorantNarrator/com.jprcoder.valnarratorgui.Main ^* && exit 0
I made that lol, it does
but opens a console for ~1 second opens javaw then closes console.
but still you don't have the normal app experience you see a console quickly flash and then the app launches
i searched for it for so long but didn't find any solutions.
So
my hypothesis is that
Batch script launches -> Java launches -> Batch script exits
and that the answer here is going to lie in batch
somehow
@chrome salmon
Your question has been closed due to inactivity.
If it was not resolved yet, feel free to just post a message below
to reopen it, or create a new thread.
Note that usually the reason for nobody calling back is that your
question may have been not well asked and hence no one felt confident
enough answering.
When you reopen the thread, try to use your time to improve the quality
of the question by elaborating, providing details, context, all relevant code
snippets, any errors you are getting, concrete examples and perhaps also some
screenshots. Share your attempt, explain the expected results and compare
them to the current results.
Also try to make the information easily accessible by sharing code
or assignment descriptions directly on Discord, not behind a link or
PDF-file; provide some guidance for long code snippets and ensure
the code is well formatted and has syntax highlighting. Kindly read through
https://stackoverflow.com/help/how-to-ask for more.
With enough info, someone knows the answer for sure 👍
the vbs script does work, but it seems warp-packer only wants a bat.
recompile warp packer?
#[cfg(target_family = "windows")]
fn is_script(target: &Path) -> bool {
const SCRIPT_EXTENSIONS: &[&str] = &["bat", "cmd"];
SCRIPT_EXTENSIONS.contains(
&target.extension()
.unwrap_or_default()
.to_string_lossy()
.to_lowercase().as_str())
}
looks like you might be able to just add vbs to this list?
idk how to.
I made it work tho
bat file launches vbs script file-> vbs script file silently launches the java bat file -> java bat file launches the java code
ah nvm launching vbs causes the console to launch for sub 1 second.
also, I'm still getting some module errors. I guess I'll have to manually sort that one out.
I had to write opens ... to ... for some stuff.
doing it manually is the best way right?
I'm setting up windows subsystem, cuz without it. it's just painful to work with building it.
I checked the rust code and it executes it by cmd.exe /c ...
so that'll work for vbs
I just need to get it recompiled
it works but still launches a console 
i tried to replace cmd /c with wscript but still launches console for like 5 seconds.
#[cfg(target_family = "windows")]
fn do_execute(target: &Path, args: &[String]) -> io::Result<i32> {
let target_str = target.as_os_str().to_str().unwrap();
if is_script(target) {
let mut cmd_args = Vec::with_capacity(args.len() + 2);
cmd_args.push("/c".to_string());
cmd_args.push(target_str.to_string());
cmd_args.extend_from_slice(&args);
Ok(Command::new("cmd")
.args(cmd_args)
.stdin(Stdio::inherit())
.stdout(Stdio::inherit())
.stderr(Stdio::inherit())
.spawn()?
.wait()?
.code().unwrap_or(1))
} else {
Ok(Command::new(target)
.args(args)
.stdin(Stdio::inherit())
.stdout(Stdio::inherit())
.stderr(Stdio::inherit())
.spawn()?
.wait()?
.code().unwrap_or(1))
}
}
warp-packer basically launches cmd /c target_str then additional args passed from cmdline.
it works but it launches cmdline for 1 sec then opens the app.
basically that.