#Jlink/Warppacker

1 messages · Page 1 of 1 (latest)

bitter solsticeBOT
#

<@&987246452180930620> please have a look, thanks.

chrome salmon
#

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?

lucid cobalt
#

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

chrome salmon
#

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

lucid cobalt
#

so the 2nd one works or nah

#

start "" "%DIR%\javaw" %JLINK_VM_OPTIONS% -m ValorantNarrator/com.jprcoder.valnarratorgui.Main ^* && exit 0

chrome salmon
#

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

lucid cobalt
#

thats annoying

#

there has to be a solution here, i just do not know it exactly

chrome salmon
lucid cobalt
#

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

bitter solsticeBOT
#

@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 👍

chrome salmon
lucid cobalt
#
#[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?

chrome salmon
#

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.

chrome salmon
#

I had to write opens ... to ... for some stuff.

#

doing it manually is the best way right?

chrome salmon
#

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

chrome salmon
#

it works but still launches a console thinkies

#

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.

chrome salmon
#

I guess it's maybe cuz it launches cmd /c 2 times

#

one time the warp-packer launches the vbs script and then the vbs launches the bat