2018-10-05 18:51:21 +03:00
|
|
|
#!/usr/bin/env python3
|
2018-01-18 23:00:48 +03:00
|
|
|
|
|
|
|
#script to launch Wine with the correct environment
|
|
|
|
|
2018-08-24 10:18:36 +03:00
|
|
|
from __future__ import print_function
|
|
|
|
|
2019-06-27 22:49:29 +03:00
|
|
|
import fcntl
|
|
|
|
import array
|
2018-01-19 20:03:54 +03:00
|
|
|
import filecmp
|
2018-01-18 23:00:48 +03:00
|
|
|
import json
|
|
|
|
import os
|
|
|
|
import shutil
|
2019-02-01 02:02:36 +03:00
|
|
|
import errno
|
2018-02-15 17:49:56 +03:00
|
|
|
import struct
|
2018-01-18 23:00:48 +03:00
|
|
|
import subprocess
|
|
|
|
import sys
|
2018-01-19 20:03:54 +03:00
|
|
|
import tarfile
|
2018-01-18 23:00:48 +03:00
|
|
|
|
2018-10-24 22:22:22 +03:00
|
|
|
from filelock import FileLock
|
2018-03-16 18:08:29 +03:00
|
|
|
|
2018-06-21 17:09:10 +03:00
|
|
|
#To enable debug logging, copy "user_settings.sample.py" to "user_settings.py"
|
|
|
|
#and edit it if needed.
|
2018-03-16 19:02:04 +03:00
|
|
|
|
2019-06-19 17:31:09 +03:00
|
|
|
CURRENT_PREFIX_VERSION="4.11-1"
|
2018-02-15 21:53:47 +03:00
|
|
|
|
2018-01-18 23:00:48 +03:00
|
|
|
PFX="Proton: "
|
2018-10-11 16:50:23 +03:00
|
|
|
ld_path_var = "LD_LIBRARY_PATH"
|
2018-03-06 21:13:24 +03:00
|
|
|
|
2019-02-05 17:08:13 +03:00
|
|
|
def nonzero(s):
|
|
|
|
return len(s) > 0 and s != "0"
|
|
|
|
|
2018-01-18 23:00:48 +03:00
|
|
|
def log(msg):
|
2018-03-13 17:57:35 +03:00
|
|
|
sys.stderr.write(PFX + msg + os.linesep)
|
|
|
|
sys.stderr.flush()
|
2018-02-15 21:53:47 +03:00
|
|
|
|
2018-10-09 18:33:41 +03:00
|
|
|
def remove_tracked_files(prefix):
|
|
|
|
if not os.path.exists(prefix + "/tracked_files"):
|
|
|
|
log("Prefix has no tracked_files??")
|
|
|
|
return
|
|
|
|
|
|
|
|
with open(prefix + "/tracked_files", "r") as tracked_files:
|
|
|
|
dirs = []
|
|
|
|
for f in tracked_files:
|
|
|
|
path = prefix + "/pfx/" + f.strip()
|
|
|
|
if os.path.exists(path):
|
|
|
|
if os.path.isfile(path) or os.path.islink(path):
|
|
|
|
os.remove(path)
|
|
|
|
else:
|
|
|
|
dirs.append(path)
|
|
|
|
for d in dirs:
|
|
|
|
try:
|
|
|
|
os.rmdir(d)
|
|
|
|
except OSError:
|
|
|
|
#not empty
|
|
|
|
pass
|
|
|
|
|
|
|
|
os.remove(prefix + "/tracked_files")
|
|
|
|
os.remove(prefix + "/version")
|
|
|
|
|
2019-04-08 22:27:31 +03:00
|
|
|
def file_is_wine_fake_dll(path):
|
|
|
|
if not os.path.exists(path):
|
|
|
|
return False
|
|
|
|
try:
|
|
|
|
sfile = open(path, "rb")
|
|
|
|
sfile.seek(0x40)
|
|
|
|
tag = sfile.read(20)
|
|
|
|
return tag == b"Wine placeholder DLL"
|
|
|
|
except IOError:
|
|
|
|
return False
|
|
|
|
|
2018-02-15 21:53:47 +03:00
|
|
|
def upgrade_pfx(old_ver):
|
|
|
|
if old_ver == CURRENT_PREFIX_VERSION:
|
|
|
|
return
|
2018-08-23 17:01:32 +03:00
|
|
|
|
2018-04-20 18:11:19 +03:00
|
|
|
log("Upgrading prefix from " + str(old_ver) + " to " + CURRENT_PREFIX_VERSION + " (" + os.environ["STEAM_COMPAT_DATA_PATH"] + ")")
|
2018-08-23 17:42:18 +03:00
|
|
|
|
2018-10-24 22:22:22 +03:00
|
|
|
if old_ver is None:
|
2018-08-23 17:42:18 +03:00
|
|
|
return
|
|
|
|
|
2018-11-30 18:24:43 +03:00
|
|
|
if not '-' in old_ver:
|
|
|
|
#How can this happen??
|
|
|
|
log("Prefix has an invalid version?! You may want to back up user files and delete this prefix.")
|
|
|
|
#If it does, just let the Wine upgrade happen and hope it works...
|
2018-10-09 18:33:41 +03:00
|
|
|
return
|
2018-08-23 17:01:32 +03:00
|
|
|
|
2018-11-30 18:24:43 +03:00
|
|
|
try:
|
|
|
|
old_proton_ver, old_prefix_ver = old_ver.split('-')
|
|
|
|
old_proton_maj, old_proton_min = old_proton_ver.split('.')
|
|
|
|
new_proton_ver, new_prefix_ver = CURRENT_PREFIX_VERSION.split('-')
|
|
|
|
new_proton_maj, new_proton_min = new_proton_ver.split('.')
|
|
|
|
|
|
|
|
if int(new_proton_maj) < int(old_proton_maj) or \
|
|
|
|
(int(new_proton_maj) == int(old_proton_maj) and \
|
|
|
|
int(new_proton_min) < int(old_proton_min)):
|
|
|
|
log("Removing newer prefix")
|
|
|
|
if old_proton_ver == "3.7" and not os.path.exists(os.environ["STEAM_COMPAT_DATA_PATH"] + "/tracked_files"):
|
|
|
|
#proton 3.7 did not generate tracked_files, so copy it into place first
|
2019-07-29 18:49:26 +03:00
|
|
|
try_copy(g_proton.path("proton_3.7_tracked_files"), os.environ["STEAM_COMPAT_DATA_PATH"] + "/tracked_files")
|
2018-11-30 18:24:43 +03:00
|
|
|
remove_tracked_files(os.environ["STEAM_COMPAT_DATA_PATH"])
|
2018-10-09 18:33:41 +03:00
|
|
|
return
|
2018-01-18 23:00:48 +03:00
|
|
|
|
2018-11-30 18:24:43 +03:00
|
|
|
if old_proton_ver == "3.7" and old_prefix_ver == "1":
|
|
|
|
if not os.path.exists(prefix + "/drive_c/windows/syswow64/kernel32.dll"):
|
|
|
|
#shipped a busted 64-bit-only installation on 20180822. detect and wipe clean
|
|
|
|
log("Detected broken 64-bit-only installation, re-creating prefix.")
|
|
|
|
shutil.rmtree(prefix)
|
|
|
|
return
|
|
|
|
|
2019-04-08 22:27:31 +03:00
|
|
|
#replace broken .NET installations with wine-mono support
|
|
|
|
if os.path.exists(prefix + "/drive_c/windows/Microsoft.NET/NETFXRepair.exe") and \
|
|
|
|
file_is_wine_fake_dll(prefix + "/drive_c/windows/system32/mscoree.dll"):
|
|
|
|
log("Broken .NET installation detected, switching to wine-mono.")
|
|
|
|
#deleting this directory allows wine-mono to work
|
|
|
|
shutil.rmtree(prefix + "/drive_c/windows/Microsoft.NET")
|
|
|
|
|
2018-11-30 18:24:43 +03:00
|
|
|
except ValueError:
|
|
|
|
log("Prefix has an invalid version?! You may want to back up user files and delete this prefix.")
|
|
|
|
#Just let the Wine upgrade happen and hope it works...
|
|
|
|
return
|
|
|
|
|
2018-01-19 22:03:51 +03:00
|
|
|
def run_wine(args):
|
2019-04-05 23:43:44 +03:00
|
|
|
subprocess.call(args, env=env, stderr=lfile, stdout=lfile)
|
2018-01-19 22:03:51 +03:00
|
|
|
|
2018-01-23 17:03:43 +03:00
|
|
|
def makedirs(path):
|
|
|
|
try:
|
|
|
|
os.makedirs(path)
|
2018-10-11 16:50:23 +03:00
|
|
|
except OSError:
|
2018-01-23 17:03:43 +03:00
|
|
|
#already exists
|
|
|
|
pass
|
|
|
|
|
2019-02-01 02:02:36 +03:00
|
|
|
def try_copy(src, dst):
|
|
|
|
try:
|
2019-07-11 23:09:20 +03:00
|
|
|
if os.path.isdir(dst):
|
|
|
|
dstfile = dst + "/" + os.path.basename(src)
|
|
|
|
if os.path.lexists(dstfile):
|
|
|
|
os.remove(dstfile)
|
|
|
|
elif os.path.lexists(dst):
|
|
|
|
os.remove(dst)
|
2019-02-01 02:02:36 +03:00
|
|
|
shutil.copy(src, dst)
|
|
|
|
except PermissionError as e:
|
|
|
|
if e.errno == errno.EPERM:
|
|
|
|
#be forgiving about permissions errors; if it's a real problem, things will explode later anyway
|
|
|
|
log('Error while copying to \"' + dst + '\": ' + e.strerror)
|
|
|
|
else:
|
|
|
|
raise
|
|
|
|
|
2018-07-20 16:26:15 +03:00
|
|
|
def real_copy(src, dst):
|
|
|
|
if os.path.islink(src):
|
|
|
|
os.symlink(os.readlink(src), dst)
|
|
|
|
else:
|
2019-02-01 02:02:36 +03:00
|
|
|
try_copy(src, dst)
|
2018-07-20 16:26:15 +03:00
|
|
|
|
2018-10-09 18:33:41 +03:00
|
|
|
def mergedirs(src, dst, tracked_files):
|
2018-07-20 16:26:15 +03:00
|
|
|
for src_dir, dirs, files in os.walk(src):
|
2018-10-09 18:33:41 +03:00
|
|
|
rel_dir = src_dir.replace(src, "", 1).lstrip('/')
|
|
|
|
if len(rel_dir) > 0:
|
|
|
|
rel_dir = rel_dir + "/"
|
2018-07-20 16:26:15 +03:00
|
|
|
dst_dir = src_dir.replace(src, dst, 1)
|
|
|
|
if not os.path.exists(dst_dir):
|
|
|
|
os.makedirs(dst_dir)
|
2018-10-09 18:33:41 +03:00
|
|
|
tracked_files.write(rel_dir + "\n")
|
2018-07-20 16:26:15 +03:00
|
|
|
for dir_ in dirs:
|
|
|
|
src_file = os.path.join(src_dir, dir_)
|
|
|
|
dst_file = os.path.join(dst_dir, dir_)
|
|
|
|
if os.path.islink(src_file) and not os.path.exists(dst_file):
|
|
|
|
real_copy(src_file, dst_file)
|
|
|
|
for file_ in files:
|
|
|
|
src_file = os.path.join(src_dir, file_)
|
|
|
|
dst_file = os.path.join(dst_dir, file_)
|
|
|
|
if not os.path.exists(dst_file):
|
|
|
|
real_copy(src_file, dst_file)
|
2018-10-09 18:33:41 +03:00
|
|
|
tracked_files.write(rel_dir + file_ + "\n")
|
2018-07-20 16:26:15 +03:00
|
|
|
|
2019-07-29 18:49:26 +03:00
|
|
|
class Proton:
|
|
|
|
def __init__(self, base_dir):
|
|
|
|
self.base_dir = base_dir + "/"
|
|
|
|
self.dist_dir = self.path("dist/")
|
|
|
|
self.bin_dir = self.path("dist/bin/")
|
|
|
|
self.lib_dir = self.path("dist/lib/")
|
|
|
|
self.lib64_dir = self.path("dist/lib64/")
|
|
|
|
self.fonts_dir = self.path("dist/share/fonts/")
|
|
|
|
self.version_file = self.path("version")
|
|
|
|
self.default_pfx_dir = self.path("dist/share/default_pfx/")
|
|
|
|
self.user_settings_file = self.path("user_settings.py")
|
|
|
|
self.wine_bin = self.bin_dir + "wine"
|
|
|
|
self.wineserver_bin = self.bin_dir + "wineserver"
|
|
|
|
self.dist_lock = FileLock(self.path("dist.lock"), timeout=-1)
|
|
|
|
|
|
|
|
def path(self, d):
|
|
|
|
return self.base_dir + d
|
|
|
|
|
2018-10-24 22:22:22 +03:00
|
|
|
if not "STEAM_COMPAT_DATA_PATH" in os.environ:
|
2018-01-18 23:00:48 +03:00
|
|
|
log("No compat data path?")
|
|
|
|
sys.exit(1)
|
|
|
|
|
2019-07-29 18:49:26 +03:00
|
|
|
g_proton = Proton(os.path.dirname(sys.argv[0]))
|
2018-01-18 23:00:48 +03:00
|
|
|
|
2018-01-19 20:03:54 +03:00
|
|
|
#extract if needed
|
2019-07-29 18:49:26 +03:00
|
|
|
with g_proton.dist_lock:
|
|
|
|
if not os.path.exists(g_proton.dist_dir) or \
|
|
|
|
not os.path.exists(g_proton.path("dist/version")) or \
|
|
|
|
not filecmp.cmp(g_proton.version_file, g_proton.path("dist/version")):
|
|
|
|
if os.path.exists(g_proton.dist_dir):
|
|
|
|
shutil.rmtree(g_proton.dist_dir)
|
|
|
|
tar = tarfile.open(g_proton.path("proton_dist.tar.gz"), mode="r:gz")
|
|
|
|
tar.extractall(path=g_proton.dist_dir)
|
2018-03-16 18:08:29 +03:00
|
|
|
tar.close()
|
2019-07-29 18:49:26 +03:00
|
|
|
try_copy(g_proton.version_file, g_proton.dist_dir)
|
2018-01-19 20:03:54 +03:00
|
|
|
|
2018-01-18 23:00:48 +03:00
|
|
|
env = dict(os.environ)
|
2019-07-15 16:15:58 +03:00
|
|
|
dlloverrides = {
|
|
|
|
"steam.exe": "b", #always use our special built-in steam.exe
|
|
|
|
"mfplay": "n" #disable built-in mfplay
|
|
|
|
}
|
2018-01-18 23:00:48 +03:00
|
|
|
|
2019-02-05 17:06:03 +03:00
|
|
|
if "HOST_LC_ALL" in env and len(env["HOST_LC_ALL"]) > 0:
|
|
|
|
#steam sets LC_ALL=C to help some games, but Wine requires the real value
|
|
|
|
#in order to do path conversion between win32 and host. steam sets
|
|
|
|
#HOST_LC_ALL to allow us to use the real value.
|
|
|
|
env["LC_ALL"] = env["HOST_LC_ALL"]
|
|
|
|
else:
|
|
|
|
env.pop("LC_ALL", "")
|
|
|
|
|
2018-06-21 17:09:10 +03:00
|
|
|
#for performance, logging is disabled by default; override with user_settings.py
|
|
|
|
env["DXVK_LOG_LEVEL"] = "none"
|
|
|
|
env["WINEDEBUG"] = "-all"
|
2018-08-22 18:11:30 +03:00
|
|
|
env.pop("WINEARCH", "")
|
2018-05-11 15:14:04 +03:00
|
|
|
|
2018-03-06 21:13:24 +03:00
|
|
|
if ld_path_var in os.environ:
|
2019-07-29 18:49:26 +03:00
|
|
|
env[ld_path_var] = g_proton.lib64_dir + ":" + g_proton.lib_dir + ":" + os.environ[ld_path_var]
|
2018-01-18 23:00:48 +03:00
|
|
|
else:
|
2019-07-29 18:49:26 +03:00
|
|
|
env[ld_path_var] = g_proton.lib64_dir + ":" + g_proton.lib_dir
|
2018-02-14 22:59:35 +03:00
|
|
|
|
2019-07-29 18:49:26 +03:00
|
|
|
env["WINEDLLPATH"] = g_proton.lib64_dir + "/wine:" + g_proton.lib_dir + "/wine"
|
2018-02-14 22:59:35 +03:00
|
|
|
|
|
|
|
if "PATH" in os.environ:
|
2019-07-29 18:49:26 +03:00
|
|
|
env["PATH"] = g_proton.bin_dir + ":" + os.environ["PATH"]
|
2018-02-14 22:59:35 +03:00
|
|
|
else:
|
2019-07-29 18:49:26 +03:00
|
|
|
env["PATH"] = g_proton.bin_dir
|
2018-01-18 23:00:48 +03:00
|
|
|
|
2019-07-29 18:49:26 +03:00
|
|
|
with g_proton.dist_lock:
|
|
|
|
if not os.path.isdir(g_proton.default_pfx_dir):
|
2018-03-16 18:08:29 +03:00
|
|
|
#make default prefix
|
2019-07-29 18:49:26 +03:00
|
|
|
env["WINEPREFIX"] = g_proton.default_pfx_dir
|
|
|
|
run_wine([g_proton.wine_bin, "wineboot"])
|
|
|
|
run_wine([g_proton.wineserver_bin, "-w"])
|
2018-01-25 22:22:24 +03:00
|
|
|
|
|
|
|
prefix = os.environ["STEAM_COMPAT_DATA_PATH"] + "/pfx/"
|
|
|
|
env["WINEPREFIX"] = prefix
|
2018-01-18 23:00:48 +03:00
|
|
|
|
2019-02-05 17:08:13 +03:00
|
|
|
if "PROTON_LOG" in env and nonzero(env["PROTON_LOG"]):
|
2019-05-13 18:05:32 +03:00
|
|
|
env["WINEDEBUG"] = "+timestamp,+pid,+tid,+seh,+debugstr,+loaddll,+mscoree"
|
2019-04-09 16:51:22 +03:00
|
|
|
env["DXVK_LOG_LEVEL"] = "info"
|
|
|
|
env["WINE_MONO_TRACE"] = "E:System.NotImplementedException"
|
2018-08-22 22:43:40 +03:00
|
|
|
|
2019-04-05 23:43:25 +03:00
|
|
|
#default wine-mono override for FNA games
|
|
|
|
env["WINE_MONO_OVERRIDES"] = "Microsoft.Xna.Framework.*,Gac=n"
|
|
|
|
|
2018-06-21 17:09:10 +03:00
|
|
|
#load environment overrides
|
2019-07-29 18:49:26 +03:00
|
|
|
if os.path.exists(g_proton.user_settings_file):
|
2018-07-11 21:44:52 +03:00
|
|
|
try:
|
|
|
|
import user_settings
|
|
|
|
env.update(user_settings.user_settings)
|
2018-10-24 22:22:22 +03:00
|
|
|
except:
|
2018-07-11 21:44:52 +03:00
|
|
|
log("************************************************")
|
|
|
|
log("THERE IS AN ERROR IN YOUR user_settings.py FILE:")
|
|
|
|
log("%s" % sys.exc_info()[1])
|
|
|
|
log("************************************************")
|
2018-06-21 17:09:10 +03:00
|
|
|
|
|
|
|
def check_environment(env_name, config_name):
|
|
|
|
if not env_name in env:
|
2018-10-15 19:40:33 +03:00
|
|
|
return False
|
2019-02-05 17:08:13 +03:00
|
|
|
if nonzero(env[env_name]):
|
2018-06-21 17:09:10 +03:00
|
|
|
config_opts.add(config_name)
|
2019-02-05 17:08:13 +03:00
|
|
|
else:
|
|
|
|
config_opts.discard(config_name)
|
2018-10-15 19:40:33 +03:00
|
|
|
return True
|
2018-06-21 17:09:10 +03:00
|
|
|
|
|
|
|
if "STEAM_COMPAT_CONFIG" in os.environ:
|
|
|
|
config_opts = set(os.environ["STEAM_COMPAT_CONFIG"].split(","))
|
|
|
|
else:
|
|
|
|
config_opts = set()
|
|
|
|
|
2018-10-15 19:40:33 +03:00
|
|
|
if "wined3d11" in config_opts:
|
|
|
|
config_opts.add("wined3d")
|
|
|
|
|
|
|
|
if not check_environment("PROTON_USE_WINED3D", "wined3d"):
|
|
|
|
check_environment("PROTON_USE_WINED3D11", "wined3d")
|
2019-06-18 18:01:06 +03:00
|
|
|
check_environment("PROTON_USE_D9VK", "d9vk")
|
2018-06-21 17:09:10 +03:00
|
|
|
check_environment("PROTON_NO_D3D11", "nod3d11")
|
2018-12-19 02:49:36 +03:00
|
|
|
check_environment("PROTON_NO_D3D10", "nod3d10")
|
2018-06-21 17:09:10 +03:00
|
|
|
check_environment("PROTON_NO_ESYNC", "noesync")
|
2019-07-08 16:26:45 +03:00
|
|
|
check_environment("PROTON_NO_FSYNC", "nofsync")
|
2018-12-17 19:25:19 +03:00
|
|
|
check_environment("PROTON_FORCE_LARGE_ADDRESS_AWARE", "forcelgadd")
|
2019-01-21 22:23:57 +03:00
|
|
|
check_environment("PROTON_OLD_GL_STRING", "oldglstr")
|
2018-06-21 17:09:10 +03:00
|
|
|
|
|
|
|
if not "noesync" in config_opts:
|
|
|
|
env["WINEESYNC"] = "1"
|
2019-01-21 22:23:57 +03:00
|
|
|
|
2019-07-08 16:26:45 +03:00
|
|
|
if not "nofsync" in config_opts:
|
|
|
|
env["WINEFSYNC"] = "1"
|
|
|
|
|
2019-01-21 22:23:57 +03:00
|
|
|
if "oldglstr" in config_opts:
|
|
|
|
#mesa override
|
|
|
|
env["MESA_EXTENSION_MAX_YEAR"] = "2003"
|
|
|
|
#nvidia override
|
|
|
|
env["__GL_ExtensionStringVersion"] = "17700"
|
2018-06-21 17:09:10 +03:00
|
|
|
|
2018-12-17 19:25:19 +03:00
|
|
|
if "forcelgadd" in config_opts:
|
|
|
|
#forcelgadd should be used just for testing whether a game is helped by
|
|
|
|
#setting LARGE_ADDRESS_AWARE. If it does, then add an AppDefault in the
|
|
|
|
#registry, so that it doesn't impact every executable in the prefix.
|
|
|
|
env["WINE_LARGE_ADDRESS_AWARE"] = "1"
|
|
|
|
|
2018-06-21 17:09:10 +03:00
|
|
|
lfile = None
|
2018-06-27 15:42:10 +03:00
|
|
|
if "SteamGameId" in env:
|
|
|
|
if env["WINEDEBUG"] != "-all":
|
|
|
|
lfile_path = os.environ["HOME"] + "/steam-" + os.environ["SteamGameId"] + ".log"
|
|
|
|
if os.path.exists(lfile_path):
|
|
|
|
os.remove(lfile_path)
|
|
|
|
lfile = open(lfile_path, "w+")
|
2018-12-21 01:00:01 +03:00
|
|
|
lfile.write("======================\n")
|
2019-07-29 18:49:26 +03:00
|
|
|
with open(g_proton.version_file, "r") as f:
|
2018-12-21 01:00:01 +03:00
|
|
|
lfile.write("Proton: " + f.readline().strip() + "\n")
|
|
|
|
lfile.write("SteamGameId: " + env["SteamGameId"] + "\n")
|
|
|
|
lfile.write("Command: " + str(sys.argv[2:]) + "\n")
|
2019-06-18 21:30:12 +03:00
|
|
|
lfile.write("Options: " + str(config_opts) + "\n")
|
2018-12-21 01:00:01 +03:00
|
|
|
lfile.write("======================\n")
|
|
|
|
lfile.flush()
|
2018-06-27 15:42:10 +03:00
|
|
|
else:
|
|
|
|
env["WINEDEBUG"] = "-all"
|
2018-06-21 17:09:10 +03:00
|
|
|
|
2018-10-12 14:20:49 +03:00
|
|
|
def create_fonts_symlinks(prefix_path):
|
|
|
|
fontsmap = [
|
|
|
|
( "LiberationSans-Regular.ttf", "arial.ttf" ),
|
|
|
|
( "LiberationSans-Bold.ttf", "arialbd.ttf" ),
|
|
|
|
( "LiberationSerif-Regular.ttf", "times.ttf" ),
|
|
|
|
( "LiberationMono-Regular.ttf", "cour.ttf" ),
|
|
|
|
]
|
|
|
|
|
|
|
|
windowsfonts = prefix_path + "/drive_c/windows/Fonts"
|
2018-11-30 17:55:08 +03:00
|
|
|
makedirs(windowsfonts)
|
2018-10-12 14:20:49 +03:00
|
|
|
for p in fontsmap:
|
|
|
|
lname = os.path.join(windowsfonts, p[1])
|
2019-07-29 18:49:26 +03:00
|
|
|
fname = os.path.join(g_proton.fonts_dir, p[0])
|
2018-10-12 14:20:49 +03:00
|
|
|
if os.path.lexists(lname):
|
|
|
|
if os.path.islink(lname):
|
|
|
|
os.remove(lname)
|
|
|
|
os.symlink(fname, lname)
|
|
|
|
else:
|
|
|
|
os.symlink(fname, lname)
|
|
|
|
|
2019-06-27 22:49:29 +03:00
|
|
|
EXT2_IOC_GETFLAGS = 0x80086601
|
|
|
|
EXT2_IOC_SETFLAGS = 0x40086602
|
|
|
|
|
|
|
|
EXT4_CASEFOLD_FL = 0x40000000
|
|
|
|
|
|
|
|
def set_dir_casefold_bit(dir_path):
|
|
|
|
dr = os.open(dir_path, 0o644)
|
|
|
|
if dr < 0:
|
|
|
|
return
|
|
|
|
try:
|
|
|
|
dat = array.array('I', [0])
|
|
|
|
if fcntl.ioctl(dr, EXT2_IOC_GETFLAGS, dat, True) >= 0:
|
|
|
|
dat[0] = dat[0] | EXT4_CASEFOLD_FL
|
|
|
|
fcntl.ioctl(dr, EXT2_IOC_SETFLAGS, dat, False)
|
|
|
|
except OSError:
|
|
|
|
#no problem
|
|
|
|
pass
|
|
|
|
os.close(dr)
|
|
|
|
|
2018-03-16 18:39:04 +03:00
|
|
|
prefix_lock = FileLock(os.environ["STEAM_COMPAT_DATA_PATH"] + "/pfx.lock", timeout=-1)
|
|
|
|
with prefix_lock:
|
|
|
|
version_file = os.environ["STEAM_COMPAT_DATA_PATH"] + "/version"
|
|
|
|
if os.path.exists(version_file):
|
|
|
|
with open(version_file, "r") as f:
|
|
|
|
upgrade_pfx(f.readline().strip())
|
|
|
|
else:
|
|
|
|
upgrade_pfx(None)
|
|
|
|
|
2019-06-27 22:49:29 +03:00
|
|
|
if not os.path.exists(prefix):
|
|
|
|
makedirs(prefix + "/drive_c")
|
|
|
|
set_dir_casefold_bit(prefix + "/drive_c")
|
|
|
|
|
2018-08-23 17:01:32 +03:00
|
|
|
if not os.path.exists(prefix + "/user.reg"):
|
|
|
|
#copy default prefix into place
|
2018-10-11 16:50:23 +03:00
|
|
|
with open(os.environ["STEAM_COMPAT_DATA_PATH"] + "/tracked_files", "w") as tfiles:
|
2019-07-29 18:49:26 +03:00
|
|
|
mergedirs(g_proton.default_pfx_dir, prefix, tfiles)
|
2018-08-23 17:01:32 +03:00
|
|
|
|
2018-03-16 18:39:04 +03:00
|
|
|
with open(version_file, "w") as f:
|
|
|
|
f.write(CURRENT_PREFIX_VERSION + "\n")
|
|
|
|
|
2018-10-12 14:20:49 +03:00
|
|
|
#create font files symlinks
|
|
|
|
create_fonts_symlinks(prefix)
|
|
|
|
|
2018-03-16 18:39:04 +03:00
|
|
|
#copy steam files into place
|
|
|
|
if "STEAM_COMPAT_CLIENT_INSTALL_PATH" in os.environ:
|
|
|
|
#modern steam client sets this
|
|
|
|
steamdir = os.environ["STEAM_COMPAT_CLIENT_INSTALL_PATH"]
|
|
|
|
else:
|
|
|
|
#linux-only fallback, really shouldn't get here
|
|
|
|
steamdir = os.environ["HOME"] + ".steam/root/"
|
|
|
|
dst = prefix + "/drive_c/Program Files (x86)/"
|
|
|
|
makedirs(dst + "Steam")
|
|
|
|
filestocopy = ["steamclient.dll",
|
|
|
|
"steamclient64.dll",
|
|
|
|
"Steam.dll"]
|
|
|
|
for f in filestocopy:
|
|
|
|
if os.path.isfile(steamdir + "/legacycompat/" + f):
|
|
|
|
dstfile = dst + "Steam/" + f
|
|
|
|
if os.path.isfile(dstfile):
|
|
|
|
os.remove(dstfile)
|
2019-02-01 02:02:36 +03:00
|
|
|
try_copy(steamdir + "/legacycompat/" + f, dstfile)
|
2018-03-16 18:39:04 +03:00
|
|
|
|
|
|
|
#copy openvr files into place
|
|
|
|
dst = prefix + "/drive_c/vrclient/bin/"
|
|
|
|
makedirs(dst)
|
2019-07-29 18:49:26 +03:00
|
|
|
try_copy(g_proton.lib_dir + "wine/fakedlls/vrclient.dll", dst)
|
|
|
|
try_copy(g_proton.lib64_dir + "wine/fakedlls/vrclient_x64.dll", dst)
|
2018-03-16 18:39:04 +03:00
|
|
|
|
2019-07-29 18:49:26 +03:00
|
|
|
try_copy(g_proton.lib_dir + "wine/dxvk/openvr_api_dxvk.dll", prefix + "/drive_c/windows/syswow64/")
|
|
|
|
try_copy(g_proton.lib64_dir + "wine/dxvk/openvr_api_dxvk.dll", prefix + "/drive_c/windows/system32/")
|
2018-10-15 19:04:58 +03:00
|
|
|
|
2018-03-16 18:39:04 +03:00
|
|
|
#parse linux openvr config and present it in win32 format to the app.
|
|
|
|
#logic from openvr's CVRPathRegistry_Public::GetPaths
|
|
|
|
|
|
|
|
#check environment for overrides
|
|
|
|
vr_runtime = None
|
|
|
|
if "VR_OVERRIDE" in env:
|
|
|
|
vr_runtime = env["VR_OVERRIDE"]
|
|
|
|
env.pop("VR_OVERRIDE")
|
|
|
|
|
|
|
|
vr_config = None
|
|
|
|
if "VR_CONFIG_PATH" in env:
|
|
|
|
vr_config = env["VR_CONFIG_PATH"]
|
|
|
|
env.pop("VR_CONFIG_PATH")
|
|
|
|
|
|
|
|
vr_log = None
|
|
|
|
if "VR_LOG_PATH" in env:
|
|
|
|
vr_log = env["VR_LOG_PATH"]
|
|
|
|
env.pop("VR_LOG_PATH")
|
|
|
|
|
|
|
|
#load from json if needed
|
|
|
|
if vr_runtime is None or \
|
|
|
|
vr_config is None or \
|
|
|
|
vr_log is None:
|
|
|
|
try:
|
2018-10-15 17:51:29 +03:00
|
|
|
path = os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config")
|
2018-03-16 18:39:04 +03:00
|
|
|
path = path + "/openvr/openvrpaths.vrpath"
|
|
|
|
|
2018-10-11 16:50:23 +03:00
|
|
|
with open(path, "r") as jfile:
|
|
|
|
j = json.load(jfile)
|
2018-03-16 18:39:04 +03:00
|
|
|
|
|
|
|
if vr_runtime is None:
|
|
|
|
vr_runtime = j["runtime"][0]
|
|
|
|
|
|
|
|
if vr_config is None:
|
|
|
|
vr_config = j["config"][0]
|
|
|
|
|
|
|
|
if vr_log is None:
|
|
|
|
vr_log = j["log"][0]
|
2018-12-11 17:14:35 +03:00
|
|
|
except (TypeError, ValueError, OSError):
|
|
|
|
log("Missing or invalid openvrpaths.vrpath file! " + str(sys.exc_info()[1]))
|
2018-03-16 18:39:04 +03:00
|
|
|
|
2018-08-20 18:45:26 +03:00
|
|
|
makedirs(prefix + "/drive_c/users/steamuser/Local Settings/Application Data/openvr")
|
2018-03-16 18:39:04 +03:00
|
|
|
|
|
|
|
#remove existing file
|
2018-08-20 18:45:26 +03:00
|
|
|
vrpaths_name = prefix + "/drive_c/users/steamuser/Local Settings/Application Data/openvr/openvrpaths.vrpath"
|
2018-03-16 18:39:04 +03:00
|
|
|
if os.path.exists(vrpaths_name):
|
|
|
|
os.remove(vrpaths_name)
|
|
|
|
|
|
|
|
#dump new file
|
|
|
|
if not vr_runtime is None:
|
|
|
|
try:
|
|
|
|
env["PROTON_VR_RUNTIME"] = vr_runtime
|
|
|
|
|
|
|
|
j = { "runtime": [ "C:\\vrclient\\", "C:\\vrclient" ] }
|
|
|
|
|
|
|
|
if not vr_config is None:
|
2019-07-29 18:49:26 +03:00
|
|
|
win_vr_config = subprocess.check_output([g_proton.wine_bin, "winepath", "-w", vr_config], env=env, stderr=lfile).decode("utf-8")
|
2018-03-16 18:39:04 +03:00
|
|
|
j["config"] = [ win_vr_config.strip() ]
|
|
|
|
|
|
|
|
if not vr_log is None:
|
2019-07-29 18:49:26 +03:00
|
|
|
win_vr_log = subprocess.check_output([g_proton.wine_bin, "winepath", "-w", vr_log], env=env, stderr=lfile).decode("utf-8")
|
2018-03-16 18:39:04 +03:00
|
|
|
j["log"] = [ win_vr_log.strip() ]
|
|
|
|
|
|
|
|
j["version"] = 1
|
|
|
|
j["jsonid"] = "vrpathreg"
|
|
|
|
|
2018-10-11 16:50:23 +03:00
|
|
|
with open(vrpaths_name, "w") as vfile:
|
|
|
|
json.dump(j, vfile, indent=2)
|
|
|
|
except (ValueError, OSError):
|
2018-08-31 16:40:31 +03:00
|
|
|
log("Unable to write VR config! " + str(sys.exc_info()[1]))
|
2018-03-16 18:39:04 +03:00
|
|
|
|
2018-10-15 19:40:33 +03:00
|
|
|
if "wined3d" in config_opts:
|
2019-07-09 19:48:20 +03:00
|
|
|
dxvkfiles = []
|
|
|
|
wined3dfiles = ["d3d11", "d3d10", "d3d10core", "d3d10_1", "dxgi", "d3d9"]
|
2018-10-15 19:04:58 +03:00
|
|
|
else:
|
2019-07-09 19:48:20 +03:00
|
|
|
dxvkfiles = ["d3d11", "d3d10", "d3d10core", "d3d10_1", "dxgi"]
|
|
|
|
wined3dfiles = []
|
|
|
|
if "d9vk" in config_opts:
|
|
|
|
dxvkfiles.append("d3d9")
|
|
|
|
else:
|
|
|
|
wined3dfiles.append("d3d9")
|
|
|
|
|
|
|
|
for f in wined3dfiles:
|
2019-07-29 18:49:26 +03:00
|
|
|
try_copy(g_proton.default_pfx_dir + "drive_c/windows/system32/" + f + ".dll",
|
2019-07-09 19:48:20 +03:00
|
|
|
prefix + "drive_c/windows/system32/" + f + ".dll")
|
2019-07-29 18:49:26 +03:00
|
|
|
try_copy(g_proton.default_pfx_dir + "drive_c/windows/syswow64/" + f + ".dll",
|
2019-07-09 19:48:20 +03:00
|
|
|
prefix + "drive_c/windows/syswow64/" + f + ".dll")
|
|
|
|
|
|
|
|
for f in dxvkfiles:
|
2019-07-29 18:49:26 +03:00
|
|
|
try_copy(g_proton.lib64_dir + "wine/dxvk/" + f + ".dll",
|
2019-07-09 19:48:20 +03:00
|
|
|
prefix + "drive_c/windows/system32/" + f + ".dll")
|
2019-07-29 18:49:26 +03:00
|
|
|
try_copy(g_proton.lib_dir + "wine/dxvk/" + f + ".dll",
|
2019-07-09 19:48:20 +03:00
|
|
|
prefix + "drive_c/windows/syswow64/" + f + ".dll")
|
|
|
|
dlloverrides[f] = "n"
|
2018-10-15 19:04:58 +03:00
|
|
|
|
2018-03-28 18:27:56 +03:00
|
|
|
if "nod3d11" in config_opts:
|
|
|
|
dlloverrides["d3d11"] = ""
|
|
|
|
if "dxgi" in dlloverrides:
|
|
|
|
del dlloverrides["dxgi"]
|
|
|
|
|
2018-12-19 02:49:36 +03:00
|
|
|
if "nod3d10" in config_opts:
|
|
|
|
dlloverrides["d3d10_1"] = ""
|
|
|
|
dlloverrides["d3d10"] = ""
|
|
|
|
dlloverrides["dxgi"] = ""
|
|
|
|
|
2018-03-28 18:27:56 +03:00
|
|
|
s = ""
|
2018-08-23 14:21:22 +03:00
|
|
|
for dll in dlloverrides:
|
|
|
|
setting = dlloverrides[dll]
|
2018-03-28 18:27:56 +03:00
|
|
|
if len(s) > 0:
|
|
|
|
s = s + ";" + dll + "=" + setting
|
|
|
|
else:
|
|
|
|
s = dll + "=" + setting
|
2018-10-07 16:16:54 +03:00
|
|
|
if "WINEDLLOVERRIDES" in os.environ:
|
|
|
|
env["WINEDLLOVERRIDES"] = os.environ["WINEDLLOVERRIDES"] + ";" + s
|
|
|
|
else:
|
|
|
|
env["WINEDLLOVERRIDES"] = s
|
2018-03-28 18:27:56 +03:00
|
|
|
|
2018-03-14 21:58:11 +03:00
|
|
|
def dump_dbg_env(f):
|
2018-03-16 19:02:04 +03:00
|
|
|
f.write("PATH=\"" + env["PATH"] + "\" \\\n")
|
2018-03-14 21:58:11 +03:00
|
|
|
f.write("\tTERM=\"xterm\" \\\n") #XXX
|
|
|
|
f.write("\tWINEDEBUG=\"-all\" \\\n")
|
2018-02-15 19:13:33 +03:00
|
|
|
f.write("\tWINEDLLPATH=\"" + env["WINEDLLPATH"] + "\" \\\n")
|
2018-03-06 21:13:24 +03:00
|
|
|
f.write("\t" + ld_path_var + "=\"" + env[ld_path_var] + "\" \\\n")
|
2018-02-15 19:13:33 +03:00
|
|
|
f.write("\tWINEPREFIX=\"" + env["WINEPREFIX"] + "\" \\\n")
|
2018-09-17 23:01:50 +03:00
|
|
|
if "WINEESYNC" in env:
|
|
|
|
f.write("\tWINEESYNC=\"" + env["WINEESYNC"] + "\" \\\n")
|
2018-03-16 19:02:04 +03:00
|
|
|
if "SteamGameId" in env:
|
|
|
|
f.write("\tSteamGameId=\"" + env["SteamGameId"] + "\" \\\n")
|
|
|
|
if "SteamAppId" in env:
|
|
|
|
f.write("\tSteamAppId=\"" + env["SteamAppId"] + "\" \\\n")
|
2018-02-15 19:13:33 +03:00
|
|
|
if "PROTON_VR_RUNTIME" in env:
|
|
|
|
f.write("\tPROTON_VR_RUNTIME=\"" + env["PROTON_VR_RUNTIME"] + "\" \\\n")
|
|
|
|
if "WINEDLLOVERRIDES" in env:
|
|
|
|
f.write("\tWINEDLLOVERRIDES=\"" + env["WINEDLLOVERRIDES"] + "\" \\\n")
|
2018-05-15 22:58:49 +03:00
|
|
|
if "STEAM_COMPAT_CLIENT_INSTALL_PATH" in env:
|
|
|
|
f.write("\tSTEAM_COMPAT_CLIENT_INSTALL_PATH=\"" + env["STEAM_COMPAT_CLIENT_INSTALL_PATH"] + "\" \\\n")
|
2018-12-17 19:25:19 +03:00
|
|
|
if "WINE_LARGE_ADDRESS_AWARE" in env:
|
|
|
|
f.write("\tWINE_LARGE_ADDRESS_AWARE=\"" + env["WINE_LARGE_ADDRESS_AWARE"] + "\" \\\n")
|
2018-03-14 21:58:11 +03:00
|
|
|
|
|
|
|
def dump_dbg_scripts():
|
|
|
|
exe_name = os.path.basename(sys.argv[2])
|
|
|
|
|
2018-10-24 22:22:22 +03:00
|
|
|
tmpdir = env.get("PROTON_DEBUG_DIR", "/tmp") + "/proton_" + os.environ["USER"] + "/"
|
|
|
|
makedirs(tmpdir)
|
2018-08-22 22:55:38 +03:00
|
|
|
|
2018-10-24 22:22:22 +03:00
|
|
|
with open(tmpdir + "winedbg", "w") as f:
|
2018-03-14 21:58:11 +03:00
|
|
|
f.write("#!/bin/bash\n")
|
|
|
|
f.write("#Run winedbg with args\n\n")
|
|
|
|
f.write("cd \"" + os.getcwd() + "\"\n")
|
|
|
|
dump_dbg_env(f)
|
2019-07-29 18:49:26 +03:00
|
|
|
f.write("\t\"" + g_proton.wine_bin + "\" winedbg \"$@\"\n")
|
2018-10-24 22:22:22 +03:00
|
|
|
os.chmod(tmpdir + "winedbg", 0o755)
|
2018-03-14 21:58:11 +03:00
|
|
|
|
2018-10-24 22:22:22 +03:00
|
|
|
with open(tmpdir + "winedbg_run", "w") as f:
|
2018-03-14 21:58:11 +03:00
|
|
|
f.write("#!/bin/bash\n")
|
|
|
|
f.write("#Run winedbg and prepare to run game or given program\n\n")
|
|
|
|
f.write("cd \"" + os.getcwd() + "\"\n")
|
|
|
|
f.write("DEF_CMD=(")
|
|
|
|
first = True
|
|
|
|
for arg in sys.argv[2:]:
|
|
|
|
if first:
|
|
|
|
f.write("\"" + arg + "\"")
|
|
|
|
first = False
|
|
|
|
else:
|
|
|
|
f.write(" \"" + arg + "\"")
|
|
|
|
f.write(")\n")
|
|
|
|
dump_dbg_env(f)
|
2019-07-29 18:49:26 +03:00
|
|
|
f.write("\t\"" + g_proton.wine_bin + "\" winedbg \"${@:-${DEF_CMD[@]}}\"\n")
|
2018-10-24 22:22:22 +03:00
|
|
|
os.chmod(tmpdir + "winedbg_run", 0o755)
|
2018-03-14 21:58:11 +03:00
|
|
|
|
2018-10-24 22:22:22 +03:00
|
|
|
with open(tmpdir + "gdb_attach", "w") as f:
|
2018-03-14 21:58:11 +03:00
|
|
|
f.write("#!/bin/bash\n")
|
|
|
|
f.write("#Run winedbg in gdb mode and auto-attach to already-running program\n\n")
|
|
|
|
f.write("cd \"" + os.getcwd() + "\"\n")
|
|
|
|
f.write("EXE_NAME=${1:-\"" + exe_name + "\"}\n")
|
2018-10-24 22:22:22 +03:00
|
|
|
f.write("WPID_HEX=$(\"" + tmpdir + "winedbg\" --command 'info process' | grep -i \"$EXE_NAME\" | cut -f2 -d' ' | tr -d '0')\n")
|
2018-03-14 21:58:11 +03:00
|
|
|
f.write("if [ -z \"$WPID_HEX\" ]; then \n")
|
|
|
|
f.write(" echo \"Program does not appear to be running: \\\"$EXE_NAME\\\"\"\n")
|
|
|
|
f.write(" exit 1\n")
|
|
|
|
f.write("fi\n")
|
|
|
|
f.write("WPID_DEC=$(printf %d 0x$WPID_HEX)\n")
|
|
|
|
dump_dbg_env(f)
|
2019-07-29 18:49:26 +03:00
|
|
|
f.write("\t\"" + g_proton.wine_bin + "\" winedbg --gdb $WPID_DEC\n")
|
2018-10-24 22:22:22 +03:00
|
|
|
os.chmod(tmpdir + "gdb_attach", 0o755)
|
2018-03-14 21:58:11 +03:00
|
|
|
|
2018-10-24 22:22:22 +03:00
|
|
|
with open(tmpdir + "gdb_run", "w") as f:
|
2018-03-14 21:58:11 +03:00
|
|
|
f.write("#!/bin/bash\n")
|
|
|
|
f.write("#Run winedbg in gdb mode and prepare to run game or given program\n\n")
|
|
|
|
f.write("cd \"" + os.getcwd() + "\"\n")
|
|
|
|
f.write("DEF_CMD=(")
|
|
|
|
first = True
|
|
|
|
for arg in sys.argv[2:]:
|
|
|
|
if first:
|
|
|
|
f.write("\"" + arg + "\"")
|
|
|
|
first = False
|
|
|
|
else:
|
|
|
|
f.write(" \"" + arg + "\"")
|
|
|
|
f.write(")\n")
|
|
|
|
dump_dbg_env(f)
|
2019-07-29 18:49:26 +03:00
|
|
|
f.write("\t\"" + g_proton.wine_bin + "\" winedbg --gdb \"${@:-${DEF_CMD[@]}}\"\n")
|
2018-10-24 22:22:22 +03:00
|
|
|
os.chmod(tmpdir + "gdb_run", 0o755)
|
2018-03-14 21:58:11 +03:00
|
|
|
|
2018-10-24 22:22:22 +03:00
|
|
|
with open(tmpdir + "run", "w") as f:
|
2018-03-14 21:58:11 +03:00
|
|
|
f.write("#!/bin/bash\n")
|
|
|
|
f.write("#Run game or given command in environment\n\n")
|
|
|
|
f.write("cd \"" + os.getcwd() + "\"\n")
|
|
|
|
f.write("DEF_CMD=(")
|
|
|
|
first = True
|
|
|
|
for arg in sys.argv[2:]:
|
|
|
|
if first:
|
|
|
|
f.write("\"" + arg + "\"")
|
|
|
|
first = False
|
|
|
|
else:
|
|
|
|
f.write(" \"" + arg + "\"")
|
|
|
|
f.write(")\n")
|
|
|
|
dump_dbg_env(f)
|
2019-07-29 18:49:26 +03:00
|
|
|
f.write("\t\"" + g_proton.wine_bin + "\" steam.exe \"${@:-${DEF_CMD[@]}}\"\n")
|
2018-10-24 22:22:22 +03:00
|
|
|
os.chmod(tmpdir + "run", 0o755)
|
2018-02-15 19:13:33 +03:00
|
|
|
|
2018-08-08 16:01:55 +03:00
|
|
|
def run():
|
2019-02-05 17:08:13 +03:00
|
|
|
if "PROTON_DUMP_DEBUG_COMMANDS" in env and nonzero(env["PROTON_DUMP_DEBUG_COMMANDS"]):
|
2018-08-22 22:51:45 +03:00
|
|
|
try:
|
|
|
|
dump_dbg_scripts()
|
2018-10-11 16:50:23 +03:00
|
|
|
except OSError:
|
2018-08-22 22:55:38 +03:00
|
|
|
log("Unable to write debug scripts! " + str(sys.exc_info()[1]))
|
2019-07-29 18:49:26 +03:00
|
|
|
run_wine([g_proton.wine_bin, "steam"] + sys.argv[2:])
|
2018-08-08 16:01:55 +03:00
|
|
|
|
2018-08-23 14:21:22 +03:00
|
|
|
if sys.version_info[0] == 2:
|
|
|
|
binary_stdout = sys.stdout
|
|
|
|
elif sys.version_info[0] == 3:
|
|
|
|
binary_stdout = sys.stdout.buffer
|
|
|
|
else:
|
2018-08-26 23:52:05 +03:00
|
|
|
raise Exception("Unsupported python version")
|
2018-08-23 14:21:22 +03:00
|
|
|
|
2018-08-08 16:01:55 +03:00
|
|
|
#determine mode
|
|
|
|
if sys.argv[1] == "run":
|
|
|
|
#start target app
|
|
|
|
run()
|
|
|
|
elif sys.argv[1] == "waitforexitandrun":
|
|
|
|
#wait for wineserver to shut down
|
2019-07-29 18:49:26 +03:00
|
|
|
run_wine([g_proton.wineserver_bin, "-w"])
|
2018-08-08 16:01:55 +03:00
|
|
|
#then run
|
|
|
|
run()
|
2018-02-20 16:41:39 +03:00
|
|
|
elif sys.argv[1] == "getcompatpath":
|
|
|
|
#linux -> windows path
|
2019-07-29 18:49:26 +03:00
|
|
|
path = subprocess.check_output([g_proton.wine_bin, "winepath", "-w", sys.argv[2]], env=env, stderr=lfile)
|
2018-08-23 14:21:22 +03:00
|
|
|
binary_stdout.write(path)
|
2018-02-20 16:41:39 +03:00
|
|
|
elif sys.argv[1] == "getnativepath":
|
|
|
|
#windows -> linux path
|
2019-07-29 18:49:26 +03:00
|
|
|
path = subprocess.check_output([g_proton.wine_bin, "winepath", sys.argv[2]], env=env, stderr=lfile)
|
2018-08-23 14:21:22 +03:00
|
|
|
binary_stdout.write(path)
|
2018-02-02 23:21:35 +03:00
|
|
|
else:
|
2018-02-15 22:06:32 +03:00
|
|
|
log("Need a verb.")
|
2018-02-02 23:21:35 +03:00
|
|
|
sys.exit(1)
|
2018-01-18 23:00:48 +03:00
|
|
|
|
|
|
|
sys.exit(0)
|
2018-08-29 15:45:41 +03:00
|
|
|
|
|
|
|
# vim: set syntax=python:
|