updates bundled dlls if outdated

This commit is contained in:
aomizu
2025-06-08 11:28:35 +09:00
parent 3460969409
commit 90fa1e7677
3 changed files with 57 additions and 1 deletions

View File

@@ -38,6 +38,19 @@ func PatchTurtleWoW(myWindow fyne.Window, updateAllStatuses func()) {
for resourceName, destPath := range filesToCopy {
log.Printf("Processing resource: %s to %s", resourceName, destPath)
// Check if file already exists and has correct size
if utils.PathExists(destPath) && utils.CompareFileWithBundledResource(destPath, resourceName) {
log.Printf("File %s already exists with correct size, skipping copy", destPath)
continue
}
if utils.PathExists(destPath) {
log.Printf("File %s exists but has incorrect size, updating...", destPath)
} else {
log.Printf("File %s does not exist, creating...", destPath)
}
resource, err := fyne.LoadResourceFromPath(resourceName)
if err != nil {
errMsg := fmt.Sprintf("failed to open bundled resource %s: %v", resourceName, err)