DragonBox / u3d

U3d is a cross-platform set of tools to interact with Unity3D from command line.
MIT License
361 stars 33 forks source link

Can't install on macOS with installation_path parameter #382

Open bdominguez opened 4 years ago

bdominguez commented 4 years ago

I don't know if it's an error or if I don't use it correctly but it seems that if I add "installation_path" parameter, it doesn't work.

In theory doing that I'm simulating the same as not passing the parameter, right? Because by default it installs it in that directory. Why doesn't it work for me?

Command:

u3d install 2019.2.12f1 --installation_path /Applications/Unity_2019.2.12f1 --verbose

Full verbose log:

mac-build:~ jenkins$ u3d install 2019.2.12f1 --installation_path /Applications/Unity_2019.2.12f1 --verbose
DEBUG Loading modules for version 2019.2.12f1
DEBUG Looking for installed Unity version under /
DEBUG Found list_installed_paths: ["/Applications/Unity_2018.1.6f1", "/Applications/Unity_2017.4.31f1", "/Applications/Unity_2018.3.8f1", "/Applications/Unity_5.5.2f1", "/Applications/Unity_2018.2.6f1", "/Applications/Unity_5.5.6f1", "/Applications/Unity_2017.2.1p3", "/Applications/Unity_2018.2.11f1", "/Applications/Unity_2018.2.15f1", "/Applications/Unity_2018.2.1f1", "/Applications/Unity_2018.3.1f1", "/Applications/Unity_5.6.5f1", "/Applications/Unity_5.4.1f1", "/Applications/Unity_5.6.4p4", "/Applications/Unity_2018.2.5f1", "/Applications/Unity_2019.2.2f1", "/Applications/Unity_2018.2.12f1", "/Applications/Unity_2017.1.3f1", "/Applications/Unity_2017.4.22f1", "/Applications/Unity_2018.2.16f1", "/Applications/Unity_2019.1.3f1", "/Applications/Unity_2018.1.4f1", "/Applications/Unity_5.6.6f2", "/Applications/Unity_2019.1.14f1", "/Applications/Unity_2019.2.3f1", "/Applications/Unity_2018.4.0f1", "/Applications/Unity_2018.2.13f1", "/Applications/Unity_2017.3.0f3", "/Applications/Unity_2017.2.0f3", "/Applications/Unity_2017.1.2f1", "/Applications/Unity_2018.3.9f1", "/Applications/Unity_2017.4.30f1", "/Applications/Unity_2018.2.3f1", "/Applications/Unity_2018.3.10f1", "/Applications/Unity_2017.4.11f1", "/Applications/Unity_2017.4.1f1", "/Applications/Unity_2018.3.7f1", "/Applications/Unity_2018.1.3f1", "/Applications/Unity_2018.1.9f1", "/Applications/Unity_5.6.3f1", "/Applications/Unity_2017.3.0p3", "/Applications/Unity_2017.2.1f1", "/Applications/Unity_2017.3.1f1"]
DEBUG mdfind "kMDItemCFBundleIdentifier == 'com.unity3d.UnityEditor4.x' || kMDItemCFBundleIdentifier == 'com.unity3d.UnityEditor5.x'" 2>/dev/null
DEBUG Found spotlight_installed_paths: ["/Applications/Unity_2018.3.10f1", "/Applications/Unity_2019.2.3f1", "/Applications/Unity_2018.4.0f1", "/Applications/Unity_2019.2.2f1", "/Applications/Unity_2019.1.14f1", "/Applications/Unity_2018.3.8f1", "/Applications/Unity_2019.1.3f1", "/Applications/Unity_2018.2.13f1", "/Applications/Unity_5.6.6f2", "/Applications/Unity_5.5.2f1", "/Applications/Unity_5.6.3f1", "/Applications/Unity_5.6.4p4", "/Applications/Unity_2017.4.30f1", "/Applications/Unity_2017.1.2f1", "/Applications/Unity_2018.3.7f1", "/Applications/Unity_2018.2.5f1", "/Applications/Unity_2018.2.6f1", "/Applications/Unity_2018.2.16f1", "/Applications/Unity_2017.4.31f1", "/Applications/Unity_2018.3.1f1", "/Applications/Unity_2018.3.9f1", "/Applications/Unity_2017.4.1f1", "/Applications/Unity_2017.4.22f1", "/Applications/Unity_2017.2.1f1", "/Applications/Unity_2017.3.1f1", "/Applications/Unity_2018.1.3f1", "/Applications/Unity_2018.2.1f1", "/Applications/Unity_2018.2.15f1", "/Applications/Unity_2018.2.12f1", "/Applications/Unity_2018.2.11f1", "/Applications/Unity_5.6.5f1", "/Applications/Unity_5.5.6f1", "/Applications/Unity_2017.1.3f1", "/Applications/Unity_5.4.1f1", "/Applications/Unity_2018.2.3f1", "/Applications/Unity_2017.4.11f1", "/Applications/Unity_2018.1.9f1", "/Applications/Unity_2017.2.0f3", "/Applications/Unity_2017.3.0p3", "/Applications/Unity_2017.3.0f3", "/Applications/Unity_2017.2.1p3", "/Applications/Unity_2018.1.6f1", "/Applications/Unity_2018.1.4f1"]
DEBUG Version 2019.2.12f1 of Unity is not installed yet
WARN Root privileges are required
DEBUG Could not retrieve password
DEBUG Attempting to login
DEBUG Password does not exist
Password for jenkins:
**********
WARN No credentials storage available
DEBUG Using http opts: {:use_ssl=>#<MatchData "https">, :read_timeout=>300}
DEBUG Installer file for Unity 2019.2.12f1 seems to be present at /Users/jenkins/Downloads/Unity_Packages/2019.2.12f1/Unity.pkg
INFO Unity 2019.2.12f1 is already downloaded
INFO --------------------------------------------
INFO --- Installing Unity 2019.2.12f1 (Unity) ---
INFO --------------------------------------------
INFO Installing with /Users/jenkins/Downloads/Unity_Packages/2019.2.12f1/Unity.pkg
DEBUG Looking for installed Unity version under /
DEBUG Found list_installed_paths: ["/Applications/Unity_2018.1.6f1", "/Applications/Unity_2017.4.31f1", "/Applications/Unity_2018.3.8f1", "/Applications/Unity_5.5.2f1", "/Applications/Unity_2018.2.6f1", "/Applications/Unity_5.5.6f1", "/Applications/Unity_2017.2.1p3", "/Applications/Unity_2018.2.11f1", "/Applications/Unity_2018.2.15f1", "/Applications/Unity_2018.2.1f1", "/Applications/Unity_2018.3.1f1", "/Applications/Unity_5.6.5f1", "/Applications/Unity_5.4.1f1", "/Applications/Unity_5.6.4p4", "/Applications/Unity_2018.2.5f1", "/Applications/Unity_2019.2.2f1", "/Applications/Unity_2018.2.12f1", "/Applications/Unity_2017.1.3f1", "/Applications/Unity_2017.4.22f1", "/Applications/Unity_2018.2.16f1", "/Applications/Unity_2019.1.3f1", "/Applications/Unity_2018.1.4f1", "/Applications/Unity_5.6.6f2", "/Applications/Unity_2019.1.14f1", "/Applications/Unity_2019.2.3f1", "/Applications/Unity_2018.4.0f1", "/Applications/Unity_2018.2.13f1", "/Applications/Unity_2017.3.0f3", "/Applications/Unity_2017.2.0f3", "/Applications/Unity_2017.1.2f1", "/Applications/Unity_2018.3.9f1", "/Applications/Unity_2017.4.30f1", "/Applications/Unity_2018.2.3f1", "/Applications/Unity_2018.3.10f1", "/Applications/Unity_2017.4.11f1", "/Applications/Unity_2017.4.1f1", "/Applications/Unity_2018.3.7f1", "/Applications/Unity_2018.1.3f1", "/Applications/Unity_2018.1.9f1", "/Applications/Unity_5.6.3f1", "/Applications/Unity_2017.3.0p3", "/Applications/Unity_2017.2.1f1", "/Applications/Unity_2017.3.1f1"]
DEBUG mdfind "kMDItemCFBundleIdentifier == 'com.unity3d.UnityEditor4.x' || kMDItemCFBundleIdentifier == 'com.unity3d.UnityEditor5.x'" 2>/dev/null
DEBUG Found spotlight_installed_paths: ["/Applications/Unity_2018.3.10f1", "/Applications/Unity_2019.2.3f1", "/Applications/Unity_2018.4.0f1", "/Applications/Unity_2019.2.2f1", "/Applications/Unity_2019.1.14f1", "/Applications/Unity_2018.3.8f1", "/Applications/Unity_2019.1.3f1", "/Applications/Unity_2018.2.13f1", "/Applications/Unity_5.6.6f2", "/Applications/Unity_5.5.2f1", "/Applications/Unity_5.6.3f1", "/Applications/Unity_5.6.4p4", "/Applications/Unity_2017.4.30f1", "/Applications/Unity_2017.1.2f1", "/Applications/Unity_2018.3.7f1", "/Applications/Unity_2018.2.5f1", "/Applications/Unity_2018.2.6f1", "/Applications/Unity_2018.2.16f1", "/Applications/Unity_2017.4.31f1", "/Applications/Unity_2018.3.1f1", "/Applications/Unity_2018.3.9f1", "/Applications/Unity_2017.4.1f1", "/Applications/Unity_2017.4.22f1", "/Applications/Unity_2017.2.1f1", "/Applications/Unity_2017.3.1f1", "/Applications/Unity_2018.1.3f1", "/Applications/Unity_2018.2.1f1", "/Applications/Unity_2018.2.15f1", "/Applications/Unity_2018.2.12f1", "/Applications/Unity_2018.2.11f1", "/Applications/Unity_5.6.5f1", "/Applications/Unity_5.5.6f1", "/Applications/Unity_2017.1.3f1", "/Applications/Unity_5.4.1f1", "/Applications/Unity_2018.2.3f1", "/Applications/Unity_2017.4.11f1", "/Applications/Unity_2018.1.9f1", "/Applications/Unity_2017.2.0f3", "/Applications/Unity_2017.3.0p3", "/Applications/Unity_2017.3.0f3", "/Applications/Unity_2017.2.1p3", "/Applications/Unity_2018.1.6f1", "/Applications/Unity_2018.1.4f1"]
DEBUG No Unity install for version 2019.2.12f1 was found
INFO $ installer -pkg /Users/jenkins/Downloads/Unity_Packages/2019.2.12f1/Unity.pkg -target /Applications/Unity_2019.2.12f1
DEBUG Admin privileges granted for command execution
DEBUG Password:installer: Error trying to locate volume at /Applications/Unity_2019.2.12f1
Exit status: 1
ERROR Failed to install pkg at /Users/jenkins/Downloads/Unity_Packages/2019.2.12f1/Unity.pkg: Exit status: 1
niezbop commented 4 years ago

Hey @bdominguez and thanks for raising this.

The installation_path on Mac does not seem to work with paths per say, as the Unity package installer expects a volume to be passed as an argument.

The reason why installation_path does not work when you try to replicate the vanilla behaviour is because the default path isn't /Applications/Unity_2019.2.12f1, but rather https://github.com/DragonBox/u3d/blob/197b61bc514e5322905b1efb5fff5319150ca920/lib/u3d/installer.rb#L34 You would need to run u3d install 2019.2.12f1 --installation_path / --verbose to replicate the default behaviour.

This is definitely an issue, and if this is an option we are not able to provide due to limitation with the Unity package installer, we should not offer it in the first place.

Note that this is an option that we offered for a very long time, so maybe something changed in the Unity package installer. WDYT @lacostej ?

bdominguez commented 4 years ago

I have solved it indicating the volume where we have the SSD. Example:

u3d install 2019.2.12f1 -p Unity,WebGL --installation_path '/Volumes/Macintosh HD'

Can you document this with an example? Thanks.

niezbop commented 4 years ago

Thanks for the example @bdominguez

lacostej commented 4 years ago

One thing we could do is to properly support installation_path as it is meant from the user mind and convert it to the volume where appropriate. From a user perspective it would be consistent. @niezbop WDYT?

@bdominguez out of curiosity, what is the path of the Unity install when you select the /Volumes/Macintosh HD volume?

niezbop commented 4 years ago

convert it to the volume where appropriate

Not sure what you mean. I think that if we want to fully support the installation_path option for Mac, we shouldn't support the Unity package argument, but rather implement some kind of temporary moving to /Applications as we do with modules, so that we can put Unity anywhere we want on the system.

However, this would require further investigation in my mind since it means that we bypass Unity's location restriction, which we should understand before anything. I'm not sure why they set this restriction, but I'd rather not add a feature that introduces more issues than it solves!

sp-ricard-valverde commented 4 years ago

The Hub is actually installing the packages under /Applications/Unity/Hub/Editor/<version> so it's not a default location. I bet they are just moving around and renaming editor packages at will.