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

Start-UnityEditor fails when multiple of the same version of Unity are installed #152

Open
Ziugy opened this issue Jan 23, 2019 · 2 comments
Labels

Comments

@Ziugy
Copy link
Member

Ziugy commented Jan 23, 2019

Example with two Unity 2018.3.1f1 installed in previous install location and now hub location:

D:\repros\demo [master+12 ~1 -0 !]> Get-UnitySetupInstance

Version                                                                                                              Components Path
-------                                                                                                              ---------- ----
2018.1.6f1                                                                                                              Windows C:\Program Files\Unity\
2017.3.1f1                                                                                             Windows, UWP, UWP_IL2CPP C:\Program Files\Unity-2017.3.1f1\
2017.4.8f1                                                                                     Windows, StandardAssets, Vuforia C:\Program Files\Unity-2017.4.8f1\
2018.2.6f1 Windows, Linux, Mac, Documentation, Windows_IL2CPP, UWP, UWP_IL2CPP, Android, iOS, AppleTV, Facebook, Vuforia, WebGL C:\Program Files\Unity-2018.2.6f1\
2018.3.1f1 Windows, Linux, Mac, Documentation, Windows_IL2CPP, UWP, UWP_IL2CPP, Android, iOS, AppleTV, Facebook, Vuforia, WebGL C:\Program Files\Unity-2018.3.1f1\
5.5.0f3                       Windows, Linux, Mac, Documentation, StandardAssets, UWP, UWP_IL2CPP, Android, iOS, AppleTV, WebGL C:\Program Files\Unity-5.5.0f3\
2018.3.1f1                                  Windows, Linux, Mac, Windows_IL2CPP, UWP, UWP_IL2CPP, iOS, Facebook, Vuforia, WebGL C:\Program Files\Unity\Hub\Editor\2018.3.1f1\


D:\repros\demo [master+12 ~1 -0 !]> Start-UnityEditor -Version 2018.3.1f1
Get-ChildItem : Cannot find path 'C:\Program Files\Unity-2018.3.1f1\ C:\Program Files\Unity\Hub\Editor\2' because it does not exist.
At F:\GitHub\Ziugy\unitysetup.powershell\UnitySetup\UnitySetup.psm1:1425 char:31
+ ...   $editor = Get-ChildItem "$($setupInstance.Path)" -Filter 'Unity.exe ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (C:\Program File...ty\Hub\Editor\2:String) [Get-ChildItem], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

Start-UnityEditor : Could not find Unity.exe under setup instance path: C:\Program Files\Unity-2018.3.1f1\ C:\Program Files\Unity\Hub\Editor\2018.3.1f1\
At line:1 char:1
+ Start-UnityEditor -Version 2018.3.1f1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Start-UnityEditor

Start-Process : Cannot validate argument on parameter 'FilePath'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
At F:\GitHub\Ziugy\unitysetup.powershell\UnitySetup\UnitySetup.psm1:1479 char:38
+             $process = Start-Process @setProcessArgs
+                                      ~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidData: (:) [Start-Process], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.StartProcessCommand
@Ziugy Ziugy added the bug label Jan 23, 2019
@StephenHodgson
Copy link
Contributor

StephenHodgson commented Jan 28, 2019

I actually think that #153 is a duplicate of this issue.

After digging in a bit more I realized I was trying to install the version that was already on the hosted vs2017 dev ops machines. (I guess that they got updated recently, which is when I noticed it stopped working)

@jwittner
Copy link
Member

jwittner commented Mar 29, 2019

@Ziugy Definitely a bug as it stands, but I'm hoping for feedback on the expected action. Should it just pick the first one it finds? The one with the most components? How might we let the user invoke the right one?

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

No branches or pull requests

3 participants