proton: Add runinprefix verb for running a program in a running session
CW-Bug-Id: 16785
This commit is contained in:
parent
ec9bf7f85d
commit
f632b693bd
1 changed files with 6 additions and 3 deletions
9
proton
9
proton
|
@ -694,7 +694,7 @@ class Session:
|
|||
except (OSError, IOError, TypeError, KeyError):
|
||||
pass
|
||||
|
||||
def init_session(self):
|
||||
def init_session(self, update_prefix_files):
|
||||
self.env["WINEPREFIX"] = g_compatdata.prefix_dir
|
||||
|
||||
#load environment overrides
|
||||
|
@ -812,7 +812,8 @@ class Session:
|
|||
else:
|
||||
self.env["WINEDEBUG"] = "-all"
|
||||
|
||||
g_compatdata.setup_prefix()
|
||||
if update_prefix_files:
|
||||
g_compatdata.setup_prefix()
|
||||
|
||||
if "nod3d11" in self.compat_config:
|
||||
self.dlloverrides["d3d11"] = ""
|
||||
|
@ -983,7 +984,7 @@ if __name__ == "__main__":
|
|||
if g_proton.missing_default_prefix():
|
||||
g_proton.make_default_prefix()
|
||||
|
||||
g_session.init_session()
|
||||
g_session.init_session(sys.argv[1] != "runinprefix")
|
||||
|
||||
#determine mode
|
||||
if sys.argv[1] == "run":
|
||||
|
@ -994,6 +995,8 @@ if __name__ == "__main__":
|
|||
g_session.run_proc([g_proton.wineserver_bin, "-w"])
|
||||
#then run
|
||||
g_session.run()
|
||||
elif sys.argv[1] == "runinprefix":
|
||||
g_session.run_proc([g_proton.wine_bin] + sys.argv[2:])
|
||||
elif sys.argv[1] == "getcompatpath":
|
||||
#linux -> windows path
|
||||
path = subprocess.check_output([g_proton.wine_bin, "winepath", "-w", sys.argv[2]], env=g_session.env, stderr=g_session.log_file)
|
||||
|
|
Loading…
Reference in a new issue