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

[Enhancement] Check for alternate install path defined in Unity Hub #40

Open
maximilianmaihoefner opened this issue May 29, 2020 · 1 comment

Comments

@maximilianmaihoefner
Copy link
Contributor

Using Unity Hub it is easy to define an alternate install path for the Unity Editors. After some digging I found that Unity Hub stores that alternate install path in a file called secondaryInstallPath.json. On macOS it is located in ~/Library/Application Support/UnityHub (no clue about Windows or Linux).
The file content, although named .json, is just a string:

"/Applications/CustomUnityDirectory/Editors"

To make it even easier for people to use the Patcher we could read that file and check for Unity Editors in that location in addition to the default one.

Right now the Patcher is quite optimistic when scanning the installation Directory and assumes all sub-directories are Unity Editors, this most likely will break if checking the alternate install paths, since people might just define /Applications or C:\Programm Files.

So the Todos would be:

  1. Figure out where the secondaryInstallPath.json file is located on Windows and Linux.
  2. Add Code to read the file and check that location for Unity Editors.
  3. Add Code to detect if a directory contains an Unity Executable before adding it to the list of possible Editors which could be patched.

Do you have any Feedback on this?

@aevitas
Copy link
Owner

aevitas commented Jun 1, 2020

I'd assume it's installed to the UnityHub directories on other OSes as well, though that's something we'd definitely have to verify. One thing to also verify would be what the hub's behaviour is when you have multiple installs in different locations, perhaps the contents of the file would turn into a JSON array?

You could probably just read the contents of the file and add them to the Unity paths, and let the patcher do its thing from there. Sounds like a good change though! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants