@@ -49,6 +49,12 @@ Heap g_userHeap;
4949XDBFWrapper g_xdbfWrapper;
5050std::unordered_map<uint16_t , GuestTexture*> g_xdbfTextureCache;
5151
52+ static std::string PathToUTF8 (const std::filesystem::path& path)
53+ {
54+ auto pathU8 = path.u8string ();
55+ return std::string (pathU8.begin (), pathU8.end ());
56+ }
57+
5258void HostStartup ()
5359{
5460#ifdef _WIN32
@@ -207,6 +213,10 @@ int main(int argc, char *argv[])
207213
208214 os::logger::Init ();
209215
216+ #ifdef UNLEASHED_RECOMP_IOS
217+ LOGN (" iOS startup build: install-validation-v3" );
218+ #endif
219+
210220 PreloadContext preloadContext;
211221 preloadContext.PreloadExecutable ();
212222
@@ -248,10 +258,14 @@ int main(int argc, char *argv[])
248258 // Create the console to show progress to the user, otherwise it will seem as if the game didn't boot at all.
249259 os::process::ShowConsole ();
250260
261+ const auto installCheckPath = GetGamePath ();
262+ fprintf (stdout, " Checking installation at %s\n " , PathToUTF8 (installCheckPath).c_str ());
263+ LOGFN (" Checking installation at {}" , PathToUTF8 (installCheckPath));
264+
251265 Journal journal;
252266 double lastProgressMiB = 0.0 ;
253267 double lastTotalMib = 0.0 ;
254- Installer::checkInstallIntegrity (GAME_INSTALL_DIRECTORY , journal, [&]()
268+ Installer::checkInstallIntegrity (installCheckPath , journal, [&]()
255269 {
256270 constexpr double MiBDivisor = 1024.0 * 1024.0 ;
257271 constexpr double MiBProgressThreshold = 128.0 ;
@@ -326,8 +340,16 @@ int main(int argc, char *argv[])
326340
327341 HostStartup ();
328342
343+ const auto gamePath = GetGamePath ();
329344 std::filesystem::path modulePath;
330- bool isGameInstalled = Installer::checkGameInstall (GetGamePath (), modulePath);
345+ LOGFN (" Game path: {}" , PathToUTF8 (gamePath));
346+ bool isGameInstalled = Installer::checkGameInstall (gamePath, modulePath);
347+ LOGFN (" Install status before wizard: installed={}, forceInstaller={}, forceDLCInstaller={}, modulePath={}" ,
348+ isGameInstalled,
349+ forceInstaller,
350+ forceDLCInstaller,
351+ PathToUTF8 (modulePath));
352+
331353 bool runInstallerWizard = forceInstaller || forceDLCInstaller || !isGameInstalled;
332354 if (runInstallerWizard)
333355 {
@@ -337,10 +359,21 @@ int main(int argc, char *argv[])
337359 std::_Exit (1 );
338360 }
339361
340- if (!InstallerWizard::Run (GetGamePath () , isGameInstalled && forceDLCInstaller))
362+ if (!InstallerWizard::Run (gamePath , isGameInstalled && forceDLCInstaller))
341363 {
364+ LOGN (" Installer wizard cancelled." );
342365 std::_Exit (0 );
343366 }
367+
368+ isGameInstalled = Installer::checkGameInstall (gamePath, modulePath);
369+ LOGFN (" Install status after wizard: installed={}, modulePath={}" , isGameInstalled, PathToUTF8 (modulePath));
370+ if (!isGameInstalled)
371+ {
372+ const std::string errorMessage = " The game data installation did not finish correctly. Please run the installer again and select the base game ISO plus update file." ;
373+ LOGN_ERROR (errorMessage);
374+ SDL_ShowSimpleMessageBox (SDL_MESSAGEBOX_ERROR , GameWindow::GetTitle (), errorMessage.c_str (), GameWindow::s_pWindow);
375+ std::_Exit (4 );
376+ }
344377 }
345378
346379 ModLoader::Init ();
@@ -350,7 +383,16 @@ int main(int argc, char *argv[])
350383
351384 KiSystemStartup ();
352385
386+ LOGFN (" Loading module from {}" , PathToUTF8 (modulePath));
353387 uint32_t entry = LdrLoadModule (modulePath);
388+ if (entry == 0 )
389+ {
390+ const std::string errorMessage = " Failed to load the patched game executable. Please run the installer again." ;
391+ LOGN_ERROR (errorMessage);
392+ SDL_ShowSimpleMessageBox (SDL_MESSAGEBOX_ERROR , GameWindow::GetTitle (), errorMessage.c_str (), GameWindow::s_pWindow);
393+ std::_Exit (4 );
394+ }
395+ LOGFN (" Loaded module entry: 0x{:08X}" , entry);
354396
355397 if (!runInstallerWizard)
356398 {
@@ -361,8 +403,10 @@ int main(int argc, char *argv[])
361403 }
362404 }
363405
406+ LOGN (" Starting pipeline precompilation." );
364407 Video::StartPipelinePrecompilation ();
365408
409+ LOGFN (" Starting guest thread at 0x{:08X}" , entry);
366410 GuestThread::Start ({ entry, 0 , 0 });
367411
368412 return 0 ;
0 commit comments