Skip to content

Commit

Permalink
Merge pull request #191 from mateusfavarin/main
Browse files Browse the repository at this point in the history
Fix launcher bios read
  • Loading branch information
mateusfavarin authored Jul 21, 2024
2 parents 88cce47 + 62d5dcc commit e5b8fa1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/Launcher/updater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ bool Updater::IsValidBios(const std::string& path)
{
std::vector<char> v;
IO::ReadBinaryFile(v, path);
return v.size() == static_cast<size_t>(0x100000);
return v.size() == static_cast<size_t>(0x80000);
}

bool Updater::CheckForUpdates(std::string& status, const std::string& currVersion)
Expand All @@ -36,7 +36,7 @@ bool Updater::CheckForUpdates(std::string& status, const std::string& currVersio
{
std::string version;
Requests::CheckUpdates(version);
if (currVersion != version)
if (currVersion != version || !std::filesystem::exists(GetPatchedGamePath(currVersion)))
{
m_updateAvailable = true;
m_versionAvailable = version;
Expand All @@ -57,7 +57,7 @@ bool Updater::Update(std::string& status, std::string& currVersion, const std::s
status = "Downloading Duckstation...";
std::filesystem::create_directory(g_duckFolder);
const std::string duckArchive = "duckstation.zip";
if (!Requests::DownloadFile("github.com", "/stenzek/duckstation/releases/download/latest/duckstation-windows-x64-release.zip", g_duckFolder + duckArchive))
if (!Requests::DownloadFile("github.com", "/stenzek/duckstation/releases/download/preview/duckstation-windows-x64-release.zip", g_duckFolder + duckArchive))
{
status = "Error: could not download Duckstation.";
return false;
Expand Down Expand Up @@ -90,7 +90,7 @@ bool Updater::Update(std::string& status, std::string& currVersion, const std::s
status = "Checking for new updates...";
if (m_updateAvailable || Requests::CheckUpdates(version))
{
if (m_updateAvailable || version != currVersion)
if (m_updateAvailable || version != currVersion || !std::filesystem::exists(GetPatchedGamePath(currVersion)))
{
m_versionAvailable = m_updateAvailable ? m_versionAvailable : version;
std::string path = g_dataFolder + m_versionAvailable + "/";
Expand Down

0 comments on commit e5b8fa1

Please sign in to comment.