1
0
Fork 0
mirror of synced 2024-06-27 18:51:06 +12:00

Create directory for Wine prefixes at launch

This commit is contained in:
Dummerle 2021-11-09 22:48:00 +01:00
parent c99fd4761d
commit 6c99b369be
No known key found for this signature in database
GPG key ID: AB68CC59CA39F2F1

View file

@ -121,6 +121,24 @@ class GameUtils(QObject):
full_env.update(params.environment)
for env, value in full_env.items():
environment.insert(env, value)
if platform.system() != "Windows":
for env in ["STEAM_COMPAT_DATA_PATH", "WINEPREFIX"]:
if val := full_env.get(env):
if not os.path.exists(val):
try:
os.makedirs(val)
except PermissionError as e:
logger.error(str(e))
if QMessageBox.question(None, "Error",
self.tr(
"Error while launching {}. No permission to create {} for {}\nLaunch anyway?").format(
game.app_title, val, env),
buttons=QMessageBox.Yes | QMessageBox.No,
defaultButton=QMessageBox.Yes) == QMessageBox.No:
process.deleteLater()
return
process.setProcessEnvironment(environment)
process.game_finished.connect(self.game_finished)
running_game = RunningGameModel(process=process, app_name=app_name)