Hello, I'm creating an updater for my game but when I try to read the ZIP file using the class ZIPReader
it just returns Error.Failed
.
Here's the segment of the code that fails:
const string downloadPath = "user://update.zip";
FileAccess file = FileAccess.Open(downloadPath, FileAccess.ModeFlags.Write);
file.StoreBuffer(body);
GD.Print("Download completed!");
ZIPReader zip = new ZIPReader();
Error openProcess = zip.Open(downloadPath);
if (openProcess != Error.Ok)
{
GD.PrintErr("Can't open the 'update.zip' file!");
GD.PrintErr($"{openProcess.ToString()}");
goto install_failed;
}
I've tried to open the downloaded zip file outside the app and I can open it correctly.