budde25 / switcheroo

A cross platform, Rust implementation for the Tegra X1 bootROM exploit
https://budde25.github.io/switcheroo/
GNU General Public License v2.0
47 stars 3 forks source link

Cli commands not working. Opening GUI instead. #9

Open GGLinnk opened 1 year ago

GGLinnk commented 1 year ago

Hi,

Switcheroo seems to have a little cli issue. Whatever the command I try. It's always opening me the GUI.

image

Context Info:

superyu1337 commented 1 year ago

I cannot replicate this on linux, im assuming this line is at fault though. I can set up rust on my windows install tomorrow to test this.

budde25 commented 1 year ago

That line probably is the issue. I think I added this line initially because I couldn't get the windows gui to launch without an empty cmd window opening with it.

GGLinnk commented 1 year ago

To fix that issue :

Doing these two steps is causing only one issue: The app isn't opening in GUI mode if double-clicked from explorer witch isn't really an issue.

I suggest adding an additional build switcheroo-gui.exe that will open the GUI when executed. Another solution would be to set default behavior to GUI mode and switch to CLI mode if any command line argument is found.

This second solution seems to be the best.

budde25 commented 1 year ago

Thanks for looking into it! #2 does seem like a reasonable solution. One other thing I wanted to check, was Mac allows clicking the executable to set env variables (thus working both cli and gui with same exe on Mac). So I wonder if that's possible on Windows.

GGLinnk commented 1 year ago

Technically environment variable is not required anymore if GUI is the default behavior. It's also not required for CLI since we can set a mechanism that switch to CLI mode only if an argument is found.