exoscoriae / eXoDOS

eXoDOS
71 stars 3 forks source link

eXo\Update\update_installed.bat search issue #5355

Closed parricc closed 1 month ago

parricc commented 3 months ago

In eXo\Update\update_installed.bat, a change is necessary to ensure the right games are getting selected by a findstr statement for a couple outlying situations.

Affected games: Games with names in their entirety that are identical to the name ending of another game.

for /F "delims=" %%a in ('findstr /C:"%FileName%" .\Update\index.txt') do set fullindex=%%a should be: for /F "delims=" %%a in ('findstr /C:":%FileName%" .\Update\index.txt') do set fullindex=%%a

What is the change: The : character is added as an anchor to ensure that the correct game text is being pulled from the Update\index.txt file.

Why: This prevents issues when extracting updates for games with names that are identical to the name endings of other games. The batch file pulls the game directory associated with the filename from the retrieved string, and then tests for the existence of that directory to determine if the update zip file should be unzipped or not. If someone has Blood (1997) installed but not Cryptic Passages for Blood (1997) and runs an update, then the script should extract the update zip file for Blood (1997), not the zip file for Cryptic Passages for Blood. This substitution ensures that works correctly.

Note: Nothing in this ticket concerns language packs, and the above change does not affect any lines involving language pack text files. The text files that the language packs use follow a different formatting convention than the equivalent files in the base eXoDOS collection. As such, to eliminate similar situations that could arise for the language packs in the future, their equivalent findstr lines would need to be handled differently. A discussion would also need to happen with Timber before implementing any language pack changes to ensure that all language packs are and will continue to follow the same file formatting convention that the GLP currently is using.

exoscoriae commented 2 months ago

approved

parricc commented 1 month ago

Reopening as I've finally gotten clarification from Timber involving the language packs.

eXo\Update\update_installed.bat needs the following language pack related substitution: for /F "delims=" %%a in ('findstr /C:"%FileName%" .\Update\%lang%index.txt') do set fullindex=%%a should have the : as well: for /F "delims=" %%a in ('findstr /C:":%FileName%" .\Update\%lang%index.txt') do set fullindex=%%a

Timber has confirmed eXo\Update\%lang%index.txt is the correct location for the lang index file. GLP 1.0 did not have functional updates, but that is the location that will be used for future releases.

exoscoriae commented 1 month ago

change made