@@ -391,6 +391,14 @@ impl LaunchPipeline {
391391
392392 let mut fatal_error = None ;
393393 for evidence in & ctx. graphics_stack . graphics_stack_evidence {
394+ if evidence. contains ( "Steam Client/Environment Failure" ) {
395+ fatal_error = Some ( "steam_environment_incomplete" ) ;
396+ break ;
397+ }
398+ if evidence. contains ( "PhysX/Middleware failure" ) {
399+ fatal_error = Some ( "middleware_dependency_failure" ) ;
400+ break ;
401+ }
394402 if evidence. contains ( "DLL Load Failure" ) {
395403 fatal_error = Some ( "missing_required_module" ) ;
396404 break ;
@@ -756,6 +764,12 @@ impl LaunchPipeline {
756764 let lines: Vec < & str > = content. lines ( ) . collect ( ) ;
757765 ctx. graphics_stack . runtime_evidence . scan_metadata . line_count = lines. len ( ) ;
758766
767+ // Capture Log Head/Tail
768+ ctx. verification . log_head = lines. iter ( ) . take ( 50 ) . map ( |s| s. to_string ( ) ) . collect ( ) ;
769+ if lines. len ( ) > 50 {
770+ ctx. verification . log_tail = lines. iter ( ) . rev ( ) . take ( 100 ) . rev ( ) . map ( |s| s. to_string ( ) ) . collect ( ) ;
771+ }
772+
759773 // Derive component paths from dll resolutions
760774 let mut component_paths = HashMap :: new ( ) ;
761775 for res in & ctx. dll_resolutions {
@@ -964,17 +978,51 @@ impl LaunchPipeline {
964978 let mut metadata = HashMap :: new ( ) ;
965979 metadata. insert ( "prefix_path" . to_string ( ) , prefix. clone ( ) ) ;
966980
981+ // Detect Windows username
982+ let users_dir = prefix_path. join ( "drive_c/users" ) ;
983+ if users_dir. exists ( ) {
984+ if let Ok ( entries) = std:: fs:: read_dir ( & users_dir) {
985+ let mut usernames = Vec :: new ( ) ;
986+ for entry in entries. flatten ( ) {
987+ if entry. file_type ( ) . map ( |t| t. is_dir ( ) ) . unwrap_or ( false ) {
988+ let name = entry. file_name ( ) . to_string_lossy ( ) . to_string ( ) ;
989+ if name != "Public" && name != "All Users" && name != "Default User" {
990+ usernames. push ( name) ;
991+ }
992+ }
993+ }
994+ if !usernames. is_empty ( ) {
995+ // Sort and pick first (most likely primary)
996+ usernames. sort ( ) ;
997+ let primary = usernames[ 0 ] . clone ( ) ;
998+ ctx. verification . windows_username = Some ( primary. clone ( ) ) ;
999+ ctx. verification . windows_user_path = Some ( format ! ( "C:\\ users\\ {}" , primary) ) ;
1000+ metadata. insert ( "detected_windows_username" . to_string ( ) , primary) ;
1001+ }
1002+ }
1003+ }
1004+
1005+ let username = ctx. verification . windows_username . as_deref ( ) . unwrap_or ( "steamuser" ) ;
9671006 let common_dirs = [
968- "drive_c/users/steamuser/Documents" ,
969- "drive_c/users/steamuser/AppData/Local" ,
970- "drive_c/users/steamuser/AppData/Roaming" ,
1007+ format ! ( "drive_c/users/{}/Documents" , username) ,
1008+ format ! ( "drive_c/users/{}/AppData/Local" , username) ,
1009+ format ! ( "drive_c/users/{}/AppData/Roaming" , username) ,
1010+ "drive_c/Program Files (x86)/Steam/steam.exe" . to_string ( ) ,
1011+ "drive_c/windows/system32/PhysXLoader.dll" . to_string ( ) ,
1012+ "drive_c/windows/syswow64/PhysXLoader.dll" . to_string ( ) ,
9711013 ] ;
9721014
9731015 for dir in common_dirs {
974- let full_path = prefix_path. join ( dir) ;
975- metadata. insert ( format ! ( "dir_exists:{}" , dir) , full_path. exists ( ) . to_string ( ) ) ;
1016+ let full_path = prefix_path. join ( & dir) ;
1017+ let exists = full_path. exists ( ) ;
1018+ metadata. insert ( format ! ( "path_exists:{}" , dir) , exists. to_string ( ) ) ;
1019+ ctx. verification . key_paths_detected . insert ( dir, exists) ;
9761020 }
9771021
1022+ // Check steam client exposure
1023+ ctx. verification . steam_client_exposed = spec. env . contains_key ( "STEAM_COMPAT_CLIENT_INSTALL_PATH" ) ||
1024+ spec. env . get ( "WINEPATH" ) . map ( |wp| wp. contains ( "Steam" ) ) . unwrap_or ( false ) ;
1025+
9781026 if let Some ( logger) = & ctx. logger {
9791027 let _ = logger. info ( "prefix_health_check" , "WINEPREFIX sanity check complete" . to_string ( ) , None , metadata) ;
9801028 }
@@ -1148,6 +1196,11 @@ impl LaunchPipeline {
11481196 metadata. insert ( "verification_detailed" . to_string ( ) , detailed. clone ( ) ) ;
11491197 }
11501198
1199+ if let Some ( ref username) = ctx. verification . windows_username {
1200+ metadata. insert ( "windows_user" . to_string ( ) , username. clone ( ) ) ;
1201+ }
1202+ metadata. insert ( "steam_client_exposed" . to_string ( ) , ctx. verification . steam_client_exposed . to_string ( ) ) ;
1203+
11511204 let _ = logger. info ( "launch_summary_concise" , "Concise launch summary recorded" . to_string ( ) , None , metadata) ;
11521205 }
11531206 }
0 commit comments