@@ -51,22 +51,23 @@ class UnitySetupInstance {
51
51
UnitySetupInstance([string ]$path ) {
52
52
53
53
$currentOS = Get-OperatingSystem
54
- $ivyPath = switch ($currentOS ) {
55
- ([OperatingSystem ]::Windows) { ' Editor\Data\UnityExtensions\ Unity\Networking\ivy.xml ' }
54
+ $executable = switch ($currentOS ) {
55
+ ([OperatingSystem ]::Windows) { ' Editor\Unity.exe ' }
56
56
([OperatingSystem ]::Linux) { throw " UnitySetupInstance has not been implemented on the Linux platform. Contributions welcomed!" ; }
57
- ([OperatingSystem ]::Mac) { ' Unity.app/Contents/UnityExtensions /Unity/Networking/ivy.xml ' }
57
+ ([OperatingSystem ]::Mac) { ' Unity.app/Contents/MacOS /Unity/Unity.exe ' } # TODO Validate path
58
58
}
59
59
60
- $ivyPath = [io.path ]::Combine(" $path " , $ivyPath );
61
- if (! (Test-Path $ivyPath )) { throw " Path is not a Unity setup: $path " }
62
- [xml ]$xmlDoc = Get-Content $ivyPath
60
+ $executable = [io.path ]::Combine(" $path " , $executable );
61
+ if (! (Test-Path $executable )) { throw " Path is not a Unity setup: $path " }
63
62
64
- if ( ! ($xmlDoc .' ivy-module' .info.unityVersion)) {
65
- throw " Unity setup ivy is missing version: $ivyPath "
63
+ $version = switch ($currentOS ) {
64
+ ([OperatingSystem ]::Windows) { Split-Path (Split-Path - Path $executable - Parent | Split-Path - Parent) - Leaf }
65
+ ([OperatingSystem ]::Linux) { throw " UnitySetupInstance has not been implemented on the Linux platform. Contributions welcomed!" ; }
66
+ ([OperatingSystem ]::Mac) { ??? }
66
67
}
67
68
68
69
$this.Path = $path
69
- $this.Version = $xmlDoc . ' ivy-module ' .info.unityVersion
70
+ $this.Version = $version
70
71
71
72
$playbackEnginePath = $null
72
73
$componentTests = switch ($currentOS ) {
@@ -970,7 +971,7 @@ function Install-UnitySetupInstance {
970
971
971
972
$editorInstaller = $installerPaths | Where-Object { $_.ComponentType -band $editorComponent }
972
973
if ($null -ne $editorInstaller ) {
973
- Write-Verbose " Installing $ ( $editorInstaller.ComponentType ) "
974
+ Write-Verbose " Installing $ ( $editorInstaller.ComponentType ) Editor "
974
975
Install-UnitySetupPackage - Package $editorInstaller - Destination $packageDestination
975
976
}
976
977
0 commit comments