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

Multiple exes within an appimage #18

Closed
Blad3forc3 opened this issue Feb 26, 2023 · 34 comments
Closed

Multiple exes within an appimage #18

Blad3forc3 opened this issue Feb 26, 2023 · 34 comments

Comments

@Blad3forc3
Copy link

What is the best way to run an appimage with multiple exes inside?
For instance there is a menu that pops up as the default exe that then has 5 options (5 different exes to run) when selected but when running the launcher within the appimage and selecting one of any 5 these dont run.

@ruanformigoni
Copy link
Owner

Hi @Blad3forc3, you can select the file that is executed by default with:

./my-cool-game.AppImage --gameimage-cmd='{wine} {appd}/path/to/my/exec'

Next time you click or run through the terminal, It'll execute the selected exe. More info about it here.

@Blad3forc3
Copy link
Author

Blad3forc3 commented Feb 27, 2023 via email

@Blad3forc3
Copy link
Author

A follow up to this. If a game has a launcher executable and you select an option to run another executable then this just doesnt run.

As an example house of the dead 3 requires you to run a launcher exe in the top directory to actually run the main games executable but as the executable resides in a bin folder the game fails to run. The main game executable will not run directly

@Blad3forc3
Copy link
Author

Any update on this Ruan? I have a few appimages that refuse to run because they require to be run from a launcher which then executes another exe within the game dir but wont run directly

@ruanformigoni
Copy link
Owner

Yes, I'm working on an optional launcher, which also includes a tray icon for you to know the application is running.

@Blad3forc3
Copy link
Author

Blad3forc3 commented Apr 6, 2023 via email

@ruanformigoni
Copy link
Owner

A preview of how it is going:

screenshot-165

Would this solve your issue?

@Blad3forc3
Copy link
Author

Not sure. The problem is caused by not being able to run certain executables directly. Some have a launcher that needs to be run and then the launcher runs the executable after. At this point in a created appimage it fails for some reason because the launcher runs but when it calls the different exe (the one that won't run directly) to run the actual game the appimage fails

@Blad3forc3
Copy link
Author

Blad3forc3 commented Apr 30, 2023

I'm having great success building wine appimages but i am still getting quite a few that demand a launcher to run then hook another executable to run another exe within the appimage for the main game. Looking at the above method you posted I would only be able to run the launcher still and unless things have changed whilst running the launcher within the appimage, the appimage would fail when the launcher executable hooks the main exe to initiate the actual game.

As an example try this game within an appimage for wine

https://www.myabandonware.com/game/toca-championship-racing-a4t

The rip version. It will run the menu but fail when the launcher tries to inject the main exe within the appimage

Try to run tourcars.exe and it will error saying you cant run it directly and to run setup.exe which will run but when you start the main program from it within the appimage it will just silently fail to load

@ruanformigoni
Copy link
Owner

Hi @Blad3forc3, this might be a 'working directory' issue, here's an test build of the launcher release if you want to try it out. I'll look into this issue on the referred game. Thanks for the feedback!

@Blad3forc3
Copy link
Author

Hi Ruan.

I have tried your test build with a clean prefix etc. and the setup runs but when you select play it still fails

@Blad3forc3
Copy link
Author

Any update on this? I have tried the latest game image and a game that requires a launcher to run which then calls an exe to run the actual game (which can't be run directly) still fails on a built appimage

@ruanformigoni
Copy link
Owner

Hi @Blad3forc3 , not yet. I'm a bit busy this last couple of months, will come back to this whenever possible.

@Blad3forc3
Copy link
Author

Hi Ruan, Is there any update on this?
I have tried your latest gameimage and if the game requires you to run a launcher but then automatically hooks the main executable the appimage will fail.

@ruanformigoni
Copy link
Owner

Hi @Blad3forc3 , I have tried to reproduce this issue a bit. Here's what I got:

  • I installed toca with win98 compatibility
  • No dxvk and no vkd3d
  • Installed dgvoodoo2
  • Run setup.exe
  • Click in play (the game opened)
  • I packaged the game on an AppImage and set the setup.exe launcher as the default .exe
  • When I run the image it shows the launcher, I press play, it tries to open, but crashes with CPYRIGHT.BMP could not be loaded (it was trying from the original install path, instead of the appimage one).

Is this the issue that your are facing?

@Blad3forc3
Copy link
Author

Blad3forc3 commented Nov 11, 2023 via email

@ruanformigoni
Copy link
Owner

ruanformigoni commented Nov 11, 2023

I managed to make it work as a portable AppImage with an external prefix

  • Export the package type as prefix
    export GIMG_PKG_TYPE=prefix
    
  • Start with a fresh prefix (erase build/AppDir/app/wine or the entire build directory)
  • Fetch tools
  • Run configure phase to initialize the wine prefix
  • Select win32
  • Do not install dxvk nor vkd3d
  • Run wine winecfg and select windows98 compatibility mode
  • Type continue to finish the configure phase
  • Exit the program with continue or with Ctrl + D
  • Copy the install folder to inside build/AppDir/app/wine/drive_c
  • Export the install folder location as an extra rom dir, inside drive_c
    # Execute this command in the same folder as the rom and icon folders
    export GIMG_DIR_ROM_EXTRA="\"$(pwd)/build/AppDir/app/wine/drive_c/tourcar\""
    
  • Re-execute gameimage and open the install phase
  • Install the game from inside the drive_c path, drive_c/tourcar/setup.exe
  • Drop the dgvoodoo2 D3DImm.dll and DDraw.dll on the installed folder, drive_c/Codemast/TourCar/
  • Re-execute the configure phase and run wine winecfg
  • Add the native overrides for d3dimm and ddraw in winecfg
  • Build and use drive_c/Codemast/TourCar/setup.exe and the default .exe

That should do it, however now you have to backup both the appimage and the prefix. It should work with other package methods besides prefix, but my guess is that it does not due to this issue.

@Blad3forc3
Copy link
Author

Blad3forc3 commented Nov 11, 2023 via email

@ruanformigoni
Copy link
Owner

Does it have info about the error on the terminal, or in a pop-up window?

@Blad3forc3
Copy link
Author

Blad3forc3 commented Nov 11, 2023 via email

@ruanformigoni
Copy link
Owner

ruanformigoni commented Nov 11, 2023

That is odd, I've re-created the steps again and it worked. Maybe it's an nvidia or glibc issue. Does it work outside the appimage?

Try to kill all wine stuff with pkill -f ".*\.exe"

Try to do this on the build directory:

export WINE="$(pwd)/build/AppDir/usr/bin/wine"
export WINEPREFIX="$(pwd)/build/.toca.AppImage.config/wine"
cd $WINEPREFIX/drive_c/Codemast/TourCar
"$WINE" setup.exe

Also, try to disable the launcher to check if the issue with glibc goes away GIMG_LAUNCHER_DISABLE=1 ./toca.AppImage

@Blad3forc3
Copy link
Author

The glibc error does go away if i execute GIMG_LAUNCHER_DISABLE=1

I may have not followed your directions correctly at his particular line.

Export the install folder location as an extra rom dir, inside drive_c

Execute this command in the same folder as the rom and icon folders

export GIMG_DIR_ROM_EXTRA=""$(pwd)/build/AppDir/app/wine/drive_c/tourcar""

IS this command executed inside the drive_c folder within the wine prefix or in the same folder as the rom and icon folders?

@ruanformigoni
Copy link
Owner

ruanformigoni commented Nov 11, 2023

You should run this command in the same folder with the build, rom, icon folders. Try to leave the rom folder empty, then it'll only show the files inside the extra folder. Also if you have installed the .exe from the rom folder, create the prefix again and start over the steps (with a new prefix).

Remember to erase build/.toca.AppImage.config

@Blad3forc3
Copy link
Author

Not having any luck here. Most of the time it crashes after the first video and sometimes it gets to the title screen just before the menu then crashes

@ruanformigoni
Copy link
Owner

Could you try this one ?

@Blad3forc3
Copy link
Author

Thanks ruan. Yes this does work here too.

I don't want to ask but i have a cd image mounted of the game and could you do a step by step on how to do it from the start? I'd like to install the game from the cd image because with your appimage it will only let you select a link game not a solo game. Probably something to do with it being a rip?
Also if you could i could also try a few other games this way that refuse to start
Thanks

@ruanformigoni
Copy link
Owner

Good to know that it worked! I just tried the dvd. It works, but there is only the linkup option as well. There are other people with this issue in the link, I tried to simulate mounting the cd with cdemu, it did not fix the issue, even when I ran the setup.exe inside the cdemu mount.

@ruanformigoni
Copy link
Owner

Fixed it!

Screenshot_20231111_153004

I included the path that cdemu mounted the image with:

export GIMG_DIR_ROM_EXTRA="\"/run/media/ruan/TOURING_CAR\""

And ran the installer from there. Now, everytime the game launches, I'll look for the files in the drive it was installed from, in my case it was "I:". So one needs to make sure to mount the image and configure use to use the correct letter for it. That could be done in a script, I believe you've tried something like this before in #3

@Blad3forc3
Copy link
Author

Blad3forc3 commented Nov 11, 2023 via email

@ruanformigoni
Copy link
Owner

ruanformigoni commented Nov 11, 2023

I'll try to streamline this process, so you would mark a checkbox that you'd like to mount an image every time wine appimage is started (and select the path to where it is). I'll also try automate the installation of dgvoodoo2, so you can just install it as with dxvk and vkd3d. Ideally this should suffice to simplify this process.

Some other notes here:

  • dxvk is required, otherwise there are rendering bugs.
  • One should copy dgVoodooCpl.exe to the drive_c/Codemast/TourCar/ install folder, so it is possible to configure its options even after packaging.

@Blad3forc3
Copy link
Author

Blad3forc3 commented Nov 11, 2023 via email

@ruanformigoni
Copy link
Owner

The fix here was of two issues.

  • export GIMG_PKG_TYPE=prefix that you mentioned, resolves some issues with case sensitive paths.
  • The other was to install the game from within a path accessible to wine, that being either drive_c ("C:/") or another drive, that should re-appear when you want to run the game (in my case I always require to mount the image in "I:/").

That is what I'll try to do, to include the iso in the AppImage and automatically mount it to a fixed letter (both on install and after packaging). That way the game will find the required files in the "cd" drive. One interesting thing is that I managed to make it work without cdemu as well, one less dependency to use. I can just create a drive in wine that points to a folder (of extracted iso contents) or use fuseiso to mount it.

@Blad3forc3
Copy link
Author

"One interesting thing is that I managed to make it work without cdemu as well, one less dependency to use. I can just create a drive in wine that points to a folder (of extracted iso contents) or use fuseiso to mount it"

Some older games have a data layer and a cd audio layer. These images are generally stored as cue/bin files. The game Touring Cars is a good example of this. If you just extract the data to a folder you will lose the cd audio if you mount that as the cd drive for the game.

just a FYI

@ruanformigoni
Copy link
Owner

Closing this issue as it refers to #53.

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

2 participants