Skip to content

Auto-extract ZIP ROMs after download#1

Merged
derekprior merged 4 commits intomainfrom
zip-extraction
Feb 7, 2026
Merged

Auto-extract ZIP ROMs after download#1
derekprior merged 4 commits intomainfrom
zip-extraction

Conversation

@derekprior
Copy link
Owner

Add zip extraction module using minizip/zlib. After downloading a ROM whose fs_name ends in .zip, automatically extract all files to the same directory with an Extracting... progress bar, then delete the zip file.

Update the file-exists check so that for zip ROMs, it scans the target directory for any file matching the stem (filename without .zip extension) rather than requiring an exact match.

Generalize ui_draw_download_progress to ui_draw_progress with a configurable label parameter.

Add zip extraction module using minizip/zlib. After downloading a
ROM whose fs_name ends in .zip, automatically extract all files to
the same directory with an Extracting... progress bar, then delete
the zip file.

Update the file-exists check so that for zip ROMs, it scans the
target directory for any file matching the stem (filename without
.zip extension) rather than requiring an exact match.

Generalize ui_draw_download_progress to ui_draw_progress with a
configurable label parameter.
- Reject zip entries containing '..' to prevent path traversal (Zip Slip)
- Remove partial files on extraction failure or cancellation
- Clean up zip file when extraction fails in both download paths
Merge download_progress and extract_progress into a single
progress_callback that uses a static progressLabel string.
Simplify extract_if_zip to derive the destination directory
from the zip path instead of requiring callers to build it.
- Comment the progressLabel/downloadName globals to explain the
  set-before-use pattern for progress callbacks
- Add path length validation in zip_extract to skip entries that
  would overflow the destination path buffer
@derekprior derekprior merged commit b02d352 into main Feb 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant