sttz / install-unity

Script to install Unity 3D versions from the command line on macOS
MIT License
131 stars 25 forks source link

Unable to specify install path #28

Closed bboles closed 3 years ago

bboles commented 3 years ago

According to this code:

https://github.com/sttz/install-unity/blob/next/sttz.InstallUnity/Installer/Configuration.cs#L59

I should be able to specify --opt installPathMac=<somepath>. I have been unable to get this to work and get this error:

/usr/local/bin/install-unity --yes install 2019.4.20f1 --packages Unity,iOS,Android --opt installPathMac='Unity.{major}.{minor}.{patch}'
Field value type System.String not yet supported.

I have tried various values for installPathMac but everything throws same error. I also tried going the config.json route but could not figure out how to load config.json.

sttz commented 3 years ago

You're right, that's an oversight and setting installPathMac (and downloadSubdirectory) doesn't work properly.

You can call install-unity --opt save to create the config file with the default values at the right location and print the path to it. Then you should be able to edit installPathMac in the generated config.json file.

I'll fix this in an upcoming release.

bboles commented 3 years ago

Adjusting installPathMac in the config.json worked. Thanks for the workaround!

Just a suggestion but you may want to make it more clear in your documentation on these points:

sttz commented 3 years ago

Thanks for the patience, this is now fixed in v2.9.0.

Also thanks for your suggestions. --opt is really intended as an advanced feature and I don't want to make it more prominent by adding multiple top-level options for it. For now, I expanded the examples in the help to make it more clear that the syntax is --opt list and --opt save.

There is already a message with the path to the config file when one is loaded but it's only shown when the verbosity is increased. The path to the config file is also shown when using --opt save. Options set on the command line take precedence over the value set in the config file.