protonscr

minor improvement? on CompatData.setup_prefix()

protonopen
ValveSoftware/Proton#8213 · opened 2024-11-03 by ng572 · updated 2024-11-03 · 0 comments · github
Nng572 2024-11-03 github

https://github.com/ValveSoftware/Proton/blob/1a73b04e6cdf29297c6a79a4098ba17e2bf18872/proton#L796

encountered error when launching a game on linux,
might have got an extra slash there and /dosdevices didn't exist for me,
what worked for me was just to add another makedirs:

existing code

            if not file_exists(self.prefix_dir + "/dosdevices/c:", follow_symlinks=False):
                os.symlink("../drive_c", self.prefix_dir + "/dosdevices/c:")

            if not file_exists(self.prefix_dir + "/dosdevices/z:", follow_symlinks=False):
                os.symlink("/", self.prefix_dir + "/dosdevices/z:")

new code

            if not file_exists(self.prefix_dir + "dosdevices/c:", follow_symlinks=False):
                makedirs(self.prefix_dir + "dosdevices")
                os.symlink("../drive_c", self.prefix_dir + "dosdevices/c:")

            if not file_exists(self.prefix_dir + "dosdevices/z:", follow_symlinks=False):
                makedirs(self.prefix_dir + "dosdevices")
                os.symlink("/", self.prefix_dir + "dosdevices/z:")

specs:
Linux devuan 6.1.0-26-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.112-1 (2024-09-30) x86_64 GNU/Linux
launch:
proton-experimental
Town of Salem

Proton versions