Skip to content

Mac Install Support - #126

Merged
wolo (awolowiecki720) merged 13 commits into
microsoft:developfrom
Ziugy:dev/macInstallSupport
Mar 20, 2019
Merged

Mac Install Support#126
wolo (awolowiecki720) merged 13 commits into
microsoft:developfrom
Ziugy:dev/macInstallSupport

Conversation

@Ziugy

@Ziugy Robert Onulak (Ziugy) commented Sep 15, 2018

Copy link
Copy Markdown
Member
  • Restructures Install-UnitySetupInstance to better support the needs for mac package installs.
  • Separates downloading packages from installing packages.
  • Handles proper PowerShell piping for commands.
  • Converts WebClient to be Async and gives a progress bar for status of download.
  • Fixes caching issue with WebClient downloads.
  • Enables filtering of installers and instances based off directory paths.

TODO: (non-blocking)

  • Error handling (enhancements?)
  • Support for upgrading previous installs.
  • Investigate Unity Hub (beta) on Mac to inspect how they're getting packages installed into other directories. This is resolved using sparsebundles

@Ziugy

Copy link
Copy Markdown
Member Author
PS /Users/Ziugy/Source/unitysetup.powershell> $installers = Find-UnitySetupInstaller -Version 2018.2.3f1 -Components Mac, Vuforia
PS /Users/Ziugy/Source/unitysetup.powershell> $installers | Install-UnitySetupInstance -Verbose
VERBOSE: Mounting sparse bundle disk.
/dev/disk2              GUID_partition_scheme
/dev/disk2s1            EFI                                                                                                                                    
/dev/disk2s2        	Apple_HFS                      	/Volumes/UnitySetup
VERBOSE: Skipping download because it's already in the cache: https://download.unity3d.com/download_unity/1431a7d2ced7/MacEditorInstaller/Unity-2018.2.3f1.pkg
VERBOSE: Skipping download because it's already in the cache: https://download.unity3d.com/download_unity/1431a7d2ced7/MacEditorTargetInstaller/UnitySetup-Vuforia-AR-Support-for-Editor-2018.2.3f1.pkg
VERBOSE: Installing Mac
VERBOSE: 09/19/2018 20:25:45: Installing Mac to /Volumes/UnitySetup/.
Password:
installer: Package name is Unity
installer: Installing at base path /Volumes/UnitySetup
installer: The install was successful.
VERBOSE: 09/19/2018 20:26:12: Succeeded.
VERBOSE: Installing Vuforia
VERBOSE: 09/19/2018 20:26:12: Installing Vuforia to /Volumes/UnitySetup/.
installer: Package name is VuforiaSupport
installer: Installing at base path /Volumes/UnitySetup
installer: The install was successful.
VERBOSE: 09/19/2018 20:26:14: Succeeded.
VERBOSE: Copying install to /Applications/Unity-2018.2.3f1/.
VERBOSE: Freeing sparse bundle disk space and unmounting.
"disk2" unmounted.
"disk2" ejected.
Starting to compact…
Reclaiming free space…
.............................................................................................................................................................
Finishing compaction…
Reclaimed 2.4 GB out of 31.6 GB possible.
PS /Users/Ziugy/Source/unitysetup.powershell> $installers = Find-UnitySetupInstaller -Version 2018.2.3f1 -Components Linux                                   
PS /Users/Ziugy/Source/unitysetup.powershell> $installers | Install-UnitySetupInstance -Verbose
VERBOSE: Mounting sparse bundle disk.
/dev/disk2              GUID_partition_scheme
/dev/disk2s1            EFI                                                                                                                                    
/dev/disk2s2        	Apple_HFS                      	/Volumes/UnitySetup
VERBOSE: Copying /Applications/Unity-2018.2.3f1/ to /Volumes/UnitySetup/Applications/Unity/
VERBOSE: Skipping download because it's already in the cache: https://download.unity3d.com/download_unity/1431a7d2ced7/MacEditorTargetInstaller/UnitySetup-Linux-Support-for-Editor-2018.2.3f1.pkg
VERBOSE: Installing Linux
VERBOSE: 09/19/2018 20:27:32: Installing Linux to /Volumes/UnitySetup/.
installer: Package name is LinuxStandaloneSupport
installer: Installing at base path /Volumes/UnitySetup
installer: The install was successful.
VERBOSE: 09/19/2018 20:27:37: Succeeded.
VERBOSE: Copying install to /Applications/Unity-2018.2.3f1/.
VERBOSE: Freeing sparse bundle disk space and unmounting.
"disk2" unmounted.
"disk2" ejected.
Starting to compact…
Reclaiming free space…
.............................................................................................................................................................
Finishing compaction…
Reclaimed 3.0 GB out of 31.6 GB possible.
PS /Users/Ziugy/Source/unitysetup.powershell> $installers = Find-UnitySetupInstaller -Version 2018.2.3f1 -Components AppleTV                                 
PS /Users/Ziugy/Source/unitysetup.powershell> $installers = Find-UnitySetupInstaller -Version 2018.2.3f1 -Components iOS, Android
PS /Users/Ziugy/Source/unitysetup.powershell> $installers | Install-UnitySetupInstance -Verbose
VERBOSE: Mounting sparse bundle disk.
/dev/disk2              GUID_partition_scheme
/dev/disk2s1            EFI                                                                                                                                    
/dev/disk2s2        	Apple_HFS                      	/Volumes/UnitySetup
VERBOSE: Copying /Applications/Unity-2018.2.3f1/ to /Volumes/UnitySetup/Applications/Unity/
VERBOSE: Skipping download because it's already in the cache: https://download.unity3d.com/download_unity/1431a7d2ced7/MacEditorTargetInstaller/UnitySetup-Android-Support-for-Editor-2018.2.3f1.pkg
VERBOSE: Skipping download because it's already in the cache: https://download.unity3d.com/download_unity/1431a7d2ced7/MacEditorTargetInstaller/UnitySetup-iOS-Support-for-Editor-2018.2.3f1.pkg
VERBOSE: Installing Android
VERBOSE: 09/19/2018 20:29:29: Installing Android to /Volumes/UnitySetup/.
installer: Package name is AndroidPlayer
installer: Installing at base path /Volumes/UnitySetup
installer: The install was successful.
VERBOSE: 09/19/2018 20:29:37: Succeeded.
VERBOSE: Installing iOS
VERBOSE: 09/19/2018 20:29:37: Installing iOS to /Volumes/UnitySetup/.
installer: Package name is iOSSupport
installer: Installing at base path /Volumes/UnitySetup
installer: The install was successful.
VERBOSE: 09/19/2018 20:30:03: Succeeded.
VERBOSE: Copying install to /Applications/Unity-2018.2.3f1/.
VERBOSE: Freeing sparse bundle disk space and unmounting.
"disk2" unmounted.
"disk2" ejected.
Starting to compact…
Reclaiming free space…
.............................................................................................................................................................
Finishing compaction…
Reclaimed 7.3 GB out of 31.6 GB possible.

@awolowiecki720 wolo (awolowiecki720) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, we should expose these functions in the .psd1 so that users who import the module have that functionality available to them.
For example, Select-UnitySetupInstaller function and corresponding flags are not available for me while testing in powershell

Comment thread UnitySetup/UnitySetup.psm1
Comment thread UnitySetup/UnitySetup.psm1
Robert Onulak (Ziugy) and others added 4 commits January 10, 2019 07:22
- Adapts batch downloading to the restuctured version in this branch.
…asn't being calculated. Thus command was still blocking indefinitely.
@Ziugy

Copy link
Copy Markdown
Member Author

Josh Wittner (@jwittner) - I merged in your batch download changes into here. Restructured a bit to continue supporting Write-Progress. Here's the commands that I ran for testing changes to this portion.

F:\GitHub\Microsoft\unitysetup.powershell [(9fe346d...)]> $installers = Find-UnitySetupInstaller -Version 2018.3.1f1
WARNING: Unable to find installer for the StandardAssets component.
F:\GitHub\Microsoft\unitysetup.powershell [(9fe346d...)]> $installers | Request-UnitySetupInstaller

 ComponentType Path
 ------------- ----
       Windows C:\Users\roonulak\.unitysetup\Installers\Unity-2018.3.1f1\UnitySetup64-2018.3.1f1.exe
         Linux C:\Users\roonulak\.unitysetup\Installers\Unity-2018.3.1f1\UnitySetup-Linux-Support-for-Editor-2018.3.1f1.exe
           Mac C:\Users\roonulak\.unitysetup\Installers\Unity-2018.3.1f1\UnitySetup-Mac-Mono-Support-for-Editor-2018.3.1f1.exe
 Documentation C:\Users\roonulak\.unitysetup\Installers\Unity-2018.3.1f1\UnityDocumentationSetup-2018.3.1f1.exe
Windows_IL2CPP C:\Users\roonulak\.unitysetup\Installers\Unity-2018.3.1f1\UnitySetup-Windows-IL2CPP-Support-for-Editor-2018.3.1f1...
           UWP C:\Users\roonulak\.unitysetup\Installers\Unity-2018.3.1f1\UnitySetup-UWP-.NET-Support-for-Editor-2018.3.1f1.exe
    UWP_IL2CPP C:\Users\roonulak\.unitysetup\Installers\Unity-2018.3.1f1\UnitySetup-UWP-IL2CPP-Support-for-Editor-2018.3.1f1.exe
       Android C:\Users\roonulak\.unitysetup\Installers\Unity-2018.3.1f1\UnitySetup-Android-Support-for-Editor-2018.3.1f1.exe
           iOS C:\Users\roonulak\.unitysetup\Installers\Unity-2018.3.1f1\UnitySetup-iOS-Support-for-Editor-2018.3.1f1.exe
       AppleTV C:\Users\roonulak\.unitysetup\Installers\Unity-2018.3.1f1\UnitySetup-AppleTV-Support-for-Editor-2018.3.1f1.exe
      Facebook C:\Users\roonulak\.unitysetup\Installers\Unity-2018.3.1f1\UnitySetup-Facebook-Games-Support-for-Editor-2018.3.1f1...
       Vuforia C:\Users\roonulak\.unitysetup\Installers\Unity-2018.3.1f1\UnitySetup-Vuforia-AR-Support-for-Editor-2018.3.1f1.exe
         WebGL C:\Users\roonulak\.unitysetup\Installers\Unity-2018.3.1f1\UnitySetup-WebGL-Support-for-Editor-2018.3.1f1.exe

Batch downloads with multiple versions and specific components:

F:\GitHub\Microsoft\unitysetup.powershell [(9fe346d...)]> $installers = Find-UnitySetupInstaller -Version 2017.3.1f1
WARNING: Unable to find installer for the Windows_IL2CPP component.
F:\GitHub\Microsoft\unitysetup.powershell [(9fe346d...)]> $installers += Find-UnitySetupInstaller -Version 2017.4.8f1
WARNING: Unable to find installer for the Windows_IL2CPP component.
F:\GitHub\Microsoft\unitysetup.powershell [(9fe346d...)]> $installers | Select-UnitySetupInstaller -Components Windows, Mac, Linux |Request-UnitySetupInstaller

ComponentType Path
------------- ----
          Mac C:\Users\roonulak\.unitysetup\Installers\Unity-2017.3.1f1\UnitySetup-Mac-Support-for-Editor-2017.3.1f1.exe
          Mac C:\Users\roonulak\.unitysetup\Installers\Unity-2017.4.8f1\UnitySetup-Mac-Support-for-Editor-2017.4.8f1.exe
      Windows C:\Users\roonulak\.unitysetup\Installers\Unity-2017.3.1f1\UnitySetup64-2017.3.1f1.exe
        Linux C:\Users\roonulak\.unitysetup\Installers\Unity-2017.4.8f1\UnitySetup-Linux-Support-for-Editor-2017.4.8f1.exe
        Linux C:\Users\roonulak\.unitysetup\Installers\Unity-2017.3.1f1\UnitySetup-Linux-Support-for-Editor-2017.3.1f1.exe
      Windows C:\Users\roonulak\.unitysetup\Installers\Unity-2017.4.8f1\UnitySetup64-2017.4.8f1.exe

@awolowiecki720

Copy link
Copy Markdown
Contributor

Robert Onulak (@Ziugy) there's a merge conflict, can you please fix so I can test your changes?

@awolowiecki720
wolo (awolowiecki720) dismissed their stale review January 22, 2019 19:29

Changes were made, needs another review.

…efault install path moved to Unity Hub's default install location.
@Ziugy

Copy link
Copy Markdown
Member Author

wolo (@awolowiecki720), I merged in the latest Microsoft/unitysetup.powershell and resolved the merge conflict.

- Resolves issues if recursive directories do not exist in install path for macOS.
@Ziugy

Copy link
Copy Markdown
Member Author

wolo (@awolowiecki720), I pushed another change that addresses some more issues:

  • A fallback for finding the Unity version based off builtin_shaders
    • Unity 2018.3 for macOS no longer has version in url for the editor.
    • They also host the main install now as a dmg. The pkg file still exists. Therefore, in a future PR, we possibly need to future proof installing the editor using the dmg.
  • I was getting some read issues while in Unity 2018.2.5f1 with pacman unable to read some packages.
    • I put in the extra +w to the chmod. I didn't see the issue after installing and launching Unity 2018.3.1f1. I'll test the earlier version again later tonight. Need to redownload the pkgs.
  • Resolves a small bug when multiple folders are not yet created in the destination directory.

@awolowiecki720

Copy link
Copy Markdown
Contributor

Robert Onulak (@Ziugy) question about Test-UnitySetupInstance - unlike gusi it is returning false for me unless I am in the exact path to the editor or i specify that path to pwsh; in which case I obviously know if it's installed since i can look directly at the path. Am i using this as intended or am i missing the point?
For example, gusi will just list every version installed and the path to it. Josh Wittner (@jwittner)

@Ziugy

Copy link
Copy Markdown
Member Author

Test-UnitySetupInstance was written to be the equivalent of Test-Path for installs. Yes, gsui shows them; I needed something to branch when one exists / doesn't exist.

I also expect we would extend Test-UnitySetupInstance to also include testing for Components too.

@jwittner

Copy link
Copy Markdown
Member

wolo (@awolowiecki720) - sounds like this is working now. Can you accept the changes and approve the PR? I can merge it after that. =)

@awolowiecki720
wolo (awolowiecki720) merged commit fa131b7 into microsoft:develop Mar 20, 2019
@StephenHodgson

Copy link
Copy Markdown
Contributor

CI still fails for me: Logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants