@@ -141,6 +141,8 @@ void HandleSpecialLaunchOptions( void )
141141 if ( CommandLineContains ( " /kdinstall" ) )
142142 {
143143 UpdateMTAVersionApplicationSetting ( true );
144+ WatchDogReset ();
145+ WatchDogBeginSection ( WD_SECTION_POST_INSTALL );
144146 if ( CheckService ( CHECK_SERVICE_POST_INSTALL ) )
145147 return ExitProcess ( EXIT_OK );
146148 return ExitProcess ( EXIT_ERROR );
@@ -320,6 +322,53 @@ void HandleResetSettings ( void )
320322}
321323
322324
325+ // ////////////////////////////////////////////////////////
326+ //
327+ // HandleNotUsedMainMenu
328+ //
329+ // Called when a problem occured before the main menu was used by user
330+ // If Win10 and fullscreen, then maybe change fullscreen mode
331+ //
332+ // ////////////////////////////////////////////////////////
333+ void HandleNotUsedMainMenu ( void )
334+ {
335+ AddReportLog ( 9310 , " Loader - HandleNotUsedMainMenu" );
336+ if ( IsWindows10OrGreater () )
337+ {
338+ // Slighty hacky way of checking in-game settings
339+ SString strCoreConfigFilename = CalcMTASAPath ( PathJoin ( " mta" , " config" , " coreconfig.xml" ) );
340+ SString strCoreConfig;
341+ FileLoad ( strCoreConfigFilename, strCoreConfig );
342+ SString strWindowed = strCoreConfig.SplitRight ( " <display_windowed>" ).Left ( 1 );
343+ SString strFullscreenStyle = strCoreConfig.SplitRight ( " <display_fullscreen_style>" ).Left ( 1 );
344+ if ( !strWindowed.empty () && !strFullscreenStyle.empty ())
345+ {
346+ if ( strWindowed == " 0" && strFullscreenStyle == " 0" ) // 0=FULLSCREEN_STANDARD
347+ {
348+ // Inform user
349+ SString strMessage = _ (" Are you having problems running MTA:SA?.\n\n Do you want to change the following setting?" );
350+ strMessage += " \n " + _ (" Fullscreen mode:" ) + " -> " + _ (" Borderless window" );
351+ int iResponse = MessageBoxUTF8 ( NULL , strMessage, " MTA: San Andreas" , MB_YESNO | MB_ICONQUESTION | MB_TOPMOST );
352+ if ( iResponse == IDYES )
353+ {
354+ // Very hacky way of changing in-game settings
355+ strCoreConfig = strCoreConfig.Replace ( " <display_fullscreen_style>0" , " <display_fullscreen_style>1" );
356+ FileSave ( strCoreConfigFilename, strCoreConfig );
357+ AddReportLog ( 9311 , " Loader - HandleNotUsedMainMenu - User change to Borderless window" );
358+ }
359+ }
360+ }
361+ else
362+ {
363+ // If no valid settings file yet, do the change without asking
364+ strCoreConfig = " <mainconfig><settings><display_fullscreen_style>1</display_fullscreen_style></settings></mainconfig>" ;
365+ FileSave ( strCoreConfigFilename, strCoreConfig );
366+ AddReportLog ( 9312 , " Loader - HandleNotUsedMainMenu - Set Borderless window" );
367+ }
368+ }
369+ }
370+
371+
323372// ////////////////////////////////////////////////////////
324373//
325374// HandleCustomStartMessage
@@ -417,6 +466,13 @@ void PreLaunchWatchDogs ( void )
417466 HandleResetSettings ();
418467 }
419468
469+ // Check for possible fullscreen problems after install
470+ if ( WatchDogIsSectionOpen ( WD_SECTION_NOT_USED_MAIN_MENU ) && WatchDogIsSectionOpen ( WD_SECTION_POST_INSTALL ) )
471+ {
472+ WatchDogCompletedSection ( WD_SECTION_NOT_USED_MAIN_MENU );
473+ HandleNotUsedMainMenu ();
474+ }
475+
420476 // Clear down freeze on quit detection
421477 WatchDogCompletedSection ( " Q0" );
422478
@@ -874,6 +930,7 @@ int LaunchGame ( SString strCmdLine )
874930
875931 WatchDogBeginSection ( " L2" ); // Gets closed when loading screen is shown
876932 WatchDogBeginSection ( " L3" ); // Gets closed when loading screen is shown, or a startup problem is handled elsewhere
933+ WatchDogBeginSection ( WD_SECTION_NOT_USED_MAIN_MENU ); // Gets closed when the main menu is used
877934
878935 // Extract 'done-admin' flag from command line
879936 bool bDoneAdmin = strCmdLine.Contains ( " /done-admin" );
0 commit comments