From ed21ab5e93bc766fcdfd4f5af86e85570d6311cf Mon Sep 17 00:00:00 2001 From: Josh Wittner Date: Wed, 8 Feb 2023 10:50:11 -0800 Subject: [PATCH 1/6] Support override env var for gusi arg --- UnitySetup/UnitySetup.psm1 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/UnitySetup/UnitySetup.psm1 b/UnitySetup/UnitySetup.psm1 index 4edaa6a..dd7f86d 100644 --- a/UnitySetup/UnitySetup.psm1 +++ b/UnitySetup/UnitySetup.psm1 @@ -1179,6 +1179,8 @@ function Uninstall-UnitySetupInstance { Get the Unity versions installed and their locations .PARAMETER BasePath Under what base patterns should we look for Unity installs? + Defaults to Unity default locations by platform + Default can be configured by comma separated paths in $env:UNITY_SETUP_INSTANCE_DEFAULT_BASEPATH .EXAMPLE Get-UnitySetupInstance #> @@ -1189,6 +1191,13 @@ function Get-UnitySetupInstance { [string[]] $BasePath ) + if((-not $BasePath) -and $env:UNITY_SETUP_INSTANCE_BASEPATH_DEFAULT){ + $BasePath = ($env:UNITY_SETUP_INSTANCE_BASEPATH_DEFAULT -split ',') | ForEach-Object { + $_.trim() + } + Write-Verbose "Set BasePath to $BasePath from `$env:UNITY_SETUP_INSTANCE_BASEPATH_DEFAULT." + } + switch (Get-OperatingSystem) { ([OperatingSystem]::Windows) { if (-not $BasePath) { @@ -1205,6 +1214,7 @@ function Get-UnitySetupInstance { } } + Write-Verbose "Searching `"$BasePath`" for UnitySetup instances..." Get-ChildItem -Path $BasePath -Directory -ErrorAction Ignore | Where-Object { (Get-UnityEditor $_.FullName).Count -gt 0 } | ForEach-Object { From 01faa0221bd30700703ef5dff23dba4c59dc30c7 Mon Sep 17 00:00:00 2001 From: "microsoft-github-policy-service[bot]" <77245923+microsoft-github-policy-service[bot]@users.noreply.github.com> Date: Fri, 2 Jun 2023 19:18:45 +0000 Subject: [PATCH 2/6] Microsoft mandatory file --- SECURITY.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..e138ec5 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,41 @@ + + +## Security + +Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). + +If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. + +## Reporting Security Issues + +**Please do not report security vulnerabilities through public GitHub issues.** + +Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). + +If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). + +You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). + +Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: + + * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) + * Full paths of source file(s) related to the manifestation of the issue + * The location of the affected source code (tag/branch/commit or direct URL) + * Any special configuration required to reproduce the issue + * Step-by-step instructions to reproduce the issue + * Proof-of-concept or exploit code (if possible) + * Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. + +## Preferred Languages + +We prefer all communications to be in English. + +## Policy + +Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). + + From 5bad636aeed81075c521c3b2dd87ac5a7a627fde Mon Sep 17 00:00:00 2001 From: Josh Wittner Date: Fri, 14 Jul 2023 09:38:49 -0700 Subject: [PATCH 3/6] Pass through version as it doesn't match strict UnityVersion --- UnitySetup/UnitySetup.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnitySetup/UnitySetup.psm1 b/UnitySetup/UnitySetup.psm1 index dd7f86d..44525a1 100644 --- a/UnitySetup/UnitySetup.psm1 +++ b/UnitySetup/UnitySetup.psm1 @@ -2073,7 +2073,7 @@ function Get-UnityLicense { [PSCustomObject]@{ 'LicenseVersion' = $license.LicenseVersion.Value 'Serial' = ConvertTo-SecureString $licenseSerial -AsPlainText -Force - 'UnityVersion' = [UnityVersion]$license.ClientProvidedVersion.Value + 'UnityVersion' = $license.ClientProvidedVersion.Value 'DisplaySerial' = $license.SerialMasked.Value 'ActivationDate' = ConvertTo-DateTime $license.InitialActivationDate.Value 'StartDate' = ConvertTo-DateTime $license.StartDate.Value From 52e65cedbdabb45cd04e98a0d5dd0e9f5b2bff6b Mon Sep 17 00:00:00 2001 From: Josh Wittner Date: Wed, 2 Aug 2023 16:27:49 -0700 Subject: [PATCH 4/6] Search well known listing page when hash is known --- UnitySetup/UnitySetup.psm1 | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/UnitySetup/UnitySetup.psm1 b/UnitySetup/UnitySetup.psm1 index 44525a1..7ebb3aa 100644 --- a/UnitySetup/UnitySetup.psm1 +++ b/UnitySetup/UnitySetup.psm1 @@ -485,11 +485,16 @@ function Find-UnitySetupInstaller { } } + if($Hash -ne ""){ + $searchPages += "http://beta.unity3d.com/download/$Hash/download.html" + } + foreach ($page in $searchPages) { try { + Write-Verbose "Searching page - $page" $webResult = Invoke-WebRequest $page -UseBasicParsing $prototypeLink = $webResult.Links | - Select-Object -ExpandProperty href -ErrorAction SilentlyContinue | + Select-Object -ExpandProperty href -ErrorAction SilentlyContinue | Where-Object { $link = $_ @@ -500,11 +505,18 @@ function Find-UnitySetupInstaller { } return $false - - } | + } | Select-Object -First 1 - if ($null -ne $prototypeLink) { break } + if ($null -ne $prototypeLink) + { + # Ensure prototype link is absolute uri + if(-not [system.uri]::IsWellFormedUriString($_,[System.UriKind]::Absolute)) { + $prototypeLink = "$([system.uri]::new([system.uri]$page, [system.uri]$prototypeLink))" + } + + break + } } catch { Write-Verbose "$page failed: $($_.Exception.Message)" @@ -515,6 +527,7 @@ function Find-UnitySetupInstaller { throw "Could not find archives for Unity version $Version" } + Write-Verbose "Prototype link found: $prototypeLink" $linkComponents = $prototypeLink -split $unitySetupRegEx -ne "" if ($knownBaseUrls -notcontains $linkComponents[0]) { @@ -535,6 +548,7 @@ function Find-UnitySetupInstaller { foreach ( $baseUrl in $knownBaseUrls) { $endpoint = [uri][System.IO.Path]::Combine($baseUrl, $linkComponents[1], $template); try { + Write-Verbose "Attempting to get component $_ details from endpoint: $endpoint" $testResult = Invoke-WebRequest $endpoint -Method HEAD -UseBasicParsing # For packages on macOS the Content-Length and Last-Modified are returned as an array. if ($testResult.Headers['Content-Length'] -is [System.Array]) { From 6b1f99364ac8ca72f59bec3be4210ce73095213a Mon Sep 17 00:00:00 2001 From: Cierra Shawe <55116667+cishawe@users.noreply.github.com> Date: Tue, 21 Nov 2023 20:27:36 -0800 Subject: [PATCH 5/6] Updated UnitySetup.psm1 to support Windows Dedicated Server --- UnitySetup/UnitySetup.psm1 | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/UnitySetup/UnitySetup.psm1 b/UnitySetup/UnitySetup.psm1 index 7ebb3aa..2867ae0 100644 --- a/UnitySetup/UnitySetup.psm1 +++ b/UnitySetup/UnitySetup.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. Import-Module powershell-yaml -MinimumVersion '0.3' -ErrorAction Stop @@ -22,7 +22,8 @@ enum UnitySetupComponent { Mac_IL2CPP = (1 -shl 14) Lumin = (1 -shl 15) Linux_IL2CPP = (1 -shl 16) - All = (1 -shl 17) - 1 + Windows_Server = (1 -shl 17) + All = (1 -shl 18) - 1 } [Flags()] @@ -66,13 +67,19 @@ class UnitySetupInstance { [UnitySetupComponent]::Documentation = , [io.path]::Combine("$Path", "Editor\Data\Documentation"); [UnitySetupComponent]::StandardAssets = , [io.path]::Combine("$Path", "Editor\Standard Assets"); [UnitySetupComponent]::Windows_IL2CPP = , [io.path]::Combine("$playbackEnginePath", "windowsstandalonesupport\Variations\win32_development_il2cpp"), - [io.path]::Combine("$playbackEnginePath", "windowsstandalonesupport\Variations\win32_player_development_il2cpp");; + [io.path]::Combine("$playbackEnginePath", "windowsstandalonesupport\Variations\win32_player_development_il2cpp"); [UnitySetupComponent]::UWP = [io.path]::Combine("$playbackEnginePath", "MetroSupport\Templates\UWP_.NET_D3D"), [io.path]::Combine("$playbackEnginePath", "MetroSupport\Templates\UWP_D3D"); [UnitySetupComponent]::UWP_IL2CPP = , [io.path]::Combine("$playbackEnginePath", "MetroSupport\Templates\UWP_IL2CPP_D3D"); [UnitySetupComponent]::Linux = , [io.path]::Combine("$playbackEnginePath", "LinuxStandaloneSupport\Variations\linux64_headless_development_mono"); [UnitySetupComponent]::Linux_IL2CPP = , [io.path]::Combine("$playbackEnginePath", "LinuxStandaloneSupport\Variations\linux64_headless_development_il2cpp"); [UnitySetupComponent]::Mac = , [io.path]::Combine("$playbackEnginePath", "MacStandaloneSupport"); + [UnitySetupComponent]::Windows_Server = , [io.path]::Combine("$playbackEnginePath", "WindowsStandaloneSupport\Variations\win32_player_development_mono"), + [io.path]::Combine("$playbackEnginePath", "WindowsStandaloneSupport\Variations\win32_server_development_il2cpp"), + [io.path]::Combine("$playbackEnginePath", "WindowsStandaloneSupport\Variations\win32_server_development_mono"), + [io.path]::Combine("$playbackEnginePath", "WindowsStandaloneSupport\Variations\win64_player_development_mono"), + [io.path]::Combine("$playbackEnginePath", "WindowsStandaloneSupport\Variations\win64_server_development_il2cpp"), + [io.path]::Combine("$playbackEnginePath", "WindowsStandaloneSupport\Variations\win64_server_development_mono"); } } ([OperatingSystem]::Linux) { @@ -414,6 +421,7 @@ function Find-UnitySetupInstaller { [UnitySetupComponent]::Windows_IL2CPP = , "$targetSupport/UnitySetup-Windows-IL2CPP-Support-for-Editor-$Version.$installerExtension"; [UnitySetupComponent]::Lumin = , "$targetSupport/UnitySetup-Lumin-Support-for-Editor-$Version.$installerExtension"; [UnitySetupComponent]::Linux_IL2CPP = , "$targetSupport/UnitySetup-Linux-IL2CPP-Support-for-Editor-$Version.$installerExtension"; + [UnitySetupComponent]::Windows_Server = , "$targetSupport/UnitySetup-Windows-Server-Support-for-Editor-$Version.$installerExtension"; } # In 2019.x there is only IL2CPP UWP so change the search for UWP_IL2CPP @@ -1692,6 +1700,8 @@ function Test-UnityProjectInstanceMetaFileIntegrity { The log file for the Unity Editor to write to. .PARAMETER BuildTarget The platform build target for the Unity Editor to start in. +.PARAMETER StandaloneBuildSubtarget + Select an active build sub-target for the Standalone platforms before loading a project. .PARAMETER AcceptAPIUpdate Accept the API Updater automatically. Implies BatchMode unless explicitly specified by the user. .PARAMETER Credential @@ -1780,6 +1790,9 @@ function Start-UnityEditor { [ValidateSet('StandaloneOSX', 'StandaloneWindows', 'iOS', 'Android', 'StandaloneLinux', 'StandaloneWindows64', 'WebGL', 'WSAPlayer', 'StandaloneLinux64', 'StandaloneLinuxUniversal', 'Tizen', 'PSP2', 'PS4', 'XBoxOne', 'N3DS', 'WiiU', 'tvOS', 'Switch', 'Lumin')] [string]$BuildTarget, [parameter(Mandatory = $false)] + [ValidateSet('Player', 'Server')] + [string]$StandaloneBuildSubtarget, + [parameter(Mandatory = $false)] [switch]$AcceptAPIUpdate, [parameter(Mandatory = $false)] [pscredential]$Credential, @@ -1899,6 +1912,7 @@ function Start-UnityEditor { if ( $OutputPath ) { $sharedArgs += "-buildOutput", "`"$OutputPath`"" } if ( $LogFile ) { $sharedArgs += "-logFile", "`"$LogFile`"" } if ( $BuildTarget ) { $sharedArgs += "-buildTarget", $BuildTarget } + if ( $StandaloneBuildSubtarget ) { $sharedArgs += "-standaloneBuildSubtarget", $StandaloneBuildSubtarget } if ( $BatchMode ) { $sharedArgs += "-batchmode" } if ( $Quit ) { $sharedArgs += "-quit" } if ( $ExportPackage ) { $sharedArgs += "-exportPackage", ($ExportPackage | ForEach-Object { "`"$_`"" }) } From 28f7ac9b5a2715d917bdef8696c42c8b7235c53a Mon Sep 17 00:00:00 2001 From: Cierra Shawe <55116667+cishawe@users.noreply.github.com> Date: Tue, 28 Nov 2023 11:11:07 -0800 Subject: [PATCH 6/6] Updated module version number --- UnitySetup/UnitySetup.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnitySetup/UnitySetup.psd1 b/UnitySetup/UnitySetup.psd1 index d62ef11..9043053 100644 --- a/UnitySetup/UnitySetup.psd1 +++ b/UnitySetup/UnitySetup.psd1 @@ -14,7 +14,7 @@ RootModule = 'UnitySetup' # Version number of this module. - ModuleVersion = '5.5' + ModuleVersion = '5.6' # Supported PSEditions # CompatiblePSEditions = @()