-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wine-GE: Match launcher naming schemes on extract #296
Conversation
Thanks!
I think that is fine. There probably is some way to do that with tarfile but is seems the solution you choose is way more clean.
Good idea. Having that would probably also simplify adding new launchers or allow for different ways of detecting the launcher in case we would need that in the future. |
I'll take a look at adding a util function for getting the Launcher type from the install_dir. What's our minimum Python version these days? If it's >= 3.10 we could use a |
Okay, I created a new util function called Usage is like this, but I need to do further testing on it so this is just an example: # Returns a new Enum, DataStructure#Launcher
launcher = get_launcher_from_installdir(install_dir) # i.e. /home/gaben/.local/share/lutris/runners
if launcher == Launcher.STEAM:
print('No good, it's full of Steam!')
elif launcher == Launcher.LUTRIS:
print('Remember winesteam?')
elif launcher == Launcher.HEROIC:
print('When did I get so many GOG games...')
elif launcher == Launcher.BOTTLES:
print('Tamika approves') We could easily extend this in future for, say, PlayOnLinux by adding another launcher to the A match statement might be slightly cleaner in my personal opinion, but I'm not sure if they're faster or anything, so it isn't a huge deal. If we could use it though it might be a nice little bit of syntax sugar :-) |
Great, thanks.
I agree that a
Ah, that makes sense.
Looks good.
Good, that saves us quite some manual work then |
I think leaving as-is is fine for now, we can revisit in future like you said. I was just curious :-) Thanks for explaining |
I should note that I'm testing this right now, but having weird difficulties with GitHub when trying to download (also happens when trying to leave comments and push commits), but in the couple of tests I've done so far, this PR appears to still work as expected with the new refactor :-) I will also need to test the ctmods I updated to use the new util function (DXVK, D8VK, vkd3d) |
Tested DXVK and vkd3d-proton, both work as expected. D8VK is broken as the main branch has not had any commits in so long that all artifacts have expired for that branch (https://github.com/AlpyneDreams/d8vk/actions?query=branch%3Amain). Removing the check in the D8VK ctmod's D8VK does have releases now that we could fall back to, but if the main branch got a commit right after I posted this comment, it would start working again. There is a PR to merge D8VK into DXVK (doitsujin/dxvk#3411), but it's a work-in-progress at the moment, so it may be worth adding a "normal" D8VK ctmod (since the current one is "nightly"). I haven't had the time yet (hence the lack of PRs here 😅) but at some point I would like to make a "common" DXVK ctmod similar to what we have for Proton-tkg. Until then we could probably just have a separate ctmod for a non-nightly D8VK. That is, entirely, a separate issue to this PR though, as this behaviour is also on master :-) |
I made two changes to the code:
Looks very good and will be merged. Thanks.
Right, that could be fixed if the merger of D8VK is delayed.
I see, currently only DXVK Async is based on the DXVK ctmod. Seems like D8VK is using the same release format as DXVK so this seems quite trivial to do. There's no hurry 😄 One thing I noticed is that the function |
Thanks for the updates! They make sense.
Yup and that's due for a refactor with #302, though it still uses the subclass format. I structured DXVK in that PR to be compatible with both GitHub and GitLab, and tried to keep in mind It should be pretty straightforward still to make the subclass for D8VK, as that PR's refactor is structured in such a way that the implementation of how we download should be irrelevant to the subclasses. I'll probably look at it after that PR though in case there are further refactors needed to how we handle sessions. I am not sure yet how we will handle DXVK Nightly, perhaps we can just override some methods, I haven't looked too deeply yet :-)
This makes sense, that way ctmods are more aware of launcher information. Then we can check on the Should be feasible either way, just a bit of work, though I think using Thanks! |
Implements #294.
Overview
This adds an extra step to Wine-GE installation which renames the extraction folder to be consistent with what the current launcher would name it.
Screenshots for Lutris and Heroic respectively:
![image](https://private-user-images.githubusercontent.com/7917345/274955725-1914ad86-0c45-4738-94ab-728871002226.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwOTQyMzYsIm5iZiI6MTczOTA5MzkzNiwicGF0aCI6Ii83OTE3MzQ1LzI3NDk1NTcyNS0xOTE0YWQ4Ni0wYzQ1LTQ3MzgtOTRhYi03Mjg4NzEwMDIyMjYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LU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A6GnEXdm53xutfPaoZg)
Implementation
We currently keep the name of the top-level archive (
lutris-GE-ProtonX-YY-x86_64
), but Lutris and Heroic do not use this name. For Lutris specifically, this apparently breaks auto-updating. For Heroic, I figured if we're making a change to be consistent for one launcher (Lutris) we should do it for all of them :-)The launcher check is similar to what we use for DXVK (and elsewhere I believe), essentially checking for strong clues in the path to infer the launcher.
I am not sure what Bottles uses, as I don't use it, but if we need to make a change there it should be easy enough to add.
I could not see a straightforward way to set the extract name for the top-level folder with
tarfile
, it seems the general idea for that is read and extract each file into a specific folder, which I thought was overkill. I think it is more straightforward to just rename the folder after extraction is finished, though this does mean the folder name will not be updated until extraction completes (could be about 10 seconds or more). I doubt any users would see this, though.Considerations
I'm thinking since we've re-used this snippet quite a bit that it could be its own utility function, probably taking
install_dir
and returning an enum value so we could do a check likeif get_launcher_from_install_dir(install_dir) == Launchers.HEROIC
. We do some checks like this already, checking on strings withinstall_loc.get('launcher')
, but in ctmods we just pass downinstall_dir
. Though we could allow theseinstall_loc
checks to use the enum as well, it may be slightly nicer than checking directly on the string 🙂Not really a big deal either way though, just a thought I had during development that I wanted to share.
Thanks!