diff --git a/Core/Util/GameManager.cpp b/Core/Util/GameManager.cpp index 9e86ada876..f3f9772ea2 100644 --- a/Core/Util/GameManager.cpp +++ b/Core/Util/GameManager.cpp @@ -50,7 +50,6 @@ bool GameManager::DownloadAndInstall(std::string storeZipUrl) { return false; } - // TODO: Android-compatible temp file names std::string filename = GetTempFilename(); curDownload_ = downloader_.StartDownload(storeZipUrl, filename); return true; @@ -152,7 +151,17 @@ void GameManager::InstallGame(std::string zipfile) { return; } - // Now, loop through again, writing files. + // Create all the directories in one pass + for (int i = 0; i < numFiles; i++) { + const char *fn = zip_get_name(z, i, 0); + std::string outFilename = pspGame + fn; + bool isDir = outFilename.back() == '/'; + if (isDir) { + File::CreateFullPath(outFilename.c_str()); + } + } + + // Now, loop through again in a second pass, writing files. for (int i = 0; i < numFiles; i++) { const char *fn = zip_get_name(z, i, 0); // Note that we do NOT write files that are not in a directory, to avoid random diff --git a/UI/Store.cpp b/UI/Store.cpp index 0b8c745db3..d234e3ef8b 100644 --- a/UI/Store.cpp +++ b/UI/Store.cpp @@ -42,8 +42,7 @@ void ProductItemView::Update(const InputState &input_state) { // This is a "details" view of a game. Let's you install it. class ProductView : public UI::LinearLayout { public: - ProductView(const StoreEntry &entry) - : LinearLayout(UI::ORIENT_VERTICAL), entry_(entry), installButton_(0) { + ProductView(const StoreEntry &entry) : LinearLayout(UI::ORIENT_VERTICAL), entry_(entry), installButton_(0) { CreateViews(); } @@ -86,13 +85,13 @@ void ProductView::CreateViews() { void ProductView::Update(const InputState &input_state) { View::Update(input_state); - // TODO: Update progress bar etc. } UI::EventReturn ProductView::OnInstall(UI::EventParams &e) { std::string zipUrl = storeBaseUrl + "files/" + entry_.file + ".zip"; - if (installButton_) + if (installButton_) { installButton_->SetEnabled(false); + } INFO_LOG(HLE, "Triggering install of %s", zipUrl.c_str()); g_GameManager.DownloadAndInstall(zipUrl); return UI::EVENT_DONE;