File tree 2 files changed +13
-1
lines changed
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ def get_drive(self, letter: str):
32
32
return None
33
33
34
34
def set_drive_path (self , letter : str , path : str ):
35
- """Change a drives path in the bottle"""
35
+ """Change a drive's path in the bottle"""
36
36
letter = f"{ letter } :" .lower ()
37
37
drive_sym_path = os .path .join (self .dosdevices_path , letter )
38
38
if not os .path .exists (self .dosdevices_path ):
Original file line number Diff line number Diff line change 1
1
import os
2
2
import shutil
3
3
import stat
4
+ import string
4
5
import subprocess
5
6
import tempfile
6
7
import shlex
25
26
from bottles .backend .utils .manager import ManagerUtils
26
27
from bottles .backend .utils .terminal import TerminalUtils
27
28
from bottles .backend .utils .steam import SteamUtils
29
+ from bottles .backend .wine .drives import Drives
28
30
29
31
logging = Logger ()
30
32
@@ -606,6 +608,7 @@ def get_cmd(
606
608
command = f"sh '{ pre_script } ' ; { command } "
607
609
608
610
if disc_image is not None :
611
+ # Mount/unmount disc image on temp mount point
609
612
mount_point = "/tmp/bottles/disc"
610
613
command = f"""
611
614
flatpak-spawn --host mkdir -p '{ mount_point } '
@@ -614,6 +617,15 @@ def get_cmd(
614
617
flatpak-spawn --host fusermount -uz '{ mount_point } ' # -z for lazy unmount
615
618
"""
616
619
620
+ # Assign path to first free drive letter
621
+ drives = Drives (self .config )
622
+ alphabet = string .ascii_uppercase
623
+ letter = next (
624
+ c for c in alphabet
625
+ if c >= "D" and not drives .get_drive (c )
626
+ )
627
+ drives .set_drive_path (letter , mount_point )
628
+
617
629
return command
618
630
619
631
def _get_gamescope_cmd (self , return_steam_cmd : bool = False ) -> str :
You can’t perform that action at this time.
0 commit comments