Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing Optifine/OptiForge for custom launcher #87

Open
srnyx opened this issue Aug 22, 2021 · 13 comments
Open

Installing Optifine/OptiForge for custom launcher #87

srnyx opened this issue Aug 22, 2021 · 13 comments
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@srnyx
Copy link

srnyx commented Aug 22, 2021

Is it possible to install Optifine/OptiForge (specifically Optifine) for a custom launcher like GDLauncher?
When I try to install Optifine (by double-clicking on it, selecting my instance's folder, and then clicking install) it says this:
img
I know it says "official launcher," that's exactly why I'm asking this question.

I've run the instance already without any mods, and it's only Optifine and OptiForge that I'm using.

@ZekerZhayard
Copy link
Owner

ZekerZhayard commented Aug 23, 2021

  1. Extract OptiFine jar via this command: [Enhancement] Command Line Arguments sp614x/optifine#5323 (comment)
  2. Rename the jar to OptiFine-1.17.1_HD_U_G9_pre34.jar
  3. Create libraries/optifine/OptiFine/1.17.1_HD_U_G9_pre34 folder and put extracted OptiFine jar into it

@ZekerZhayard ZekerZhayard added question Further information is requested help wanted Extra attention is needed labels Aug 23, 2021
@JonLit
Copy link

JonLit commented Sep 1, 2021

1. Extract OptiFine jar via this command: [[Enhancement] Command Line Arguments sp614x/optifine#5323 (comment)](https://github.com/sp614x/optifine/issues/5323#issuecomment-778670456)

2. Rename the jar to `OptiFine-1.17.1_HD_U_G9_pre34.jar`

3. Create `libraries/optifine/OptiFine/1.17.1_HD_U_G9_pre34` folder and put extracted OptiFine jar into it

should I create the libraries/optifine/Optifine/...... folder inside the folder of the version or in the .minecraft folder?

@Empoliam
Copy link

Empoliam commented Sep 1, 2021

should I create the libraries/optifine/Optifine/...... folder inside the folder of the version or in the .minecraft folder?

If you are using GDLauncher, then /optifine/OptiFine/... should be created in .../datastore/libraries/ inside your GDLauncher user data path.

@JonLit
Copy link

JonLit commented Sep 1, 2021

do I need to do anything else? because I've extracted the optifine.jar into $HOME/.config/gdlauncher_next/datastore/libraries/optifine/Optifine/OptiFine-version/
My instances are at $HOME/.config/gdlauncher_next/instances/

@Empoliam
Copy link

Empoliam commented Sep 1, 2021

If you've installed forge and optiforge correctly, that should be all. Just make sure the version name of the folder matches the optifine version you are using.

In my original comment I made an error, the correct path is .../optifine/OptiFine/.... The capitalization is important.

@JonLit
Copy link

JonLit commented Sep 1, 2021

huh... Optiforge is installed via the modmanager, optifine is extracted to $HOME/.config/gdlauncher_next/datastore/libraries/optifine/OptiFine/OptiFine-1.17.1_HD_U_G9_pre32, but on launching the instance I get an error from Optiforge that Optifine is not installed. I have Forge 37.0.51 installed

@Empoliam
Copy link

Empoliam commented Sep 1, 2021

Make sure that you name both the folder and jar with the correct. If you're using the latest version, it should be 1.17.1_HD_U_G9. If not, be sure to use the latest forge and optifine versions, and try again.

If you still have trouble, try also creating the same library folder inside your instance folder as well. In my experience, I had success when using the just datastore folder, but your mileage may vary.

@JonLit
Copy link

JonLit commented Sep 1, 2021

1. Extract OptiFine jar via this command: [[Enhancement] Command Line Arguments sp614x/optifine#5323 (comment)](https://github.com/sp614x/optifine/issues/5323#issuecomment-778670456)

2. Rename the jar to `OptiFine-1.17.1_HD_U_G9_pre34.jar`

3. Create `libraries/optifine/OptiFine/1.17.1_HD_U_G9_pre34` folder and put extracted OptiFine jar into it

so I need to have the OptiFine-version.jar AND the extracted OptiFine.jar in the .../optifine/OptiFine/OptiFine-version/Folder?

I have now created a instance of Minecraft 1.17.1 with Forge 37.0.51 in GDLauncher
I have downloaded & extracted the newest ("OptiFine_1.17.1_HD_U_G9.jar") into $HOME/.config/gdlauncher_next/datastore/libraries/optifine/OptiFine/OptiFine_1.17.1_HD_U_G9/
I have installed OptiForge (OptiForge-MC1.17.1-0.1.0) via GDLauncher's ModManager

but if I launch the instance, I get the error from OptiForge that Optifine isn't installed

@Empoliam
Copy link

Empoliam commented Sep 1, 2021

You should extract optifine as per the instructions, and rename the extracted jar to the format described in the post. That extracted should go in /datastore/libraries/optifine/OptiFine/OptiFine/<version>/. The directory OptiFine/ should be named the same as your extracted OptiFine jar.

The downloaded optifine jar shouldn't be placed in any Minecraft or GDlauncher directory, you only need it for the extraction process.

As I said before, you can try following the same process, but creating the required directory inside your instance folder as well as in datastore. Given that I'm not an optifine or a GDlauncher dev, I don't personally know which of these directories optifine/optiforge looks in to find the jar, so I personally created both directories, just to be sure.

@JonLit
Copy link

JonLit commented Sep 1, 2021

I've figured it out now!

I looked at the source code from OptiForge, specifically at https://github.com/ZekerZhayard/OptiForge/blob/1.17.1/src/main/java/io/github/zekerzhayard/optiforge/asm/fml/VersionChecker.java searched there for the Error String I got, and found that it searches for "OptiFine-" and NOT "OptiFine_"
also in the comment from that section @ZekerZhayard wrote that this searches the .minecraft/libraries/optifine/OptiFine Folder, so this is where you need to put the OptiFine.jar

What was the Error:
The /optifine/OptiFine/OptiFine_version/ Folder actually needs to be /optifine/OptiFine/version/
Also the Optifine.jar File inside that Folder needs to be OptiFine-version.jar instead of OptiFine_version.jar

So here's a full guide on what I did and worked for me (with GDLauncher v.1.1.14, Minecraft 1.17.1, Forge 37.0.51, OptiFine 1.17.1_HD_U_G9 and OptiForge-MC1.17.1-0.1.0)

  1. create a new Instance in GDLauncher, select Forge->1.17.1->37.0.51
  2. install OptiForge from the ModManager (right-click the instance->Manage->Mods->Add Mod->search for "OptiForge")
  3. Download OptiFine from https://optifine.net/downloads
  4. execute the DOWNLOADED OptiFine.jar and select "Extract"
  5. put the EXTRACTED OptiFine.jar to .minecraft/libraries/optifine/OptiFine/1.17.1_HD_U_G9/
  6. also put that File into GDLauncherUserDataPath/datastore/libraries/optifine/OptiFine/1.17.1_HD_U_G9/ ¹
  7. rename these files to OptiFine-1.17.1_HD_U_G9.jar
  8. start the instance from GDLauncher

P.S.:
This probably also works with other versions of Minecraft/Forge/OptiForge/OptiFine, just change the version Numbers/File Names/Folder Names

¹ You can find the location of this folder in GDLauncher->Settings(icon on the top-right)->scroll down to User Data Path (see image)
GDLauncher-UserDataPath

Thanks to @Empoliam

@Empoliam
Copy link

Empoliam commented Sep 1, 2021

Glad you managed to get it working in the end. Having double checked my own installation, I can see that the naming scheme is actually as you've described, my bad for not checking properly. However, I can confirm from testing that in my experience, my instances only launch if the library/optifine/OptiFine/... folder is inside the datastore folder in GDLaunchers local files.

I've updated my previous comments to reflect the correct directory structure. For anyone having trouble with the above method, please also try following these steps, as this is what worked for me in the end.

  1. Set up your forge instance in GDlauncher, with the latest available version, and ensure that you can launch without any mods first
  2. Download the latest version of optifine to a folder outside of your install directory
  3. Extract OptiFine, either by executing the downloaded jar and clicking Extract, or using the command line as described here: Installing Optifine/OptiForge for custom launcher #87 (comment)
  4. Ensure that the Extracted jar is named correctly. For example, at the time of writing, the latest version is 1.17.1_HD_U_G9, so the correct name here would be OptiFine-1.17.1_HD_U_G9.jar
  5. Navigate to your GDlauncher local data directory, and find the datastore folder. Inside this folder, create a new directory libraries/optifine/OptiFine/<version>/. should be the same as in your optifine jar
  6. Move the extracted optifine jar to this folder
  7. Install OptiForge as normal, either from the launcher, or using the mods folder

For anyone having difficulty, please try both methods in this thread, as the solution seems to vary based on your setup.

@JonLit
Copy link

JonLit commented Sep 1, 2021

Glad you managed to get it working in the end. Having double checked my own installation, I can see that the naming scheme is actually as you've described, my bad for not checking properly. However, I can confirm from testing that in my experience, my instances only launch if the library/optifine/OptiFine/... folder is inside the datastore folder in GDLaunchers local files.

I've updated my previous comments to reflect the correct directory structure. For anyone having trouble with the above method, please also try following these steps, as this is what worked for me in the end.

1. Set up your forge instance in GDlauncher, with the latest available version, and ensure that you can launch without any mods first

2. Download the latest version of optifine to a folder outside of your install directory

3. Extract OptiFine, either by executing the downloaded jar and clicking `Extract`, or using the command line as described here: [Installing Optifine/OptiForge for custom launcher #87 (comment)](https://github.com/ZekerZhayard/OptiForge/issues/87#issuecomment-903843436)

4. Ensure that the _Extracted_ jar is named correctly. For example, at the time of writing, the latest version is 1.17.1_HD_U_G9, so the correct name here would be `OptiFine-1.17.1_HD_U_G9.jar`

5. Navigate to your GDlauncher local data directory, and find the `datastore` folder. Inside this folder, create a new directory `libraries/optifine/OptiFine/<version>/`.  should be the same as in your optifine jar

6. Move the _extracted_ optifine jar to this folder

7. Install OptiForge as normal, either from the launcher, or using the mods folder

For anyone having difficulty, please try both methods in this thread, as the solution seems to vary based on your setup.

Thanks, I also have the OptiFine.jar File in the datastore, I just forgot to include it in the "Guide", I've updated it now

@JonLit
Copy link

JonLit commented Sep 2, 2021

I started making a small Installer Program at GitHub.com/JonLit/GDLauncherOptiFineInstaller

As of today (2.9.2021) it's not (yet) working, it's just a test

Edit: It is now working (at least on Linux, can't test on Windows / Mac OS)
Now also published as .jar File!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants