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