File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed
Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -1265,10 +1265,24 @@ function Get-UnitySetupInstanceVersion {
12651265 }
12661266
12671267 # Search through any header files which might define the unity version
1268- Write-Verbose " Looking for .h files with UNITY_VERSION defined under $path \Editor\ "
1269- $headerMatchInfo = Get-ChildItem - Path " $path \Editor\*.h" - Recurse - ErrorAction Ignore - Force - File |
1270- Select-String - Pattern " UNITY_VERSION\s`" (\d+\.\d+\.\d+[fpba]\d+)`" " |
1271- Select-Object - First 1
1268+ [string []]$knownHeaders = @ (
1269+ " $path \Editor\Data\PlaybackEngines\windowsstandalonesupport\Source\WindowsPlayer\WindowsPlayer\UnityConfigureVersion.gen.h"
1270+ )
1271+ foreach ($header in $knownHeaders ) {
1272+ Write-Verbose " Looking for UNITY_VERSION defined in $header "
1273+ if (Test-Path - PathType Leaf - Path $header ) {
1274+ $headerMatchInfo = Select-String - Path $header - Pattern " UNITY_VERSION\s`" (\d+\.\d+\.\d+[fpba]\d+)`" "
1275+ }
1276+ }
1277+
1278+ if ($null -eq $headerMatchInfo ) {
1279+ Write-Verbose " Looking for .h files with UNITY_VERSION defined under $path \Editor\ "
1280+ $headerMatchInfo = do {
1281+ Get-ChildItem - Path " $path \Editor\*.h" - Recurse - ErrorAction Ignore - Force - File |
1282+ Select-String - Pattern " UNITY_VERSION\s`" (\d+\.\d+\.\d+[fpba]\d+)`" " |
1283+ ForEach-Object { $_ ; break ; } # Stop the pipeline after the first result
1284+ } while ($false );
1285+ }
12721286
12731287 if ( $headerMatchInfo.Matches.Groups.Count -gt 1 ) {
12741288 Write-Verbose " `t Found version!"
You can’t perform that action at this time.
0 commit comments