Skip to content

Conversation

@rienafairefr
Copy link

like discussed in issue #6155 : I think this variable would be useful to make installer scripts 'more portable', it makes Lutris aware of where the script is, so it can use it.
This is a prototype usage :

game_slug: nice-game
slug: nice-game
name: Nice Game
runner: wine
version: 1.0.0
script:
  game:
    arch: win32
    exe: $GAMEDIR/drive_c/Games/Game/Launcher.exe
    prefix: $GAMEDIR
  installer:
    - task:
        name: create_prefix
        prefix: $GAMEDIR   
    - task:
        executable: setup.exe
        working_dir: $INSTALLERDIR
        name: wineexec
        prefix: $GAMEDIR

@rienafairefr rienafairefr force-pushed the installscriptdir branch 2 times, most recently from c94b7aa to 258f5ef Compare May 31, 2025 15:31
@danieljohnson2
Copy link
Contributor

Boy this seems like a lot of change to add one variable.

And script.script["script"] rubs me the wrong way every time. Think we have enough script? We might need more script!

@rienafairefr
Copy link
Author

rienafairefr commented Jun 1, 2025

I think capturing the installer_file in get_installers and then using it afterwards was the cleanest way (the other ways I thought would have even more changes), but maybe there is is a better way I didn't see.

I agree script.script["script"] is really really repetitive ^^ I just pushed a rename to data for that element, so it becomes installer.data["script"] instead, a bit less vomit-inducing

@danieljohnson2
Copy link
Contributor

I see what you are doing here: wrapping the dict we get from a YML or JSON file in a very basic data-class.

I'm not unsympathetic, and in Java I would absolutely do this. But this is Python where everything is very dynamic and rather casual compared to Java.

Passing around dicts for 'just data' is very conventional in dynamic languages like Python, and Lutris does it routinely.

Besides, your Installer class is rather a lot like the existing LutrisInstaller. I'm not comfortable having both.

I only merge bug-fixes, so this will have to wait for Maximum Leader. But I think this would be rejected in its current state.

I suggest what you could do instead is add a key-value pair to the installer dict yourself, with a distinguished name like "_lutris_installer_file" or something like that. It's not the kind of rigorous name-spacing you could have with separated classes, but it's good enough and should mean a lot less code churn.

@rienafairefr rienafairefr force-pushed the installscriptdir branch 3 times, most recently from a1aba0a to b96ef1a Compare June 6, 2025 20:17
@rienafairefr
Copy link
Author

You're right that a key-value pair for passing through that information is way easier on the code changes, I pushed that code up 👍

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.

2 participants