Skip to content

Commit

Permalink
Merge pull request #621 from GB609/bugfix/605
Browse files Browse the repository at this point in the history
Fix extract_by_wine when PC has optical drive
  • Loading branch information
sharkwouter authored Nov 28, 2024
2 parents c10d697 + 40c0a11 commit 130ce00
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
**1.3.2**
- Fix issue with windows install via wine on systems with optical drives (thanks to GB609)

**1.3.1**
- Fix Windows games with multiple parts not installing with wine
- Minor AppData fixes (thanks to tim77)
Expand Down
12 changes: 10 additions & 2 deletions minigalaxy/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,13 @@ def extract_by_wine(game, installer, temp_dir):
err_msg = ""
# Set the prefix for Windows games
prefix_dir = os.path.join(game.install_dir, "prefix")
drive = os.path.join(prefix_dir, "dosdevices", "d:")
"""pick a letter that is unlikely to create collisions with the actual mount/hw setup:
wine creates links for mounted media and optical drives
this might lead to errors because wine knows 2 names for these - d: and d::
(difference: : exposes directory, :: exposes the block device itself)
But they can't exist at the same time within a prefix.
Changing this letter is a temporary fix, the entire install method requires an overhaul in the long run"""
drive = os.path.join(prefix_dir, "dosdevices", "t:")
if not os.path.exists(prefix_dir):
os.makedirs(prefix_dir, mode=0o755)
# Creating the prefix before modifying dosdevices
Expand All @@ -201,7 +207,9 @@ def extract_by_wine(game, installer, temp_dir):
stdout, stderr, exitcode = _exe_cmd(command)
if exitcode not in [0]:
err_msg = _("Wine extraction failed.")
else:
elif os.path.exists(drive):
"""check for existence as a pure safety-measure in case
some power-user has pre-configured the letter we picked with double colon"""
os.unlink(drive)
os.symlink("../../..", drive)
return err_msg
Expand Down

0 comments on commit 130ce00

Please sign in to comment.