Updater not checking for corrupted files fix

- Fixed updater trying to update with corrupt files
- Bumped main.cpp version to correct one 5.0.8
This commit is contained in:
Zarg 2025-01-16 03:26:27 +01:00
parent cc0e10b22f
commit 87764e123b
2 changed files with 10 additions and 2 deletions

View file

@ -4,7 +4,7 @@
## 🚀 Quick Overview
1. Bump version in ``cmakelists``
1. Bump version in ``cmakelists`` and ``APP_VERSION`` in ``main.cpp``
2. Build new ``runtime`` and `installer`
3. Make sure `installer` is in `/utils` and `server.js` in `/utils/windows`
4. Run ``build/build_checksums.js`` this will generate `version.json` and `version-details.json` needed for the auto updater

View file

@ -63,7 +63,7 @@ using namespace Microsoft::WRL;
#define APP_TITLE "Stremio - Freedom to Stream"
#define APP_NAME "Stremio"
#define APP_CLASS L"Stremio"
#define APP_VERSION "5.0.0"
#define APP_VERSION "5.0.8"
static TCHAR szWindowClass[] = APP_NAME;
static TCHAR szTitle[] = APP_TITLE;
@ -2325,6 +2325,10 @@ static void RunAutoUpdaterOnce() {
}
}
if(FileChecksum(installerPath) != expectedChecksum) {
AppendToCrashLog("[UPDATER]: Failed to download. File corrupted: " + installerPath.string());
allDownloadsSuccessful = false;
}
if(allDownloadsSuccessful) {
g_installerPath = installerPath;
@ -2371,6 +2375,10 @@ static void RunAutoUpdaterOnce() {
AppendToCrashLog((L"[UPDATER]: Failed to download " + std::wstring(key.begin(), key.end())).c_str());
} else {
std::cout<<"Downloaded " << key << " successfully.\n";
if(FileChecksum(localFilePath) != expectedChecksum) {
AppendToCrashLog("[UPDATER]: Failed to download. File corrupted: " + localFilePath.string());
continue;
}
// Perform update actions based on the file key
if(key == "server.js") {
StopNodeServer();