Skip to content
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

launch_configs Only Work After Restart for Games with requires Statement #5258

Open
manuth opened this issue Jan 20, 2024 · 2 comments
Open

Comments

@manuth
Copy link

manuth commented Jan 20, 2024

I was trying to create a custom installer for a game from Epic Games Store.
However, when launching the game, the dialogue for choosing the launch config does not show up.

Here is a (not so) minimal example of this happening:

Installer Source
files:
- shim:
    filename: shim.zip
    url: https://github.com/kiennq/scoop-better-shimexe/releases/download/v3.0/shimexe.zip
game:
  args: ''
  exe: $GAMEDIR/drive_c/Program Files/Epic Games/KH_1.5_2.5/launch.vbs
  launch_configs:
  - args: KINGDOM HEARTS FINAL MIX.exe
    exe: $GAMEDIR/drive_c/Program Files/Epic Games/KH_1.5_2.5/launch.vbs
    name: Kingdom Hearts Final Mix
installer:
- task:
    args: -opengl -SkipBuildPatchPrereq -com.epicgames.launcher://apps/68c214c58f694ae88c2dab6f209b43e4?action=install
    description: The Epic Game Store will now open. Please launch the installation
      of KINGDOM HEARTS HD 1.5+2.5 ReMIX then close the EGS client once the game has
      been downloaded.
    executable: $GAMEDIR/drive_c/Program Files (x86)/Epic Games/Launcher/Portal/Binaries/Win32/EpicGamesLauncher.exe
    name: wineexec
    prefix: $GAMEDIR
- task:
    app: wsh57 vcrun6
    description: Installing Windows Scripting requirements...
    name: winetricks
    silent: true
- move:
    dst: $GAMEDIR/drive_c/Program Files/Epic Games/KH_1.5_2.5/KINGDOM HEARTS HD 1.5+2.5
      ReMIX.bak.exe
    src: $GAMEDIR/drive_c/Program Files/Epic Games/KH_1.5_2.5/KINGDOM HEARTS HD 1.5+2.5
      ReMIX.exe
- extract:
    dst: $CACHE/shim
    file: shim
- copy:
    dst: $GAMEDIR/drive_c/Program Files/Epic Games/KH_1.5_2.5
    src: $CACHE/shim/shim.exe
- move:
    dst: $GAMEDIR/drive_c/Program Files/Epic Games/KH_1.5_2.5/KINGDOM HEARTS HD 1.5+2.5
      ReMIX.exe
    src: $GAMEDIR/drive_c/Program Files/Epic Games/KH_1.5_2.5/shim.exe
- write_file:
    content: 'Set fso = CreateObject("Scripting.FileSystemObject")

      scriptDir = fso.GetParentFolderName(WScript.ScriptFullName)

      appFileName = fso.BuildPath(scriptDir, "app.txt")


      If fso.FileExists(appFileName) Then

      fso.DeleteFile(appFileName)

      End If


      If WScript.Arguments.Count > 0 Then

      Set appFile = fso.CreateTextFile(appFileName)

      appFile.Write(WScript.Arguments(0))

      appFile.Close

      End If


      WScript.CreateObject("WScript.Shell").Run("""C:\Program Files (x86)\Epic Games\Launcher\Portal\Binaries\Win32\EpicGamesLauncher.exe""
      -opengl -SkipBuildPatchPrereq -com.epicgames.launcher://apps/68c214c58f694ae88c2dab6f209b43e4?action=launch")'
    file: $GAMEDIR/drive_c/Program Files/Epic Games/KH_1.5_2.5/launch.vbs
- write_file:
    content: 'Dim args, gameFile, scriptDir, entryPoint

      Set fso = CreateObject("Scripting.FileSystemObject")

      args = ""

      gameFile = ""

      scriptDir = fso.GetParentFolderName(WScript.ScriptFullName)

      appFileName = fso.BuildPath(scriptDir, "app.txt")

      If fso.FileExists(appFileName) Then

      Set appFile = fso.OpenTextFile(appFileName, 1)

      gameFile = Trim(appFile.ReadAll())

      appFile.Close

      fso.DeleteFile(appFileName)

      Else

      gameFile = "KINGDOM HEARTS HD 1.5+2.5 ReMIX.bak.exe"

      End If

      For i=0 To WScript.Arguments.Count - 1

      args = args & " " & WScript.Arguments(i)

      Next

      entryPoint = fso.BuildPath(scriptDir, gameFile)

      WScript.CreateObject("WScript.Shell").Run("""" & entryPoint & """" & args)'
    file: $GAMEDIR/drive_c/Program Files/Epic Games/KH_1.5_2.5/run.vbs
- write_file:
    content: 'path = wscript.exe

      args = "C:\Program Files\Epic Games\KH_1.5_2.5\run.vbs"'
    file: $GAMEDIR/drive_c/Program Files/Epic Games/KH_1.5_2.5/KINGDOM HEARTS HD 1.5+2.5
      ReMIX.shim
requires: epic-games-store

Expected Behavior

The dialog for choosing between the main config and "Kingdom Hearts Final Mix" should appear.

Actual Behavior

The main exe is launched.

@manuth
Copy link
Author

manuth commented Jan 21, 2024

Can't really tell why but after trying it again 1h later (using the Test Installer feature of the Lutris website) it worked.

However, after uninstalling it (Right click on game, "Remove") and hitting 'Test Installer' again, it showed the undesired behavior again.

@manuth manuth closed this as completed Jan 21, 2024
@manuth manuth reopened this Jan 21, 2024
@manuth
Copy link
Author

manuth commented Jan 21, 2024

I have noticed that it seems to work once you have restarted Lutris.
However - when installing the game and launching it right after the installation, the undesired behavior occurs.

@manuth manuth changed the title Use of launch_configs Does Not Work for Games with requires Statement launch_configs Only Work After Restart for Games with requires Statement Jan 22, 2024
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

No branches or pull requests

1 participant