Skip to content

Commit 3362e6e

Browse files
committed
winecommand: mount/unmount content in temp location
1 parent 3282715 commit 3362e6e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

bottles/backend/wine/winecommand.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def __init__(
100100
pre_script: Optional[str] = None,
101101
post_script: Optional[str] = None,
102102
cwd: Optional[str] = None,
103+
disc_image: Optional[str] = None,
103104
):
104105
_environment = environment.copy()
105106
self.config = self._get_config(config)
@@ -113,7 +114,7 @@ def __init__(
113114
else self.config.Parameters.gamescope
114115
)
115116
self.command = self.get_cmd(
116-
command, pre_script, post_script, environment=_environment
117+
command, pre_script, post_script, disc_image, environment=_environment
117118
)
118119
self.terminal = terminal
119120
self.env = self.get_env(_environment)
@@ -489,6 +490,7 @@ def get_cmd(
489490
command,
490491
pre_script: Optional[str] = None,
491492
post_script: Optional[str] = None,
493+
disc_image: Optional[str] = None,
492494
return_steam_cmd: bool = False,
493495
return_clean_cmd: bool = False,
494496
environment: Optional[dict] = None,
@@ -602,6 +604,15 @@ def get_cmd(
602604

603605
if pre_script not in (None, ""):
604606
command = f"sh '{pre_script}' ; {command}"
607+
608+
if disc_image is not None:
609+
mount_point = "/tmp/bottles/disc"
610+
command = f"""
611+
flatpak-spawn --host mkdir -p '{mount_point}'
612+
flatpak-spawn --host fuseiso '{disc_image}' '{mount_point}'
613+
{command}
614+
flatpak-spawn --host fusermount -uz '{mount_point}' # -z for lazy unmount
615+
"""
605616

606617
return command
607618

0 commit comments

Comments
 (0)