Bottles icon indicating copy to clipboard operation
Bottles copied to clipboard

[Request] A way to mount / unmount CD images when launching a program

Open TiBeN opened this issue 2 years ago • 4 comments

Is your feature request related to a problem? Please describe. I am looking for a way to trigger a CD image mount before launching a program. In Lutris, i used "Pre-launch script" and "post-exist" script with simple bash script to trigger cdemu mounts / unmount. But i have not found a way in bottles to do this kind of thing.

Describe the solution you'd like The best solution would be a cdemu (best cd drive emulator in Linux) integration. Something like a "Mount image" option in Program options.

Describe alternatives you've considered The pre-launch / post-exit launch bash script like in Lutris is a cheaper solution but it works. It's just kind of a pain to have to create sh script file for each installed game only for that.

Additional context Just discovered Bottles yesterday and i found it very promising so i'm planning to migrate from Lutris to Bottles, mainly because i use lutris only as a Wine frontend. I'm a kind of old school gamer, i don't use any game platforms (gog, steam etc.) but my old physical games converted to CD ISO images.

My mount script is as simple as:

#!/bin/bash
cdemu load 0 '<iso-filepath>'
sleep 3
udisksctl mount -b /dev/sr0
sleep 3

It could be better i suppose, but it does not require root.

TiBeN avatar Jan 23 '22 07:01 TiBeN

Related: https://github.com/bottlesdevs/Bottles/issues/948

Keeping the issue for cdemu implementation, thanks for reporting 🙏

mirkobrombin avatar Jan 23 '22 07:01 mirkobrombin

Yeah, it looks like another use case for Pre-launch/Post-exit script feature. CDemu integration would be the most comprehensive solution but i don't know how difficult it could be to implement, especially in a Flatpak context which seems to be very rooted to Bottles.

Thanks for your quick feedback and for the work on Bottles, this tiny tool has the abilty to become the best Wine frontend ihmo.

TiBeN avatar Jan 23 '22 08:01 TiBeN

this tiny tool has the ability to become the best Wine frontend ihmo.

I agree. As someone who recently came from Windows (and will never go back) but loves gaming. Bottles made it easy to get about 75% of my most played games up and running. It's fantastic.

The rest of my 25% games I would like to play either require further WINE/Proton changes by CodeWeavers/Valve/GE or very specific bug fixes here in Bottles which I have been slowly creating tickets for to not overwhelm you.

Keep up the amazing work @mirkobrombin !

WineBottles avatar Jan 23 '22 22:01 WineBottles

Hello a message on the forum lead me to this issue. I think that from January, I can kindly ask if there is any progress on this issue ? I would like to install an official .img USB image of Windows Office 2016 but it seams Bottles only accept .exe files.

Is there any workaround to make my Office working through Bottles ? Thank you very much.

prog-amateur2 avatar May 29 '22 15:05 prog-amateur2

I also would like for this feature to be added.

With Lutris, I could easily specify pre-launch and post-exit scripts to mount and unmount ISOs.

With Bottles, even if I use the command arguments field to run commands prior to launch, I cannot mount ISOs, and using the "post-run script" variable, I cannot unmount them, either.

Flatpaks cannot access most of /usr/bin (not sure why; some executables are visible to Flatpaks despite having the same ownership and permissions as non-visible ones), and even if you use Flatseal to give Bottles full filesystem access, it does not see mount, unmount, cdemu, gnome-disk-image-mounter, etc. in /usr/bin. Even if you add /run/host/usr/bin to the PATH variable (source), these executables will not work because of calls to libraries which are in locations which are inaccessible to Flatpak.

Because there seems to be no way to utilize existing software to mount/unmount CD images, this would have to be something built into Bottles. (Alternatively: provide an installation method besides Flatpak for advanced users who understand the risks of forgoing Flatpak's sandboxing.)

lunalucadou avatar Dec 10 '22 18:12 lunalucadou

It seems Bottles already has an easy enough way to install from ISO disks without any issues.

  1. Create a directory for mounting on Windows Drive C inside Bottles, i.e. 'iso': mkdir iso
  2. Mount ISO as a loopback device with sudo: sudo mount -o loop <PathToISO> iso
  3. Inside Bottles go to Tools > Legacy Wine Tools > Configuration > Drives
  4. Add Drive D or any other letter as CDROM and set the path to /home/<user>/.var/app/com.usebottles.bottles/data/bottles/bottles/<bottle>/drive_c/iso where 'iso' is the directory you mounted ISO into

To unmount, sudo umount iso or restart the computer.

I disagree that this requires a special feature because you can't mount without sudo and automating sudo within the bottle defeats the purpose. Maybe you can visually facelift the legacy tool but that's about it

arthurtaras avatar Jan 31 '23 20:01 arthurtaras

@arthurtarasov, The native Linux mount system is pretty limited compared to a solution like cdemu which supports a lot more image formats (cue/bin, mdf, img, ccd etc.) than simply iso and can handle a lot of protection systems which were common with Windows PC cd-roms (Safedisc, securom) with a true device emulation system. It also correctly handle audio-cds parts commonly used for music in games.

What's more, it is "client/daemon" designed so no "sudo" required.

TiBeN avatar Feb 02 '23 15:02 TiBeN

I was able to run an executable from an .img.

  • I mounted the Office365.img file to /run/media/us-er/16.0.13127.20616. (Gnome files helped mounting without sudo)

  • Then under compatibility settings, I added a drive Y:

    image

    image

The D: drive showed up automatically later, but I was unable to access it via console.

  • Then using command line tool, I navigated to Y:, and found Setup.exe

    image

    image

  • It did launch...

    image

  • But soon ran problem:

    image

Here's the console error messages

Y:\>Setup.exe

Y:\>01bc:err:combase:RoGetActivationFactory Failed to find library for L"Windows.Security.Authentication.OnlineId.OnlineIdSystemAuthenticator"
0180:err:combase:RoGetActivationFactory Failed to find library for L"Windows.Security.Authentication.OnlineId.OnlineIdSystemAuthenticator"
0310:err:combase:RoGetActivationFactory Failed to find library for L"Windows.Security.Authentication.OnlineId.OnlineIdSystemAuthenticator"
0420:err:combase:RoGetActivationFactory Failed to find library for L"Windows.Security.Isolation.IsolatedWindowsEnvironmentHost"
052c:err:ole:create_server class {7d096c5f-ac08-4f1f-beb7-5c22c517ce39} not registered
052c:err:ole:com_get_class_object no class object {7d096c5f-ac08-4f1f-beb7-5c22c517ce39} could be created for context 0x4
052c:err:ole:create_server class {7d096c5f-ac08-4f1f-beb7-5c22c517ce39} not registered
052c:err:ole:com_get_class_object no class object {7d096c5f-ac08-4f1f-beb7-5c22c517ce39} could be created for context 0x4
0428:err:mscoree:LoadLibraryShim error reading registry key for installroot
0428:err:mscoree:LoadLibraryShim error reading registry key for installroot
0428:err:mscoree:LoadLibraryShim error reading registry key for installroot
0428:err:mscoree:LoadLibraryShim error reading registry key for installroot
0428:err:mscoree:LoadLibraryShim error reading registry key for installroot
0428:err:mscoree:LoadLibraryShim error reading registry key for installroot
0428:err:mscoree:LoadLibraryShim error reading registry key for installroot
0428:err:mscoree:LoadLibraryShim error reading registry key for installroot
0428:err:mscoree:LoadLibraryShim error reading registry key for installroot
0428:err:mscoree:LoadLibraryShim error reading registry key for installroot
0428:err:mscoree:LoadLibraryShim error reading registry key for installroot
0428:err:mscoree:LoadLibraryShim error reading registry key for installroot
0428:err:mscoree:LoadLibraryShim error reading registry key for installroot
0428:err:mscoree:LoadLibraryShim error reading registry key for installroot
0428:err:mscoree:LoadLibraryShim error reading registry key for installroot
0428:err:mscoree:LoadLibraryShim error reading registry key for installroot
01d0:err:seh:NtRaiseException Unhandled exception code c0000409 flags 1 addr 0x180065a4e
0698:err:service:process_send_command service protocol error - failed to read pipe r = 0  count = 0!
0670:err:combase:RoGetActivationFactory Failed to find library for L"Windows.Security.Authentication.OnlineId.OnlineIdSystemAuthenticator"

Sure I didn't expect it to run flawlessly, but any pointers to fix these issues would help.

yozachar avatar May 04 '23 15:05 yozachar