sp614x / optifine

1.79k stars 418 forks source link

[Enhancement] Command Line Arguments #5323

Open seadoggie01 opened 3 years ago

seadoggie01 commented 3 years ago

Extract/Install Directory

It would be nice if there were command line arguments for the .jar file to avoid launching the GUI. I was planning to write a script to install Optifine for my not-so-technically-inclined friend. Avoiding launching the GUI would be helpful and would make updating Optifine smoother.

Possibly something like (in Windows): java --jar OptiFine_1.16.5_HD_U_G6.jar -e "C:\Users\username\AppData\Roaming\.minecraft\ to extract or -i to install

Edit: this is especially helpful as it avoids needing UI Automation on Windows to automate this as it's a Java program

ZekerZhayard commented 3 years ago

At present, the way to extract OptiFine using the command line already exists.

java -cp <optifine.jar> optifine.Patcher <minecraft.jar> <optifine.jar> <extract-target.jar>
seadoggie01 commented 3 years ago

Ah, then maybe this needs to be added to the docs? I haven't seen any reference to this. I tried using --help, but there wasn't any information given

JonLit commented 3 years ago

which .jar File is meant by ?

Please correct me if I'm wrong:

-> Downloaded Optifine_version.jar (e.g. "OptiFine_1.17.1_HD_U_G9.jar") -> A File to be created with Optifine extracted inside P.S.: I've also searched online for minecraft.jar, it says that it should be in the specific versions folder. I'm using GDLauncher, and in the instance's Folder there is no .jar File that could be it
seadoggie01 commented 3 years ago

@JonLit You'll find the regular launcher's minecraft.jar in: %AppData%.minecraft\versions\<Version#>\<Version#>.jar Where <Version#> is like 1.17.1 I'd guess that your launcher doesn't install the minecraft jars outside of that folder, but honestly that a question you'd ask the launcher's developers