Ensure that the cached version of MCC is refreshed every update (#2760)

fixes #2758

this happened because we added sentry in a future release, but the cache was using an old executable, so it couldn't find the assembly.
This commit is contained in:
breadbyte 2024-07-14 01:46:43 +08:00 committed by GitHub
parent c50b360eae
commit ca966a464c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -94,7 +94,15 @@ namespace MinecraftClient.Scripting.DynamicRun.Builder
{
if (file.EndsWith("mcc-executable"))
{
useExisting = true;
// Check if the file is the same as the current executable.
if (File.ReadAllBytes(file).SequenceEqual(File.ReadAllBytes(executablePath)))
{
useExisting = true;
break;
}
// If not, refresh the cache.
File.Delete(file);
break;
}
}