luxtorpeda-dev / luxtorpeda

Steam Play compatibility tool to run games using native Linux engines

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Option to Disable Extraction/Install Step on Each Run

d10sfan opened this issue · comments

Feature Request

The client extracts and "installs" the engine to the game folder each time the game is launched. This is to ensure that the files are always accurate on the system and to avoid having to check for hashes and the like.

There was a request (luxtorpeda-dev/packages#787 (comment)) to look into not having that, instead to install the files once and then stop. I believe this should be an opt-in option, through the config file, as the current mode is less error prone.

Solution

Create a new config.json variable for "disable_install_every_time". If set to true, the client would detect if it had installed files with that name to that app id before. This could be done with a set of config or cache files (maybe ~/.cache/luxtorpeda/<app_id>/installed/file_name.tar.gz). Then if those files do not exist, extract, otherwise hold off.

Then if the user has a problem, they would then need to remove those files to let it extract again. The file names of things that we control generally change on each update, so that should cause it to still download the new engine version after an update.

Additional Context

No response

I remember this issue existing since the very beginning, and one of the reason was: correctly handling package updates (which was non-trivial when some game engines decided to effectively avoid doing any versioning at all).

I considered several options, and ATM I think checking for hashes might be the best solution after all... Perhaps we don't need to store hashes in packages themselves - they could be calculated once after tarball is downloaded and kept in a file in the cache.

Yeah that's a good idea, hashing the downloads as they come in and storing the result in a file, then can check if there's any differences between the hashes found on disk and the ones generated at runtime.

The hash file could be a file with an array of hashes for each app id & choice combination. So then when the game launches again, a new array would be generated of all the hashes used, and if any of them don't match, extract the ones that don't match. So the hash file could be stored in ~/.cache/luxtorpeda/hashes/appid-choice.json. Choice would be there in cases for doom, where someone could pick between gzdoom and other engines for example.

It looks like there's some examples of hashing files in sha: https://github.com/RustCrypto/hashes#hashing-readable-objects.

It'll probably also be a good idea to make this configurable with the config.json file, to allow it to do what it does currently, to extract on each run, but then if enabled, it'd check the hash first and if so, skip the extraction step.

This is implemented in #206

The next release will have it.