Skip to content

qt: Error if installing DLC without game. #1476

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/qt_gui/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,12 @@ void MainWindow::InstallDragDropPkg(std::filesystem::path file, int pkgNum, int
QMessageBox::critical(this, tr("PKG ERROR"), QString::fromStdString(failreason));
return;
}
if (!psf.Open(pkg.sfo)) {
QMessageBox::critical(this, tr("PKG ERROR"),
"Could not read SFO. Check log for details");
return;
}
auto category = psf.GetString("CATEGORY");
InstallDirSelect ids;
ids.exec();
auto game_install_dir = ids.getSelectedDirectory();
Expand All @@ -689,12 +695,6 @@ void MainWindow::InstallDragDropPkg(std::filesystem::path file, int pkgNum, int
QMessageBox msgBox;
msgBox.setWindowTitle(tr("PKG Extraction"));

if (!psf.Open(pkg.sfo)) {
QMessageBox::critical(this, tr("PKG ERROR"),
"Could not read SFO. Check log for details");
return;
}

std::string content_id;
if (auto value = psf.GetString("CONTENT_ID"); value.has_value()) {
content_id = std::string{*value};
Expand All @@ -709,7 +709,6 @@ void MainWindow::InstallDragDropPkg(std::filesystem::path file, int pkgNum, int
QString addonDirPath;
Common::FS::PathToQString(addonDirPath, addon_extract_path);
QDir addon_dir(addonDirPath);
auto category = psf.GetString("CATEGORY");

if (pkgType.contains("PATCH")) {
QString pkg_app_version;
Expand Down Expand Up @@ -802,9 +801,10 @@ void MainWindow::InstallDragDropPkg(std::filesystem::path file, int pkgNum, int
}
} else {
// Do nothing;
if (pkgType.contains("PATCH")) {
QMessageBox::information(this, tr("PKG Extraction"),
tr("PKG is a patch, please install the game first!"));
if (pkgType.contains("PATCH") || category == "ac") {
QMessageBox::information(
this, tr("PKG Extraction"),
tr("PKG is a patch or DLC, please install the game first!"));
return;
}
// what else?
Expand Down
Loading