@@ -65,7 +65,8 @@ class UnitySetupInstance {
65
65
@ {
66
66
[UnitySetupComponent ]::Documentation = , [io.path ]::Combine(" $Path " , " Editor\Data\Documentation" );
67
67
[UnitySetupComponent ]::StandardAssets = , [io.path ]::Combine(" $Path " , " Editor\Standard Assets" );
68
- [UnitySetupComponent ]::Windows_IL2CPP = , [io.path ]::Combine(" $playbackEnginePath " , " windowsstandalonesupport\Variations\win32_development_il2cpp" );
68
+ [UnitySetupComponent ]::Windows_IL2CPP = , [io.path ]::Combine(" $playbackEnginePath " , " windowsstandalonesupport\Variations\win32_development_il2cpp" ),
69
+ [io.path ]::Combine(" $playbackEnginePath " , " windowsstandalonesupport\Variations\win32_player_development_il2cpp" );;
69
70
[UnitySetupComponent ]::UWP = [io.path ]::Combine(" $playbackEnginePath " , " MetroSupport\Templates\UWP_.NET_D3D" ),
70
71
[io.path ]::Combine(" $playbackEnginePath " , " MetroSupport\Templates\UWP_D3D" );
71
72
[UnitySetupComponent ]::UWP_IL2CPP = , [io.path ]::Combine(" $playbackEnginePath " , " MetroSupport\Templates\UWP_IL2CPP_D3D" );
@@ -1278,28 +1279,33 @@ function Get-UnitySetupInstanceVersion {
1278
1279
}
1279
1280
1280
1281
# Search through any header files which might define the unity version
1281
- [string []]$knownHeaders = @ (
1282
- " $path \Editor\Data\PlaybackEngines\windowsstandalonesupport\Source\WindowsPlayer\WindowsPlayer\UnityConfigureVersion.gen.h"
1282
+ [string []]$knownFiles = @ (
1283
+ " $path \Editor\Data\PlaybackEngines\windowsstandalonesupport\Source\WindowsPlayer\WindowsPlayer\UnityConfigureVersion.gen.h" ,
1284
+ " $path \Editor\Data\PlaybackEngines\windowsstandalonesupport\Source\WindowsPlayer\WindowsPlayer\UnityConfiguration.gen.cpp"
1283
1285
)
1284
- foreach ($header in $knownHeaders ) {
1285
- Write-Verbose " Looking for UNITY_VERSION defined in $header "
1286
- if (Test-Path - PathType Leaf - Path $header ) {
1287
- $headerMatchInfo = Select-String - Path $header - Pattern " UNITY_VERSION\s`" (\d+\.\d+\.\d+[fpba]\d+)`" "
1286
+ foreach ($file in $knownFiles ) {
1287
+ Write-Verbose " Looking for UNITY_VERSION defined in $file "
1288
+ if (Test-Path - PathType Leaf - Path $file ) {
1289
+ $fileMatchInfo = Select-String - Path $file - Pattern " UNITY_VERSION.+`" (\d+\.\d+\.\d+[fpba]\d+).*`" "
1290
+ if ($null -ne $fileMatchInfo )
1291
+ {
1292
+ break ;
1293
+ }
1288
1294
}
1289
1295
}
1290
1296
1291
- if ($null -eq $headerMatchInfo ) {
1292
- Write-Verbose " Looking for .h files with UNITY_VERSION defined under $path \Editor\ "
1293
- $headerMatchInfo = do {
1294
- Get-ChildItem - Path " $path \Editor\*.h " - Recurse - ErrorAction Ignore - Force - File |
1295
- Select-String - Pattern " UNITY_VERSION\s `" (\d+\.\d+\.\d+[fpba]\d+)`" " |
1297
+ if ($null -eq $fileMatchInfo ) {
1298
+ Write-Verbose " Looking for source files with UNITY_VERSION defined under $path \Editor\ "
1299
+ $fileMatchInfo = do {
1300
+ Get-ChildItem - Path " $path \Editor" - Include ' *.cpp ' , ' *.h ' - Recurse - ErrorAction Ignore - Force - File |
1301
+ Select-String - Pattern " UNITY_VERSION.+ `" (\d+\.\d+\.\d+[fpba]\d+).* `" " |
1296
1302
ForEach-Object { $_ ; break ; } # Stop the pipeline after the first result
1297
1303
} while ($false );
1298
1304
}
1299
1305
1300
- if ( $headerMatchInfo .Matches.Groups.Count -gt 1 ) {
1306
+ if ( $fileMatchInfo .Matches.Groups.Count -gt 1 ) {
1301
1307
Write-Verbose " `t Found version!"
1302
- return [UnityVersion ]($headerMatchInfo .Matches.Groups [1 ].Value)
1308
+ return [UnityVersion ]($fileMatchInfo .Matches.Groups [1 ].Value)
1303
1309
}
1304
1310
}
1305
1311
}
0 commit comments