microsoft / unitysetup.powershell

Powershell module for interfacing with Unity installs and projects.
MIT License
179 stars 48 forks source link

Installing Editors using HUB CLI #204

Closed StephenHodgson closed 4 years ago

StephenHodgson commented 4 years ago

Now that the Unity Hub has been out of beta for a while with CLI support, I wonder if it's more beneficial to just download the hub itself, and pass in any commands to it to do the downloading process for us?

This should fix any installation issues for Mac and add Linux support without a lot of additional work

Here's the hub download link:

https://public-cdn.cloud.unity3d.com/hub/prod/UnityHubSetup.exe

Unity Hub CLI

Start-Process "C:\Program Files\Unity Hub\Unity Hub.exe" -ArgumentList "-- --headless help"

Commands

jwittner commented 4 years ago

The need for --changeset 9b001d489a54 is very annoying lol, otherwise I think this would be great! Out of curiosity, what's the oldest version of Unity we could install with this?

I'd have to test some examples of what comes down in the 'releases' list. If it's really limited, I'd wonder if we'd still need to do all our web crawling anyways to find the changesets.

StephenHodgson commented 4 years ago

I think you can easily get the change set from the download archive

jwittner commented 4 years ago

You mean manually? Or you think it'd be easy automatically with less effort than what we're currently doing? A big value here is that you can get a unity project version, find the installers, then install without any human intervention.

StephenHodgson commented 4 years ago

no, using a crawler of some kinda like you suggested above. But adding a change set parameter in the powershell installer probably wouldn't be a bad idea either if someone has a specific one in mind.

bddckr commented 4 years ago

Going by the above command list it seems this does not support any license management?

StephenHodgson commented 4 years ago

Doesn't matter, you can still pass license to the editor application like usual

bddckr commented 4 years ago

That has been done using this PowerShell module so far. Are you saying this doesn't actually replace that part then?

StephenHodgson commented 4 years ago

Not at the moment, no. But I think it's on their roadmap.

StephenHodgson commented 4 years ago

@jwittner I think it's important to note that if you know where the Unity Project is located you can easily get the revision number in the ProjectVersion.txt:

m_EditorVersion: 2019.3.11f1
m_EditorVersionWithRevision: 2019.3.11f1 (ceef2d848e70)

Regex:

(?<version>(?:(?<major>\d+)\.)?(?:(?<minor>\d+)\.)?(?:(?<patch>\d+[fab]\d+)\b))|((?:\((?<revision>\w+))\))

image

jwittner commented 4 years ago

@StephenHodgson - that's cool! Unfortunately it's only available for Unity 2019 versions. =(

StephenHodgson commented 4 years ago

Fallback is the crawler ;)

Or just compile a list of all the revisions to their versions haha. Have a fast lookup table or something lmao.

StephenHodgson commented 4 years ago

Here's a powershell script I've been working on and using in my CI/CD workflow. https://github.com/StephenHodgson/UnityCI/blob/master/InstallUnityHub.ps1

Sadly the Linux stuff doesn't work for whatever reason (bc Unity) https://forum.unity.com/threads/unity-hub-linux-commands-do-not-execute-the-same-as-windows-macos.907538/

But maybe we can support both workflows?

In either case I also asked that it get added to the hosted agent image as well. https://github.com/actions/virtual-environments/issues/1013

bdovaz commented 4 years ago

Any news on this? I personally tested the Hub cli but my feelings are that it's still really unstable and I don't see really bug fixing on recent releases:

https://unity3d.com/es/hub/whats-new

jwittner commented 4 years ago

No current plans to do this refactor.

StephenHodgson commented 4 years ago

Hub cli is now installed on windows images by default but have not checked mac or linux vms.

I've moved on from this for a while as it's much easier to install the required versions I need via hub and a few short ps scripts.

jwittner commented 4 years ago

Closing as original creator no longer needs it, if this is very desirable for others let me know and we can reopen.