fraganator / archive-cache-manager

A LaunchBox plugin which extracts and caches large ROM archives, letting you play games faster.
GNU Lesser General Public License v2.1
11 stars 5 forks source link

Detect game launch failure and cleanup #6

Open fraganator opened 3 years ago

fraganator commented 3 years ago

There's no LaunchBox plugin callback to indicate a game wasn't launched (startup cancelled, 7z error, ROM missing, etc). This plugin relies on the GameStarted method to restore the original 7z.exe, but it currently isn't restored on launch failure..

If the original 7z isn't restored, then a file list performed (when selecting an individual ROM to play), the incorrect file list is returned. It will have any configured file extension priority applied, and will be missing the first item (removed, as the original 7z.exe output lists the archive file, then the file contents).

Two approaches to the above - try detect a game launch error and act on it. Perhaps watch for an error dialog from LaunchBox.

The other approach is to always assume there may have been some error, and restore 7z always, or at least call 7-zip.exe instead of 7z.exe.