Skip to content

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

Open
@Ziugy

Description

@Ziugy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions