@@ -892,7 +892,7 @@ bool main_window::InstallPackages(QStringList file_paths, bool from_boot)
892892 // Install rap files if available
893893 int installed_rap_and_edat_count = 0 ;
894894
895- const auto install_filetype = [&installed_rap_and_edat_count, &file_paths](const std::string extension)
895+ const auto install_filetype = [this , &installed_rap_and_edat_count, &file_paths](const std::string extension)
896896 {
897897 const QString pattern = QString (" .*\\ .%1" ).arg (QString::fromStdString (extension));
898898 for (const QString& file : file_paths.filter (QRegularExpression (pattern, QRegularExpression::PatternOption::CaseInsensitiveOption)))
@@ -902,6 +902,13 @@ bool main_window::InstallPackages(QStringList file_paths, bool from_boot)
902902
903903 if (InstallFileInExData (extension, file, filename))
904904 {
905+ if (filename == last_rap_file_needed_for_pkg)
906+ {
907+ file_paths.append (last_pkg_path_postponed_due_to_missing_rap);
908+ last_rap_file_needed_for_pkg = {};
909+ last_pkg_path_postponed_due_to_missing_rap = {};
910+ }
911+
905912 gui_log.success (" Successfully copied %s file: %s" , extension, filename);
906913 installed_rap_and_edat_count++;
907914 }
@@ -1005,10 +1012,6 @@ bool main_window::HandlePackageInstallation(QStringList file_paths, bool from_bo
10051012 }
10061013 gui_log.notice (" About to install packages:\n %s" , fmt::merge (path_vec, " \n " ));
10071014
1008- progress_dialog pdlg (tr (" RPCS3 Package Installer" ), tr (" Installing package, please wait..." ), tr (" Cancel" ), 0 , 1000 , false , this );
1009- pdlg.setAutoClose (false );
1010- pdlg.show ();
1011-
10121015 package_install_result result = {};
10131016
10141017 auto get_app_info = [](compat::package_info& package)
@@ -1047,6 +1050,53 @@ bool main_window::HandlePackageInstallation(QStringList file_paths, bool from_bo
10471050 readers.emplace_back (info.path .toStdString ());
10481051 }
10491052
1053+ std::string missing_licenses;
1054+ std::string missing_licenses_short;
1055+
1056+ for (const auto & reader : readers)
1057+ {
1058+ if (std::string filepath = reader.gep_needed_rap_file_path (); !filepath.empty () && fs::is_file (filepath))
1059+ {
1060+ missing_licenses += filepath;
1061+ missing_licenses += " \n " ;
1062+
1063+ if (std::count (missing_licenses_short.begin (), missing_licenses_short.end (), ' \n ' ) < 5 )
1064+ {
1065+ missing_licenses_short += std::string_view (filepath).substr (filepath.find_last_of (fs::delim) + 1 );
1066+ missing_licenses_short += " \n " ;
1067+ }
1068+ }
1069+ }
1070+
1071+ if (!missing_licenses.empty ())
1072+ {
1073+ gui_log.fatal (" Failed to locate the game license file(s):\n %s"
1074+ " \n Ensure the .rap license file is placed in the dev_hdd0/home/%s/exdata folder with a lowercase file extension."
1075+ " \n If you need assistance on dumping the license file from your PS3, read our quickstart guide: https://rpcs3.net/quickstart" , missing_licenses, Emu.GetUsr ());
1076+
1077+ QString error = tr (" Failed to locate the game license file(s):\n\n %1\n Ensure the .rap license file(s) are placed in the dev_hdd0 folder with a lowercase file extension." ).arg (QString::fromStdString (missing_licenses_short));
1078+
1079+ QMessageBox* mb = new QMessageBox (QMessageBox::Warning, tr (" PKG Installer: Missing License(s) For PKG(s)" ), error, QMessageBox::Ok, this , Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint | Qt::WindowStaysOnTopHint);
1080+ mb->setAttribute (Qt::WA_DeleteOnClose);
1081+ mb->open ();
1082+
1083+ if (readers.size () == 1 )
1084+ {
1085+ last_pkg_path_postponed_due_to_missing_rap = packages[0 ].path ;
1086+ missing_licenses_short.pop_back (); // Remove newline
1087+ last_rap_file_needed_for_pkg = QString::fromStdString (missing_licenses_short);
1088+ }
1089+
1090+ return false ;
1091+ }
1092+
1093+ last_pkg_path_postponed_due_to_missing_rap = {};
1094+ last_rap_file_needed_for_pkg = {};
1095+
1096+ progress_dialog pdlg (tr (" RPCS3 Package Installer" ), tr (" Installing package, please wait..." ), tr (" Cancel" ), 0 , 1000 , false , this );
1097+ pdlg.setAutoClose (false );
1098+ pdlg.show ();
1099+
10501100 std::deque<std::string> bootable_paths;
10511101
10521102 // Run PKG unpacking asynchronously
0 commit comments