|
22 | 22 | #include <Softpub.h> |
23 | 23 | #include <wintrust.h> |
24 | 24 | #include <version.h> |
| 25 | +#include <windows.h> |
25 | 26 | #pragma comment (lib, "wintrust") |
26 | 27 |
|
27 | 28 | namespace fs = std::filesystem; |
@@ -527,30 +528,26 @@ bool LookForGtaProcess(SString& strOutPathFilename) |
527 | 528 | // |
528 | 529 | // |
529 | 530 | /////////////////////////////////////////////////////////////// |
530 | | -SString DoUserAssistedSearch() |
| 531 | +static const SString DoUserAssistedSearch() noexcept |
531 | 532 | { |
532 | | - SString strResult; |
| 533 | + SString result; |
533 | 534 |
|
534 | | - ShowProgressDialog(g_hInstance, _("Searching for Grand Theft Auto San Andreas"), true); |
| 535 | + MessageBox(nullptr, _("Start Grand Theft Auto: San Andreas.\nEnsure the game is placed in the 'Program Files (x86)' folder."), _("Searching for GTA: San Andreas"), MB_OK | MB_ICONINFORMATION); |
535 | 536 |
|
536 | | - while (!UpdateProgress(0, 100, _("Please start Grand Theft Auto San Andreas"))) |
| 537 | + while (true) |
537 | 538 | { |
538 | | - SString strPathFilename; |
539 | | - // Check if user has started GTA |
540 | | - if (LookForGtaProcess(strPathFilename)) |
| 539 | + SString path; |
| 540 | + |
| 541 | + if (LookForGtaProcess(path)) |
541 | 542 | { |
542 | | - // If so, get the exe path |
543 | | - ExtractFilename(strPathFilename, &strResult, NULL); |
544 | | - // And then stop it |
| 543 | + ExtractFilename(path, &result, nullptr); |
545 | 544 | TerminateGTAIfRunning(); |
546 | | - break; |
| 545 | + return result; |
547 | 546 | } |
548 | 547 |
|
549 | | - Sleep(200); |
| 548 | + if (MessageBox(nullptr, _("Sorry, game not found.\nStart Grand Theft Auto: San Andreas and click retry.\nEnsure the game is placed in the 'Program Files (x86)' folder."), _("Searching for GTA: San Andreas"), MB_RETRYCANCEL | MB_ICONWARNING) == IDCANCEL) |
| 549 | + return result; |
550 | 550 | } |
551 | | - |
552 | | - HideProgressDialog(); |
553 | | - return strResult; |
554 | 551 | } |
555 | 552 |
|
556 | 553 | /////////////////////////////////////////////////////////////// |
|
0 commit comments