Global update of the port_on file
This commit is contained in:
parent
fcc2062221
commit
9c0257fcbc
@ -1,451 +0,0 @@
|
|||||||
# This is free and unencumbered software released into the public domain.
|
|
||||||
#
|
|
||||||
# Anyone is free to copy, modify, publish, use, compile, sell, or
|
|
||||||
# distribute this software, either in source code form or as a compiled
|
|
||||||
# binary, for any purpose, commercial or non-commercial, and by any
|
|
||||||
# means.
|
|
||||||
#
|
|
||||||
# In jurisdictions that recognize copyright laws, the author or authors
|
|
||||||
# of this software dedicate any and all copyright interest in the
|
|
||||||
# software to the public domain. We make this dedication for the benefit
|
|
||||||
# of the public at large and to the detriment of our heirs and
|
|
||||||
# successors. We intend this dedication to be an overt act of
|
|
||||||
# relinquishment in perpetuity of all present and future rights to this
|
|
||||||
# software under copyright law.
|
|
||||||
#
|
|
||||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
||||||
# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
||||||
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
||||||
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
||||||
# OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
#
|
|
||||||
# For more information, please refer to <http://unlicense.org>
|
|
||||||
|
|
||||||
"""
|
|
||||||
A platform independent file lock that supports the with-statement.
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
# Modules
|
|
||||||
# ------------------------------------------------
|
|
||||||
import logging
|
|
||||||
import os
|
|
||||||
import threading
|
|
||||||
import time
|
|
||||||
try:
|
|
||||||
import warnings
|
|
||||||
except ImportError:
|
|
||||||
warnings = None
|
|
||||||
|
|
||||||
try:
|
|
||||||
import msvcrt
|
|
||||||
except ImportError:
|
|
||||||
msvcrt = None
|
|
||||||
|
|
||||||
try:
|
|
||||||
import fcntl
|
|
||||||
except ImportError:
|
|
||||||
fcntl = None
|
|
||||||
|
|
||||||
|
|
||||||
# Backward compatibility
|
|
||||||
# ------------------------------------------------
|
|
||||||
try:
|
|
||||||
TimeoutError
|
|
||||||
except NameError:
|
|
||||||
TimeoutError = OSError
|
|
||||||
|
|
||||||
|
|
||||||
# Data
|
|
||||||
# ------------------------------------------------
|
|
||||||
__all__ = [
|
|
||||||
"Timeout",
|
|
||||||
"BaseFileLock",
|
|
||||||
"WindowsFileLock",
|
|
||||||
"UnixFileLock",
|
|
||||||
"SoftFileLock",
|
|
||||||
"FileLock"
|
|
||||||
]
|
|
||||||
|
|
||||||
__version__ = "3.0.12"
|
|
||||||
|
|
||||||
|
|
||||||
_logger = None
|
|
||||||
def logger():
|
|
||||||
"""Returns the logger instance used in this module."""
|
|
||||||
global _logger
|
|
||||||
_logger = _logger or logging.getLogger(__name__)
|
|
||||||
return _logger
|
|
||||||
|
|
||||||
|
|
||||||
# Exceptions
|
|
||||||
# ------------------------------------------------
|
|
||||||
class Timeout(TimeoutError):
|
|
||||||
"""
|
|
||||||
Raised when the lock could not be acquired in *timeout*
|
|
||||||
seconds.
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self, lock_file):
|
|
||||||
"""
|
|
||||||
"""
|
|
||||||
#: The path of the file lock.
|
|
||||||
self.lock_file = lock_file
|
|
||||||
return None
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
temp = "The file lock '{}' could not be acquired."\
|
|
||||||
.format(self.lock_file)
|
|
||||||
return temp
|
|
||||||
|
|
||||||
|
|
||||||
# Classes
|
|
||||||
# ------------------------------------------------
|
|
||||||
|
|
||||||
# This is a helper class which is returned by :meth:`BaseFileLock.acquire`
|
|
||||||
# and wraps the lock to make sure __enter__ is not called twice when entering
|
|
||||||
# the with statement.
|
|
||||||
# If we would simply return *self*, the lock would be acquired again
|
|
||||||
# in the *__enter__* method of the BaseFileLock, but not released again
|
|
||||||
# automatically.
|
|
||||||
#
|
|
||||||
# :seealso: issue #37 (memory leak)
|
|
||||||
class _Acquire_ReturnProxy(object):
|
|
||||||
|
|
||||||
def __init__(self, lock):
|
|
||||||
self.lock = lock
|
|
||||||
return None
|
|
||||||
|
|
||||||
def __enter__(self):
|
|
||||||
return self.lock
|
|
||||||
|
|
||||||
def __exit__(self, exc_type, exc_value, traceback):
|
|
||||||
self.lock.release()
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
class BaseFileLock(object):
|
|
||||||
"""
|
|
||||||
Implements the base class of a file lock.
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self, lock_file, timeout = -1):
|
|
||||||
"""
|
|
||||||
"""
|
|
||||||
# The path to the lock file.
|
|
||||||
self._lock_file = lock_file
|
|
||||||
|
|
||||||
# The file descriptor for the *_lock_file* as it is returned by the
|
|
||||||
# os.open() function.
|
|
||||||
# This file lock is only NOT None, if the object currently holds the
|
|
||||||
# lock.
|
|
||||||
self._lock_file_fd = None
|
|
||||||
|
|
||||||
# The default timeout value.
|
|
||||||
self.timeout = timeout
|
|
||||||
|
|
||||||
# We use this lock primarily for the lock counter.
|
|
||||||
self._thread_lock = threading.Lock()
|
|
||||||
|
|
||||||
# The lock counter is used for implementing the nested locking
|
|
||||||
# mechanism. Whenever the lock is acquired, the counter is increased and
|
|
||||||
# the lock is only released, when this value is 0 again.
|
|
||||||
self._lock_counter = 0
|
|
||||||
return None
|
|
||||||
|
|
||||||
@property
|
|
||||||
def lock_file(self):
|
|
||||||
"""
|
|
||||||
The path to the lock file.
|
|
||||||
"""
|
|
||||||
return self._lock_file
|
|
||||||
|
|
||||||
@property
|
|
||||||
def timeout(self):
|
|
||||||
"""
|
|
||||||
You can set a default timeout for the filelock. It will be used as
|
|
||||||
fallback value in the acquire method, if no timeout value (*None*) is
|
|
||||||
given.
|
|
||||||
|
|
||||||
If you want to disable the timeout, set it to a negative value.
|
|
||||||
|
|
||||||
A timeout of 0 means, that there is exactly one attempt to acquire the
|
|
||||||
file lock.
|
|
||||||
|
|
||||||
.. versionadded:: 2.0.0
|
|
||||||
"""
|
|
||||||
return self._timeout
|
|
||||||
|
|
||||||
@timeout.setter
|
|
||||||
def timeout(self, value):
|
|
||||||
"""
|
|
||||||
"""
|
|
||||||
self._timeout = float(value)
|
|
||||||
return None
|
|
||||||
|
|
||||||
# Platform dependent locking
|
|
||||||
# --------------------------------------------
|
|
||||||
|
|
||||||
def _acquire(self):
|
|
||||||
"""
|
|
||||||
Platform dependent. If the file lock could be
|
|
||||||
acquired, self._lock_file_fd holds the file descriptor
|
|
||||||
of the lock file.
|
|
||||||
"""
|
|
||||||
raise NotImplementedError()
|
|
||||||
|
|
||||||
def _release(self):
|
|
||||||
"""
|
|
||||||
Releases the lock and sets self._lock_file_fd to None.
|
|
||||||
"""
|
|
||||||
raise NotImplementedError()
|
|
||||||
|
|
||||||
# Platform independent methods
|
|
||||||
# --------------------------------------------
|
|
||||||
|
|
||||||
@property
|
|
||||||
def is_locked(self):
|
|
||||||
"""
|
|
||||||
True, if the object holds the file lock.
|
|
||||||
|
|
||||||
.. versionchanged:: 2.0.0
|
|
||||||
|
|
||||||
This was previously a method and is now a property.
|
|
||||||
"""
|
|
||||||
return self._lock_file_fd is not None
|
|
||||||
|
|
||||||
def acquire(self, timeout=None, poll_intervall=0.05):
|
|
||||||
"""
|
|
||||||
Acquires the file lock or fails with a :exc:`Timeout` error.
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
# You can use this method in the context manager (recommended)
|
|
||||||
with lock.acquire():
|
|
||||||
pass
|
|
||||||
|
|
||||||
# Or use an equivalent try-finally construct:
|
|
||||||
lock.acquire()
|
|
||||||
try:
|
|
||||||
pass
|
|
||||||
finally:
|
|
||||||
lock.release()
|
|
||||||
|
|
||||||
:arg float timeout:
|
|
||||||
The maximum time waited for the file lock.
|
|
||||||
If ``timeout < 0``, there is no timeout and this method will
|
|
||||||
block until the lock could be acquired.
|
|
||||||
If ``timeout`` is None, the default :attr:`~timeout` is used.
|
|
||||||
|
|
||||||
:arg float poll_intervall:
|
|
||||||
We check once in *poll_intervall* seconds if we can acquire the
|
|
||||||
file lock.
|
|
||||||
|
|
||||||
:raises Timeout:
|
|
||||||
if the lock could not be acquired in *timeout* seconds.
|
|
||||||
|
|
||||||
.. versionchanged:: 2.0.0
|
|
||||||
|
|
||||||
This method returns now a *proxy* object instead of *self*,
|
|
||||||
so that it can be used in a with statement without side effects.
|
|
||||||
"""
|
|
||||||
# Use the default timeout, if no timeout is provided.
|
|
||||||
if timeout is None:
|
|
||||||
timeout = self.timeout
|
|
||||||
|
|
||||||
# Increment the number right at the beginning.
|
|
||||||
# We can still undo it, if something fails.
|
|
||||||
with self._thread_lock:
|
|
||||||
self._lock_counter += 1
|
|
||||||
|
|
||||||
lock_id = id(self)
|
|
||||||
lock_filename = self._lock_file
|
|
||||||
start_time = time.time()
|
|
||||||
try:
|
|
||||||
while True:
|
|
||||||
with self._thread_lock:
|
|
||||||
if not self.is_locked:
|
|
||||||
logger().debug('Attempting to acquire lock %s on %s', lock_id, lock_filename)
|
|
||||||
self._acquire()
|
|
||||||
|
|
||||||
if self.is_locked:
|
|
||||||
logger().info('Lock %s acquired on %s', lock_id, lock_filename)
|
|
||||||
break
|
|
||||||
elif timeout >= 0 and time.time() - start_time > timeout:
|
|
||||||
logger().debug('Timeout on acquiring lock %s on %s', lock_id, lock_filename)
|
|
||||||
raise Timeout(self._lock_file)
|
|
||||||
else:
|
|
||||||
logger().debug(
|
|
||||||
'Lock %s not acquired on %s, waiting %s seconds ...',
|
|
||||||
lock_id, lock_filename, poll_intervall
|
|
||||||
)
|
|
||||||
time.sleep(poll_intervall)
|
|
||||||
except:
|
|
||||||
# Something did go wrong, so decrement the counter.
|
|
||||||
with self._thread_lock:
|
|
||||||
self._lock_counter = max(0, self._lock_counter - 1)
|
|
||||||
|
|
||||||
raise
|
|
||||||
return _Acquire_ReturnProxy(lock = self)
|
|
||||||
|
|
||||||
def release(self, force = False):
|
|
||||||
"""
|
|
||||||
Releases the file lock.
|
|
||||||
|
|
||||||
Please note, that the lock is only completly released, if the lock
|
|
||||||
counter is 0.
|
|
||||||
|
|
||||||
Also note, that the lock file itself is not automatically deleted.
|
|
||||||
|
|
||||||
:arg bool force:
|
|
||||||
If true, the lock counter is ignored and the lock is released in
|
|
||||||
every case.
|
|
||||||
"""
|
|
||||||
with self._thread_lock:
|
|
||||||
|
|
||||||
if self.is_locked:
|
|
||||||
self._lock_counter -= 1
|
|
||||||
|
|
||||||
if self._lock_counter == 0 or force:
|
|
||||||
lock_id = id(self)
|
|
||||||
lock_filename = self._lock_file
|
|
||||||
|
|
||||||
logger().debug('Attempting to release lock %s on %s', lock_id, lock_filename)
|
|
||||||
self._release()
|
|
||||||
self._lock_counter = 0
|
|
||||||
logger().info('Lock %s released on %s', lock_id, lock_filename)
|
|
||||||
|
|
||||||
return None
|
|
||||||
|
|
||||||
def __enter__(self):
|
|
||||||
self.acquire()
|
|
||||||
return self
|
|
||||||
|
|
||||||
def __exit__(self, exc_type, exc_value, traceback):
|
|
||||||
self.release()
|
|
||||||
return None
|
|
||||||
|
|
||||||
def __del__(self):
|
|
||||||
self.release(force = True)
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
# Windows locking mechanism
|
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
class WindowsFileLock(BaseFileLock):
|
|
||||||
"""
|
|
||||||
Uses the :func:`msvcrt.locking` function to hard lock the lock file on
|
|
||||||
windows systems.
|
|
||||||
"""
|
|
||||||
|
|
||||||
def _acquire(self):
|
|
||||||
open_mode = os.O_RDWR | os.O_CREAT | os.O_TRUNC
|
|
||||||
|
|
||||||
try:
|
|
||||||
fd = os.open(self._lock_file, open_mode)
|
|
||||||
except OSError:
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
try:
|
|
||||||
msvcrt.locking(fd, msvcrt.LK_NBLCK, 1)
|
|
||||||
except (IOError, OSError):
|
|
||||||
os.close(fd)
|
|
||||||
else:
|
|
||||||
self._lock_file_fd = fd
|
|
||||||
return None
|
|
||||||
|
|
||||||
def _release(self):
|
|
||||||
fd = self._lock_file_fd
|
|
||||||
self._lock_file_fd = None
|
|
||||||
msvcrt.locking(fd, msvcrt.LK_UNLCK, 1)
|
|
||||||
os.close(fd)
|
|
||||||
|
|
||||||
try:
|
|
||||||
os.remove(self._lock_file)
|
|
||||||
# Probably another instance of the application
|
|
||||||
# that acquired the file lock.
|
|
||||||
except OSError:
|
|
||||||
pass
|
|
||||||
return None
|
|
||||||
|
|
||||||
# Unix locking mechanism
|
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
class UnixFileLock(BaseFileLock):
|
|
||||||
"""
|
|
||||||
Uses the :func:`fcntl.flock` to hard lock the lock file on unix systems.
|
|
||||||
"""
|
|
||||||
|
|
||||||
def _acquire(self):
|
|
||||||
open_mode = os.O_RDWR | os.O_CREAT | os.O_TRUNC
|
|
||||||
fd = os.open(self._lock_file, open_mode)
|
|
||||||
|
|
||||||
try:
|
|
||||||
fcntl.flock(fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
|
||||||
except (IOError, OSError):
|
|
||||||
os.close(fd)
|
|
||||||
else:
|
|
||||||
self._lock_file_fd = fd
|
|
||||||
return None
|
|
||||||
|
|
||||||
def _release(self):
|
|
||||||
# Do not remove the lockfile:
|
|
||||||
#
|
|
||||||
# https://github.com/benediktschmitt/py-filelock/issues/31
|
|
||||||
# https://stackoverflow.com/questions/17708885/flock-removing-locked-file-without-race-condition
|
|
||||||
fd = self._lock_file_fd
|
|
||||||
self._lock_file_fd = None
|
|
||||||
fcntl.flock(fd, fcntl.LOCK_UN)
|
|
||||||
os.close(fd)
|
|
||||||
return None
|
|
||||||
|
|
||||||
# Soft lock
|
|
||||||
# ~~~~~~~~~
|
|
||||||
|
|
||||||
class SoftFileLock(BaseFileLock):
|
|
||||||
"""
|
|
||||||
Simply watches the existence of the lock file.
|
|
||||||
"""
|
|
||||||
|
|
||||||
def _acquire(self):
|
|
||||||
open_mode = os.O_WRONLY | os.O_CREAT | os.O_EXCL | os.O_TRUNC
|
|
||||||
try:
|
|
||||||
fd = os.open(self._lock_file, open_mode)
|
|
||||||
except (IOError, OSError):
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
self._lock_file_fd = fd
|
|
||||||
return None
|
|
||||||
|
|
||||||
def _release(self):
|
|
||||||
os.close(self._lock_file_fd)
|
|
||||||
self._lock_file_fd = None
|
|
||||||
|
|
||||||
try:
|
|
||||||
os.remove(self._lock_file)
|
|
||||||
# The file is already deleted and that's what we want.
|
|
||||||
except OSError:
|
|
||||||
pass
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
# Platform filelock
|
|
||||||
# ~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
#: Alias for the lock, which should be used for the current platform. On
|
|
||||||
#: Windows, this is an alias for :class:`WindowsFileLock`, on Unix for
|
|
||||||
#: :class:`UnixFileLock` and otherwise for :class:`SoftFileLock`.
|
|
||||||
FileLock = None
|
|
||||||
|
|
||||||
if msvcrt:
|
|
||||||
FileLock = WindowsFileLock
|
|
||||||
elif fcntl:
|
|
||||||
FileLock = UnixFileLock
|
|
||||||
else:
|
|
||||||
FileLock = SoftFileLock
|
|
||||||
|
|
||||||
if warnings is not None:
|
|
||||||
warnings.warn("only soft file lock is available")
|
|
@ -15,9 +15,10 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
import tarfile
|
import tarfile
|
||||||
|
|
||||||
from filelock import FileLock
|
#To enable debug logging, copy "user_settings.sample.py" to "user_settings.py"
|
||||||
|
#and edit it if needed.
|
||||||
|
|
||||||
CURRENT_PREFIX_VERSION="5.13-1"
|
CURRENT_PREFIX_VERSION="5.21-GE-1"
|
||||||
|
|
||||||
PFX="Proton: "
|
PFX="Proton: "
|
||||||
ld_path_var = "LD_LIBRARY_PATH"
|
ld_path_var = "LD_LIBRARY_PATH"
|
||||||
@ -29,17 +30,6 @@ def log(msg):
|
|||||||
sys.stderr.write(PFX + msg + os.linesep)
|
sys.stderr.write(PFX + msg + os.linesep)
|
||||||
sys.stderr.flush()
|
sys.stderr.flush()
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
def makedirs(path):
|
def makedirs(path):
|
||||||
try:
|
try:
|
||||||
os.makedirs(path)
|
os.makedirs(path)
|
||||||
@ -47,15 +37,23 @@ def makedirs(path):
|
|||||||
#already exists
|
#already exists
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def try_copy(src, dst):
|
def try_copy(src, dst, add_write_perm=True):
|
||||||
try:
|
try:
|
||||||
if os.path.isdir(dst):
|
if os.path.isdir(dst):
|
||||||
dstfile = dst + "/" + os.path.basename(src)
|
dstfile = dst + "/" + os.path.basename(src)
|
||||||
if os.path.lexists(dstfile):
|
if os.path.lexists(dstfile):
|
||||||
os.remove(dstfile)
|
os.remove(dstfile)
|
||||||
elif os.path.lexists(dst):
|
else:
|
||||||
os.remove(dst)
|
dstfile = dst
|
||||||
|
if os.path.lexists(dst):
|
||||||
|
os.remove(dst)
|
||||||
|
|
||||||
shutil.copy(src, dst)
|
shutil.copy(src, dst)
|
||||||
|
|
||||||
|
if add_write_perm:
|
||||||
|
new_mode = os.lstat(dstfile).st_mode | stat.S_IWUSR | stat.S_IWGRP
|
||||||
|
os.chmod(dstfile, new_mode)
|
||||||
|
|
||||||
except PermissionError as e:
|
except PermissionError as e:
|
||||||
if e.errno == errno.EPERM:
|
if e.errno == errno.EPERM:
|
||||||
#be forgiving about permissions errors; if it's a real problem, things will explode later anyway
|
#be forgiving about permissions errors; if it's a real problem, things will explode later anyway
|
||||||
@ -63,30 +61,28 @@ def try_copy(src, dst):
|
|||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def real_copy(src, dst):
|
def try_copyfile(src, dst):
|
||||||
if os.path.islink(src):
|
|
||||||
os.symlink(os.readlink(src), dst)
|
|
||||||
else:
|
|
||||||
try_copy(src, dst)
|
|
||||||
|
|
||||||
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:
|
try:
|
||||||
dat = array.array('I', [0])
|
if os.path.isdir(dst):
|
||||||
if fcntl.ioctl(dr, EXT2_IOC_GETFLAGS, dat, True) >= 0:
|
dstfile = dst + "/" + os.path.basename(src)
|
||||||
dat[0] = dat[0] | EXT4_CASEFOLD_FL
|
if os.path.lexists(dstfile):
|
||||||
fcntl.ioctl(dr, EXT2_IOC_SETFLAGS, dat, False)
|
os.remove(dstfile)
|
||||||
except OSError:
|
elif os.path.lexists(dst):
|
||||||
#no problem
|
os.remove(dst)
|
||||||
pass
|
shutil.copyfile(src, dst)
|
||||||
os.close(dr)
|
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
|
||||||
|
|
||||||
|
def getmtimestr(*path_fragments):
|
||||||
|
path = os.path.join(*path_fragments)
|
||||||
|
try:
|
||||||
|
return str(os.path.getmtime(path))
|
||||||
|
except IOError:
|
||||||
|
return "0"
|
||||||
|
|
||||||
class Proton:
|
class Proton:
|
||||||
def __init__(self, base_dir):
|
def __init__(self, base_dir):
|
||||||
@ -97,104 +93,22 @@ class Proton:
|
|||||||
self.lib64_dir = self.path("dist/lib64/")
|
self.lib64_dir = self.path("dist/lib64/")
|
||||||
self.fonts_dir = self.path("dist/share/fonts/")
|
self.fonts_dir = self.path("dist/share/fonts/")
|
||||||
self.version_file = self.path("version")
|
self.version_file = self.path("version")
|
||||||
self.prefix_dir = self.path("pfx/")
|
|
||||||
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.wine_bin = self.bin_dir + "wine"
|
||||||
self.wineserver_bin = self.bin_dir + "wineserver"
|
self.wineserver_bin = self.bin_dir + "wineserver"
|
||||||
self.gamemoderun = "gamemoderun"
|
self.gamemoderun = "gamemoderun"
|
||||||
self.dist_lock = FileLock(self.path("dist.lock"), timeout=-1)
|
|
||||||
|
|
||||||
def path(self, d):
|
def path(self, d):
|
||||||
return self.base_dir + d
|
return self.base_dir + d
|
||||||
|
|
||||||
def make_default_prefix(self):
|
|
||||||
with self.dist_lock:
|
|
||||||
local_env = dict(g_session.env)
|
|
||||||
if not os.path.isdir(self.default_pfx_dir):
|
|
||||||
#make default prefix
|
|
||||||
local_env["WINEPREFIX"] = self.default_pfx_dir
|
|
||||||
local_env["WINEDEBUG"] = "-all"
|
|
||||||
g_session.run_proc([self.wine_bin, "wineboot"], local_env)
|
|
||||||
g_session.run_proc([self.wineserver_bin, "-w"], local_env)
|
|
||||||
|
|
||||||
class CompatData:
|
class CompatData:
|
||||||
def __init__(self, compatdata):
|
def __init__(self, compatdata):
|
||||||
self.base_dir = os.environ["PW_COMPAT_DATA_PATH"]
|
self.base_dir = os.environ["PW_COMPAT_DATA_PATH"]
|
||||||
self.prefix_dir = self.path("pfx/")
|
self.prefix_dir = self.path("pfx/")
|
||||||
self.default_pfx_dir = self.path("dist/share/default_pfx/")
|
|
||||||
self.version_file = self.path("version")
|
self.version_file = self.path("version")
|
||||||
self.tracked_files_file = self.path("tracked_files")
|
|
||||||
self.prefix_lock = FileLock(self.path("pfx.lock"), timeout=-1)
|
|
||||||
|
|
||||||
def path(self, d):
|
def path(self, d):
|
||||||
return self.base_dir + d
|
return self.base_dir + d
|
||||||
|
|
||||||
def remove_tracked_files(self):
|
|
||||||
if not os.path.exists(self.tracked_files_file):
|
|
||||||
log("Prefix has no tracked_files??")
|
|
||||||
return
|
|
||||||
|
|
||||||
with open(self.tracked_files_file, "r") as tracked_files:
|
|
||||||
dirs = []
|
|
||||||
for f in tracked_files:
|
|
||||||
path = self.prefix_dir + 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(self.tracked_files_file)
|
|
||||||
os.remove(self.version_file)
|
|
||||||
|
|
||||||
def upgrade_pfx(self, old_ver):
|
|
||||||
#if old_ver == CURRENT_PREFIX_VERSION:
|
|
||||||
# return
|
|
||||||
|
|
||||||
#replace broken .NET installations with wine-mono support
|
|
||||||
if os.path.exists(self.prefix_dir + "/drive_c/windows/Microsoft.NET/NETFXRepair.exe") and \
|
|
||||||
file_is_wine_fake_dll(self.prefix_dir + "/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(self.prefix_dir + "/drive_c/windows/Microsoft.NET")
|
|
||||||
|
|
||||||
#fix mono and gecko
|
|
||||||
if os.path.exists(self.prefix_dir + "/drive_c/windows/mono"):
|
|
||||||
shutil.rmtree(self.prefix_dir + "/drive_c/windows/mono")
|
|
||||||
if os.path.exists(self.prefix_dir + "/drive_c/windows/system32/gecko"):
|
|
||||||
shutil.rmtree(self.prefix_dir + "/drive_c/windows/system32/gecko")
|
|
||||||
if os.path.exists(self.prefix_dir + "/drive_c/windows/syswow64/gecko"):
|
|
||||||
shutil.rmtree(self.prefix_dir + "/drive_c/windows/syswow64/gecko")
|
|
||||||
|
|
||||||
def copy_pfx(self):
|
|
||||||
with open(self.tracked_files_file, "w") as tracked_files:
|
|
||||||
for src_dir, dirs, files in os.walk(g_proton.default_pfx_dir):
|
|
||||||
rel_dir = src_dir.replace(g_proton.default_pfx_dir, "", 1).lstrip('/')
|
|
||||||
if len(rel_dir) > 0:
|
|
||||||
rel_dir = rel_dir + "/"
|
|
||||||
dst_dir = src_dir.replace(g_proton.default_pfx_dir, self.prefix_dir, 1)
|
|
||||||
if not os.path.exists(dst_dir):
|
|
||||||
os.makedirs(dst_dir)
|
|
||||||
tracked_files.write(rel_dir + "\n")
|
|
||||||
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)
|
|
||||||
tracked_files.write(rel_dir + file_ + "\n")
|
|
||||||
|
|
||||||
def create_fonts_symlinks(self):
|
def create_fonts_symlinks(self):
|
||||||
fontsmap = [
|
fontsmap = [
|
||||||
( "LiberationSans-Regular.ttf", "arial.ttf" ),
|
( "LiberationSans-Regular.ttf", "arial.ttf" ),
|
||||||
@ -217,63 +131,89 @@ class CompatData:
|
|||||||
os.symlink(fname, lname)
|
os.symlink(fname, lname)
|
||||||
|
|
||||||
def setup_prefix(self):
|
def setup_prefix(self):
|
||||||
with self.prefix_lock:
|
if not os.path.exists(self.prefix_dir):
|
||||||
if os.path.exists(self.version_file):
|
makedirs(self.prefix_dir + "/drive_c")
|
||||||
with open(self.version_file, "r") as f:
|
set_dir_casefold_bit(self.prefix_dir + "/drive_c")
|
||||||
self.upgrade_pfx(f.readline().strip())
|
|
||||||
else:
|
|
||||||
self.upgrade_pfx(None)
|
|
||||||
|
|
||||||
if not os.path.exists(self.prefix_dir):
|
use_wined3d = "wined3d" in g_session.compat_config
|
||||||
makedirs(self.prefix_dir + "/drive_c")
|
use_dxvk_dxgi = "WINEDLLOVERRIDES" in g_session.env and "dxgi=n" in g_session.env["WINEDLLOVERRIDES"]
|
||||||
set_dir_casefold_bit(self.prefix_dir + "/drive_c")
|
|
||||||
|
|
||||||
if not os.path.exists(self.prefix_dir + "/user.reg"):
|
builtin_dll_copy = os.environ.get("PROTON_DLL_COPY",
|
||||||
self.copy_pfx()
|
#dxsetup redist
|
||||||
|
"d3dcompiler_*.dll," +
|
||||||
|
"d3dcsx*.dll," +
|
||||||
|
"d3dx*.dll," +
|
||||||
|
"x3daudio*.dll," +
|
||||||
|
"xactengine*.dll," +
|
||||||
|
"xapofx*.dll," +
|
||||||
|
"xaudio*.dll," +
|
||||||
|
"xinput*.dll," +
|
||||||
|
|
||||||
with open(self.version_file, "w") as f:
|
#vcruntime redist
|
||||||
f.write(CURRENT_PREFIX_VERSION + "\n")
|
"atl1*.dll," +
|
||||||
|
"concrt1*.dll," +
|
||||||
|
"msvcp1*.dll," +
|
||||||
|
"msvcr1*.dll," +
|
||||||
|
"vcamp1*.dll," +
|
||||||
|
"vcomp1*.dll," +
|
||||||
|
"vccorlib1*.dll," +
|
||||||
|
"vcruntime1*.dll," +
|
||||||
|
"api-ms-win-crt-conio-l1-1-0.dll," +
|
||||||
|
"api-ms-win-crt-heap-l1-1-0.dll," +
|
||||||
|
"api-ms-win-crt-locale-l1-1-0.dll," +
|
||||||
|
"api-ms-win-crt-math-l1-1-0.dll," +
|
||||||
|
"api-ms-win-crt-runtime-l1-1-0.dll," +
|
||||||
|
"api-ms-win-crt-stdio-l1-1-0.dll," +
|
||||||
|
"ucrtbase.dll," +
|
||||||
|
|
||||||
#create font files symlinks
|
#some games balk at ntdll symlink(?)
|
||||||
self.create_fonts_symlinks()
|
"ntdll.dll," +
|
||||||
|
|
||||||
#copy openvr files into place
|
#some games require official vulkan loader
|
||||||
dst = self.prefix_dir + "/drive_c/vrclient/bin/"
|
"vulkan-1.dll"
|
||||||
makedirs(dst)
|
)
|
||||||
try_copy(g_proton.lib_dir + "wine/fakedlls/vrclient.dll", dst)
|
|
||||||
try_copy(g_proton.lib64_dir + "wine/fakedlls/vrclient_x64.dll", dst)
|
|
||||||
try_copy(g_proton.lib_dir + "wine/dxvk/openvr_api_dxvk.dll", self.prefix_dir + "/drive_c/windows/syswow64/")
|
|
||||||
try_copy(g_proton.lib64_dir + "wine/dxvk/openvr_api_dxvk.dll", self.prefix_dir + "/drive_c/windows/system32/")
|
|
||||||
|
|
||||||
if "wined3d" in g_session.compat_config:
|
#create font files symlinks
|
||||||
dxvkfiles = ["dxvk_config"]
|
self.create_fonts_symlinks()
|
||||||
wined3dfiles = ["d3d11", "d3d10", "d3d10core", "d3d10_1", "d3d9"]
|
|
||||||
else:
|
|
||||||
dxvkfiles = ["dxvk_config", "d3d11", "d3d10", "d3d10core", "d3d10_1", "d3d9"]
|
|
||||||
wined3dfiles = []
|
|
||||||
|
|
||||||
#if the user asked for dxvk's dxgi (dxgi=n), then copy it into place
|
#copy openvr files into place
|
||||||
if "PW_DXGI_NATIVE" in os.environ and "1" in os.environ["PW_DXGI_NATIVE"]:
|
dst = self.prefix_dir + "/drive_c/vrclient/bin/"
|
||||||
dxvkfiles.append("dxgi")
|
makedirs(dst)
|
||||||
else:
|
try_copy(g_proton.lib_dir + "wine/fakedlls/vrclient.dll", dst)
|
||||||
wined3dfiles.append("dxgi")
|
try_copy(g_proton.lib64_dir + "wine/fakedlls/vrclient_x64.dll", dst)
|
||||||
|
|
||||||
for f in wined3dfiles:
|
try_copy(g_proton.lib_dir + "wine/dxvk/openvr_api_dxvk.dll", self.prefix_dir + "/drive_c/windows/syswow64/")
|
||||||
try_copy(g_proton.default_pfx_dir + "drive_c/windows/system32/" + f + ".dll",
|
try_copy(g_proton.lib64_dir + "wine/dxvk/openvr_api_dxvk.dll", self.prefix_dir + "/drive_c/windows/system32/")
|
||||||
self.prefix_dir + "drive_c/windows/system32/" + f + ".dll")
|
|
||||||
try_copy(g_proton.default_pfx_dir + "drive_c/windows/syswow64/" + f + ".dll",
|
|
||||||
self.prefix_dir + "drive_c/windows/syswow64/" + f + ".dll")
|
|
||||||
|
|
||||||
for f in dxvkfiles:
|
if use_wined3d:
|
||||||
try_copy(g_proton.lib64_dir + "wine/dxvk/" + f + ".dll",
|
dxvkfiles = ["dxvk_config"]
|
||||||
self.prefix_dir + "drive_c/windows/system32/" + f + ".dll")
|
wined3dfiles = ["d3d11", "d3d10", "d3d10core", "d3d10_1", "d3d9"]
|
||||||
try_copy(g_proton.lib_dir + "wine/dxvk/" + f + ".dll",
|
else:
|
||||||
self.prefix_dir + "drive_c/windows/syswow64/" + f + ".dll")
|
dxvkfiles = ["dxvk_config", "d3d11", "d3d10", "d3d10core", "d3d10_1", "d3d9"]
|
||||||
g_session.dlloverrides[f] = "n"
|
wined3dfiles = []
|
||||||
|
|
||||||
try_copy(g_proton.lib64_dir + "wine/vkd3d-proton/d3d12.dll",
|
#if the user asked for dxvk's dxgi (dxgi=n), then copy it into place
|
||||||
|
if use_dxvk_dxgi:
|
||||||
|
dxvkfiles.append("dxgi")
|
||||||
|
else:
|
||||||
|
wined3dfiles.append("dxgi")
|
||||||
|
|
||||||
|
for f in wined3dfiles:
|
||||||
|
try_copy(g_proton.lib64_dir + "wine/" + f + ".dll",
|
||||||
|
self.prefix_dir + "drive_c/windows/system32/" + f + ".dll")
|
||||||
|
try_copy(g_proton.lib_dir + "wine/" + f + ".dll",
|
||||||
|
self.prefix_dir + "drive_c/windows/syswow64/" + f + ".dll")
|
||||||
|
|
||||||
|
for f in dxvkfiles:
|
||||||
|
try_copy(g_proton.lib64_dir + "wine/dxvk/" + f + ".dll",
|
||||||
|
self.prefix_dir + "drive_c/windows/system32/" + f + ".dll")
|
||||||
|
try_copy(g_proton.lib_dir + "wine/dxvk/" + f + ".dll",
|
||||||
|
self.prefix_dir + "drive_c/windows/syswow64/" + f + ".dll")
|
||||||
|
g_session.dlloverrides[f] = "n"
|
||||||
|
|
||||||
|
try_copy(g_proton.lib64_dir + "wine/vkd3d-proton/d3d12.dll",
|
||||||
self.prefix_dir + "drive_c/windows/system32/d3d12.dll")
|
self.prefix_dir + "drive_c/windows/system32/d3d12.dll")
|
||||||
try_copy(g_proton.lib_dir + "wine/vkd3d-proton/d3d12.dll",
|
try_copy(g_proton.lib_dir + "wine/vkd3d-proton/d3d12.dll",
|
||||||
self.prefix_dir + "drive_c/windows/syswow64/d3d12.dll")
|
self.prefix_dir + "drive_c/windows/syswow64/d3d12.dll")
|
||||||
|
|
||||||
def comma_escaped(s):
|
def comma_escaped(s):
|
||||||
@ -286,41 +226,14 @@ def comma_escaped(s):
|
|||||||
|
|
||||||
class Session:
|
class Session:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.log_file = None
|
|
||||||
self.env = dict(os.environ)
|
self.env = dict(os.environ)
|
||||||
self.dlloverrides = {
|
self.dlloverrides = {
|
||||||
"steam.exe": "n",
|
"dotnetfx35.exe": "b" #replace the broken installer, as does Windows
|
||||||
"steam": "n",
|
|
||||||
"steam2": "n",
|
|
||||||
"steam_api": "n",
|
|
||||||
"steam_api64": "n",
|
|
||||||
"steamwebrtc": "n",
|
|
||||||
"steamservice": "n",
|
|
||||||
"steamclient": "n",
|
|
||||||
"steamclient64": "n"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
self.compat_config = set()
|
self.compat_config = set()
|
||||||
self.cmdlineappend = []
|
self.cmdlineappend = []
|
||||||
|
|
||||||
if "PW_COMPAT_CONFIG" in os.environ:
|
|
||||||
config = os.environ["PW_COMPAT_CONFIG"]
|
|
||||||
|
|
||||||
while config:
|
|
||||||
(cur, sep, config) = config.partition(',')
|
|
||||||
if cur.startswith("cmdlineappend:"):
|
|
||||||
while comma_escaped(cur):
|
|
||||||
(a, b, c) = config.partition(',')
|
|
||||||
cur = cur[:-1] + ',' + a
|
|
||||||
config = c
|
|
||||||
self.cmdlineappend.append(cur[14:].replace('\\\\','\\'))
|
|
||||||
else:
|
|
||||||
self.compat_config.add(cur)
|
|
||||||
|
|
||||||
#turn forcelgadd on by default unless it is disabled in compat config
|
|
||||||
if not "noforcelgadd" in self.compat_config:
|
|
||||||
self.compat_config.add("forcelgadd")
|
|
||||||
|
|
||||||
def init_wine(self):
|
def init_wine(self):
|
||||||
if "HOST_LC_ALL" in self.env and len(self.env["HOST_LC_ALL"]) > 0:
|
if "HOST_LC_ALL" in self.env and len(self.env["HOST_LC_ALL"]) > 0:
|
||||||
#steam sets LC_ALL=C to help some games, but Wine requires the real value
|
#steam sets LC_ALL=C to help some games, but Wine requires the real value
|
||||||
@ -332,6 +245,10 @@ class Session:
|
|||||||
|
|
||||||
self.env.pop("WINEARCH", "")
|
self.env.pop("WINEARCH", "")
|
||||||
|
|
||||||
|
if 'ORIG_'+ld_path_var not in os.environ:
|
||||||
|
# Allow wine to restore this when calling an external app.
|
||||||
|
self.env['ORIG_'+ld_path_var] = os.environ.get(ld_path_var, '')
|
||||||
|
|
||||||
if ld_path_var in os.environ:
|
if ld_path_var in os.environ:
|
||||||
self.env[ld_path_var] = g_proton.lib64_dir + ":" + g_proton.lib_dir + ":" + os.environ[ld_path_var]
|
self.env[ld_path_var] = g_proton.lib64_dir + ":" + g_proton.lib_dir + ":" + os.environ[ld_path_var]
|
||||||
else:
|
else:
|
||||||
@ -365,8 +282,10 @@ class Session:
|
|||||||
def init_session(self):
|
def init_session(self):
|
||||||
self.env["WINEPREFIX"] = g_compatdata.prefix_dir
|
self.env["WINEPREFIX"] = g_compatdata.prefix_dir
|
||||||
|
|
||||||
if "PW_LOG" in os.environ and nonzero(os.environ["PW_LOG"]):
|
#load environment overrides
|
||||||
self.env.setdefault("WINEDEBUG", "fixme-all")
|
|
||||||
|
if "PW_LOG" in self.env and nonzero(self.env["PW_LOG"]):
|
||||||
|
self.env.setdefault("WINEDEBUG", "+timestamp,+pid,+tid,+seh,+debugstr,+loaddll,+mscoree")
|
||||||
self.env.setdefault("DXVK_LOG_LEVEL", "info")
|
self.env.setdefault("DXVK_LOG_LEVEL", "info")
|
||||||
self.env.setdefault("VKD3D_DEBUG", "warn")
|
self.env.setdefault("VKD3D_DEBUG", "warn")
|
||||||
self.env.setdefault("WINE_MONO_TRACE", "E:System.NotImplementedException")
|
self.env.setdefault("WINE_MONO_TRACE", "E:System.NotImplementedException")
|
||||||
@ -402,11 +321,18 @@ class Session:
|
|||||||
self.check_environment("PW_HIDE_NVIDIA_GPU", "hidenvgpu")
|
self.check_environment("PW_HIDE_NVIDIA_GPU", "hidenvgpu")
|
||||||
self.check_environment("PW_VKD3D_FEATURE_LEVEL", "vkd3dfl12")
|
self.check_environment("PW_VKD3D_FEATURE_LEVEL", "vkd3dfl12")
|
||||||
|
|
||||||
if not "noesync" in self.compat_config:
|
if "noesync" in self.compat_config:
|
||||||
self.env["WINEESYNC"] = "1"
|
self.env.pop("WINEESYNC", "")
|
||||||
|
else:
|
||||||
|
self.env["WINEESYNC"] = "1" if "SteamGameId" in self.env else "0"
|
||||||
|
|
||||||
if not "nofsync" in self.compat_config:
|
if "nofsync" in self.compat_config:
|
||||||
self.env["WINEFSYNC"] = "1"
|
self.env.pop("WINEFSYNC", "")
|
||||||
|
else:
|
||||||
|
self.env["WINEFSYNC"] = "1" if "SteamGameId" in self.env else "0"
|
||||||
|
|
||||||
|
if "nowritewatch" in self.compat_config:
|
||||||
|
self.env["WINE_DISABLE_WRITE_WATCH"] = "1"
|
||||||
|
|
||||||
if "oldglstr" in self.compat_config:
|
if "oldglstr" in self.compat_config:
|
||||||
#mesa override
|
#mesa override
|
||||||
@ -414,6 +340,9 @@ class Session:
|
|||||||
#nvidia override
|
#nvidia override
|
||||||
self.env["__GL_ExtensionStringVersion"] = "17700"
|
self.env["__GL_ExtensionStringVersion"] = "17700"
|
||||||
|
|
||||||
|
if "forcelgadd" in self.compat_config:
|
||||||
|
self.env["WINE_LARGE_ADDRESS_AWARE"] = "1"
|
||||||
|
|
||||||
if "vkd3dfl12" in self.compat_config:
|
if "vkd3dfl12" in self.compat_config:
|
||||||
if not "VKD3D_FEATURE_LEVEL" in self.env:
|
if not "VKD3D_FEATURE_LEVEL" in self.env:
|
||||||
self.env["VKD3D_FEATURE_LEVEL"] = "12_0"
|
self.env["VKD3D_FEATURE_LEVEL"] = "12_0"
|
||||||
@ -421,14 +350,8 @@ class Session:
|
|||||||
if "hidenvgpu" in self.compat_config:
|
if "hidenvgpu" in self.compat_config:
|
||||||
self.env["WINE_HIDE_NVIDIA_GPU"] = "1"
|
self.env["WINE_HIDE_NVIDIA_GPU"] = "1"
|
||||||
|
|
||||||
if "forcelgadd" in self.compat_config:
|
else:
|
||||||
self.env["WINE_LARGE_ADDRESS_AWARE"] = "1"
|
self.env["WINEDEBUG"] = "-all"
|
||||||
|
|
||||||
if "dxvkasync" in self.compat_config:
|
|
||||||
self.env["DXVK_ASYNC"] = "1"
|
|
||||||
|
|
||||||
if "pulselowlat" in self.compat_config:
|
|
||||||
self.env["PULSE_LATENCY_MSEC"] = "60"
|
|
||||||
|
|
||||||
g_compatdata.setup_prefix()
|
g_compatdata.setup_prefix()
|
||||||
|
|
||||||
@ -449,14 +372,6 @@ class Session:
|
|||||||
self.dlloverrides["d3d9"] = ""
|
self.dlloverrides["d3d9"] = ""
|
||||||
self.dlloverrides["dxgi"] = ""
|
self.dlloverrides["dxgi"] = ""
|
||||||
|
|
||||||
if "novrclient" in self.compat_config:
|
|
||||||
self.dlloverrides["vrclient"] = ""
|
|
||||||
self.dlloverrides["vrclient_x64"] = ""
|
|
||||||
self.dlloverrides["openvr_api_dxvk"] = ""
|
|
||||||
|
|
||||||
if "nomfplay" in self.compat_config:
|
|
||||||
self.dlloverrides["mfplay"] = "n"
|
|
||||||
|
|
||||||
if "nowritewatch" in self.compat_config:
|
if "nowritewatch" in self.compat_config:
|
||||||
self.env["WINE_DISABLE_WRITE_WATCH"] = "1"
|
self.env["WINE_DISABLE_WRITE_WATCH"] = "1"
|
||||||
|
|
||||||
@ -474,9 +389,8 @@ class Session:
|
|||||||
s = s + ";" + dll + "=" + setting
|
s = s + ";" + dll + "=" + setting
|
||||||
else:
|
else:
|
||||||
s = dll + "=" + setting
|
s = dll + "=" + setting
|
||||||
|
if "WINEDLLOVERRIDES" in self.env:
|
||||||
if "WINEDLLOVERRIDES" in os.environ:
|
self.env["WINEDLLOVERRIDES"] = self.env["WINEDLLOVERRIDES"] + ";" + s
|
||||||
self.env["WINEDLLOVERRIDES"] = os.environ["WINEDLLOVERRIDES"] + ";" + s
|
|
||||||
else:
|
else:
|
||||||
self.env["WINEDLLOVERRIDES"] = s
|
self.env["WINEDLLOVERRIDES"] = s
|
||||||
|
|
||||||
@ -487,9 +401,12 @@ class Session:
|
|||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if "PW_GAMEMODERUN" in os.environ and nonzero(os.environ["PW_GAMEMODERUN"]):
|
if "PW_GAMEMODERUN" in os.environ and nonzero(os.environ["PW_GAMEMODERUN"]):
|
||||||
self.run_proc([g_proton.gamemoderun] + [g_proton.wine_bin] + sys.argv[2:] + sys.argv[3:])
|
self.run_proc([g_proton.gamemoderun] + [g_proton.wine_bin] + sys.argv[2:] + sys.argv[3:] + sys.argv[4:])
|
||||||
else:
|
else:
|
||||||
self.run_proc([g_proton.wine_bin] + sys.argv[2:] + sys.argv[3:])
|
self.run_proc([g_proton.wine_bin] + sys.argv[2:] + sys.argv[3:] + sys.argv[4:])
|
||||||
|
|
||||||
|
def init_run(self):
|
||||||
|
self.run_proc([g_proton.wine_bin] + " wineboot")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
if not "PW_COMPAT_DATA_PATH" in os.environ:
|
if not "PW_COMPAT_DATA_PATH" in os.environ:
|
||||||
@ -504,14 +421,15 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
g_session.init_wine()
|
g_session.init_wine()
|
||||||
|
|
||||||
g_proton.make_default_prefix()
|
|
||||||
|
|
||||||
g_session.init_session()
|
g_session.init_session()
|
||||||
|
|
||||||
#determine mode
|
#determine mode
|
||||||
if sys.argv[1] == "run":
|
if sys.argv[1] == "run":
|
||||||
#start target app
|
#start target app
|
||||||
g_session.run()
|
g_session.run()
|
||||||
|
elif sys.argv[1] == "init_run":
|
||||||
|
#first start
|
||||||
|
g_session.init_run()
|
||||||
elif sys.argv[1] == "waitforexitandrun":
|
elif sys.argv[1] == "waitforexitandrun":
|
||||||
#wait for wineserver to shut down
|
#wait for wineserver to shut down
|
||||||
g_session.run_proc([g_proton.wineserver_bin, "-w"])
|
g_session.run_proc([g_proton.wineserver_bin, "-w"])
|
||||||
@ -519,11 +437,11 @@ if __name__ == "__main__":
|
|||||||
g_session.run()
|
g_session.run()
|
||||||
elif sys.argv[1] == "getcompatpath":
|
elif sys.argv[1] == "getcompatpath":
|
||||||
#linux -> windows path
|
#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)
|
path = subprocess.check_output([g_proton.wine_bin, "winepath", "-w", sys.argv[2]], env=g_session.env)
|
||||||
sys.stdout.buffer.write(path)
|
sys.stdout.buffer.write(path)
|
||||||
elif sys.argv[1] == "getnativepath":
|
elif sys.argv[1] == "getnativepath":
|
||||||
#windows -> linux path
|
#windows -> linux path
|
||||||
path = subprocess.check_output([g_proton.wine_bin, "winepath", sys.argv[2]], env=g_session.env, stderr=g_session.log_file)
|
path = subprocess.check_output([g_proton.wine_bin, "winepath", sys.argv[2]], env=g_session.env)
|
||||||
sys.stdout.buffer.write(path)
|
sys.stdout.buffer.write(path)
|
||||||
else:
|
else:
|
||||||
log("Need a verb.")
|
log("Need a verb.")
|
||||||
|
@ -42,10 +42,10 @@ start_settings=`zenity --title "${ss_title}" --text "${ss_text}" --list --radio
|
|||||||
if [ ! -z $hud_settings ]; then
|
if [ ! -z $hud_settings ]; then
|
||||||
for hud_set in $hud_settings
|
for hud_set in $hud_settings
|
||||||
do
|
do
|
||||||
echo "${hud_set}" >> "${config_path}/dxvk_on_shortcut"
|
echo "${hud_set}" >> "${PORT_WINE_TMP_PATH}/dxvk_on_shortcut"
|
||||||
done
|
done
|
||||||
sed -i "s/|/,/g" "${config_path}/dxvk_on_shortcut"
|
sed -i "s/|/,/g" "${PORT_WINE_TMP_PATH}/dxvk_on_shortcut"
|
||||||
read "hud_set" < "${config_path}/dxvk_on_shortcut"
|
read "hud_set" < "${PORT_WINE_TMP_PATH}/dxvk_on_shortcut"
|
||||||
export dxvk_ogl_var="$hud_set"
|
export dxvk_ogl_var="$hud_set"
|
||||||
else
|
else
|
||||||
dxvk_ogl_var="0"
|
dxvk_ogl_var="0"
|
||||||
|
@ -7,7 +7,7 @@ echo "${port_deb1}" > "${PORT_WINE_PATH}/${portname}.log"
|
|||||||
echo "${port_deb2}" >> "${PORT_WINE_PATH}/${portname}.log"
|
echo "${port_deb2}" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||||
echo "--------------------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
echo "--------------------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||||
echo "PortWINE version:" >> "${PORT_WINE_PATH}/${portname}.log"
|
echo "PortWINE version:" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||||
read install_ver < "${config_path}/${portname}_ver"
|
read install_ver < "${PORT_WINE_TMP_PATH}/${portname}_ver"
|
||||||
echo "${portname}-${install_ver}" >> "${PORT_WINE_PATH}/${portname}.log"
|
echo "${portname}-${install_ver}" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||||
echo "-------------------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
echo "-------------------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||||
echo "var_dxvk_on = ${var_dxvk_on}" >> "${PORT_WINE_PATH}/${portname}.log"
|
echo "var_dxvk_on = ${var_dxvk_on}" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Author: PortWINE-Linux.ru
|
# Author: PortWINE-Linux.ru
|
||||||
|
|
||||||
read "update_loc" < "${config_path}/${portname}_loc"
|
read "update_loc" < "${PORT_WINE_TMP_PATH}/${portname}_loc"
|
||||||
export update_loc=${update_loc}
|
export update_loc=${update_loc}
|
||||||
|
|
||||||
if [ "${update_loc}" = "RUS" ]
|
if [ "${update_loc}" = "RUS" ]
|
||||||
|
@ -1,25 +1,25 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Author: PortWINE-Linux.ru
|
# Author: PortWINE-Linux.ru
|
||||||
|
|
||||||
if [ ! -f "${config_path}/${portname}_ver" ]
|
if [ ! -f "${PORT_WINE_TMP_PATH}/${portname}_ver" ]
|
||||||
then
|
then
|
||||||
echo "10" > "${config_path}/${portname}_ver"
|
echo "10" > "${PORT_WINE_TMP_PATH}/${portname}_ver"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "${config_path}/update_notifier" ]
|
if [ ! -f "${PORT_WINE_TMP_PATH}/update_notifier" ]
|
||||||
then
|
then
|
||||||
echo "1" > "${config_path}/update_notifier"
|
echo "1" > "${PORT_WINE_TMP_PATH}/update_notifier"
|
||||||
fi
|
fi
|
||||||
read "update_not" < "${config_path}/update_notifier"
|
read "update_not" < "${PORT_WINE_TMP_PATH}/update_notifier"
|
||||||
if [ "${update_not}" = "1" ]
|
if [ "${update_not}" = "1" ]
|
||||||
then
|
then
|
||||||
wget -T 2 --output-document="${config_path}/${portname}_cur_ver" "http://portwine-linux.ru/current_version/${portname}_ver"
|
wget -T 2 --output-document="${PORT_WINE_TMP_PATH}/${portname}_cur_ver" "http://portwine-linux.ru/current_version/${portname}_ver"
|
||||||
sleep 1
|
sleep 1
|
||||||
if [ -f "${config_path}/${portname}_ver" ]
|
if [ -f "${PORT_WINE_TMP_PATH}/${portname}_ver" ]
|
||||||
then
|
then
|
||||||
read current_ver < "${config_path}/${portname}_cur_ver"
|
read current_ver < "${PORT_WINE_TMP_PATH}/${portname}_cur_ver"
|
||||||
read install_ver < "${config_path}/${portname}_ver"
|
read install_ver < "${PORT_WINE_TMP_PATH}/${portname}_ver"
|
||||||
rm -f "${config_path}/${portname}_cur_ver"
|
rm -f "${PORT_WINE_TMP_PATH}/${portname}_cur_ver"
|
||||||
if [ "${current_ver}" -gt "${install_ver}" ]
|
if [ "${current_ver}" -gt "${install_ver}" ]
|
||||||
then
|
then
|
||||||
xsd=`zenity --title "${port_upd1}" --text "${port_upd2}" --list --radiolist --height=220 --column="${inst_set}" --column "${port_upd3}" \
|
xsd=`zenity --title "${port_upd1}" --text "${port_upd2}" --list --radiolist --height=220 --column="${inst_set}" --column "${port_upd3}" \
|
||||||
@ -34,7 +34,7 @@ then
|
|||||||
"${port_upd5}")
|
"${port_upd5}")
|
||||||
echo " " ;;
|
echo " " ;;
|
||||||
"${port_upd6}")
|
"${port_upd6}")
|
||||||
echo "0" > "${config_path}/update_notifier" ;;
|
echo "0" > "${PORT_WINE_TMP_PATH}/update_notifier" ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -6,9 +6,9 @@ if [ -f "$1" ]; then
|
|||||||
export PATH_TO_GAME="$( cd "$( dirname "$1" )" >/dev/null 2>&1 && pwd )"
|
export PATH_TO_GAME="$( cd "$( dirname "$1" )" >/dev/null 2>&1 && pwd )"
|
||||||
START_PORTWINE
|
START_PORTWINE
|
||||||
if [ ! -z ${optirun_on} ]; then
|
if [ ! -z ${optirun_on} ]; then
|
||||||
$PW_TERM ${optirun_on} "${port_on_run}" "run" "$portwine_exe"
|
"${PW_RUNTIME}" $PW_TERM ${optirun_on} "${port_on_run}" "run" "$portwine_exe"
|
||||||
else
|
else
|
||||||
$PW_TERM "${port_on_run}" "run" "$portwine_exe"
|
"${PW_RUNTIME}" $PW_TERM "${port_on_run}" "run" "$portwine_exe"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
START_PORTWINE
|
START_PORTWINE
|
||||||
|
@ -6,8 +6,8 @@ wine_pids=$(ls -l /proc/*/exe 2>/dev/null | grep -E 'wine(64)?-preloader|wineser
|
|||||||
if ! [ -z "${wine_pids}" ] ; then
|
if ! [ -z "${wine_pids}" ] ; then
|
||||||
kill -9 ${wine_pids}
|
kill -9 ${wine_pids}
|
||||||
fi
|
fi
|
||||||
if [ -e "${config_path}/dxvk_on" ]; then
|
if [ -e "${PORT_WINE_TMP_PATH}/dxvk_on" ]; then
|
||||||
rm -f "${config_path}/dxvk_on"
|
rm -f "${PORT_WINE_TMP_PATH}/dxvk_on"
|
||||||
fi
|
fi
|
||||||
START_PORTWINE
|
START_PORTWINE
|
||||||
STOP_PORTWINE | pwzen
|
STOP_PORTWINE | pwzen
|
||||||
|
@ -1,6 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Author: PortWINE-Linux.ru
|
# Author: PortWINE-Linux.ru
|
||||||
########################################################################
|
########################################################################
|
||||||
|
clear && echo '
|
||||||
|
████─████─████─███─█───█─███─█──█─███
|
||||||
|
█──█─█──█─█──█──█──█───█──█──██─█─█
|
||||||
|
████─█──█─████──█──█─█─█──█──█─██─███
|
||||||
|
█────█──█─█─█───█──█████──█──█──█─█
|
||||||
|
█────████─█─█───█───█─█──███─█──█─███
|
||||||
|
|
||||||
|
'
|
||||||
|
########################################################################
|
||||||
[ $(id -u) = 0 ] && echo "Do not run this script as root!" && zenity --error --text "Do not run this script as root!" && exit 1
|
[ $(id -u) = 0 ] && echo "Do not run this script as root!" && zenity --error --text "Do not run this script as root!" && exit 1
|
||||||
########################################################################
|
########################################################################
|
||||||
sszen() {
|
sszen() {
|
||||||
@ -20,29 +29,30 @@ export portname
|
|||||||
cd "${PORT_SCRIPTS_PATH}"
|
cd "${PORT_SCRIPTS_PATH}"
|
||||||
. "${PORT_SCRIPTS_PATH}/vars/${portname}_vars"
|
. "${PORT_SCRIPTS_PATH}/vars/${portname}_vars"
|
||||||
########################################################################
|
########################################################################
|
||||||
export config_path="${PORT_WINE_PATH}/data/tmp"
|
export PORT_WINE_TMP_PATH="${PORT_WINE_PATH}/data/tmp"
|
||||||
if [ ! -d "${config_path}" ]; then
|
if [ ! -d "${PORT_WINE_TMP_PATH}" ]; then
|
||||||
mkdir -p "${config_path}"
|
mkdir -p "${PORT_WINE_TMP_PATH}"
|
||||||
fi
|
fi
|
||||||
if [ ! -d "${HOME}/.PortWINE/tmp" ]; then
|
if [ ! -d "${HOME}/.PortWINE/tmp" ]; then
|
||||||
mkdir -p "${HOME}/.PortWINE/tmp"
|
mkdir -p "${HOME}/.PortWINE/tmp"
|
||||||
fi
|
fi
|
||||||
if [ ! -e "${config_path}/${portname}_loc" ]; then
|
if [ ! -e "${PORT_WINE_TMP_PATH}/${portname}_loc" ]; then
|
||||||
SET_LANG=`zenity --title "Install $portname" --text "Select the language" --list --radiolist \
|
SET_LANG=`zenity --title "Install $portname" --text "Select the language" --list --radiolist \
|
||||||
--column="Set:" --column "Language:" \
|
--column="Set:" --column "Language:" \
|
||||||
TRUE "RUS" \
|
TRUE "RUS" \
|
||||||
FALSE "ENG" `
|
FALSE "ENG" `
|
||||||
echo "${SET_LANG}" > "${config_path}/${portname}_loc"
|
echo "${SET_LANG}" > "${PORT_WINE_TMP_PATH}/${portname}_loc"
|
||||||
fi
|
fi
|
||||||
########################################################################
|
########################################################################
|
||||||
. "${PORT_SCRIPTS_PATH}"/lang
|
. "${PORT_SCRIPTS_PATH}"/lang
|
||||||
if [ ! -e "${config_path}/${portname}_ver" ]; then
|
if [ ! -e "${PORT_WINE_TMP_PATH}/${portname}_ver" ]; then
|
||||||
echo "10" > "${config_path}/${portname}_ver"
|
echo "10" > "${PORT_WINE_TMP_PATH}/${portname}_ver"
|
||||||
fi
|
fi
|
||||||
########################################################################
|
########################################################################
|
||||||
|
export pw_libs_ver="_v2"
|
||||||
export port_on_run="${PORT_WINE_PATH}/data/port_on"
|
export port_on_run="${PORT_WINE_PATH}/data/port_on"
|
||||||
export WINEDIR="${PORT_WINE_PATH}"/data/dist
|
export WINEDIR="${PORT_WINE_PATH}"/data/dist
|
||||||
export WINELIB="${HOME}/.PortWINE/libs"
|
export WINELIB="${HOME}/.PortWINE/libs${pw_libs_ver}"
|
||||||
export WINEARCH=win64
|
export WINEARCH=win64
|
||||||
export WINELOADER="${WINEDIR}/bin/wine"
|
export WINELOADER="${WINEDIR}/bin/wine"
|
||||||
export WINEDLLPATH="${WINEDIR}/lib64/wine:${WINEDIR}/lib/wine"
|
export WINEDLLPATH="${WINEDIR}/lib64/wine:${WINEDIR}/lib/wine"
|
||||||
@ -52,11 +62,18 @@ export PATH="${WINEDIR}/bin:${PATH}"
|
|||||||
export WINESTART="C:\\windows\\command\\start.exe"
|
export WINESTART="C:\\windows\\command\\start.exe"
|
||||||
export PW_COMPAT_DATA_PATH="${PORT_WINE_PATH}/data/"
|
export PW_COMPAT_DATA_PATH="${PORT_WINE_PATH}/data/"
|
||||||
export PW_COMPAT_MEDIA_PATH="${PW_COMPAT_MEDIA_PATH}"
|
export PW_COMPAT_MEDIA_PATH="${PW_COMPAT_MEDIA_PATH}"
|
||||||
|
export PW_RUNTIME="$WINELIB/run.sh"
|
||||||
########################################################################
|
########################################################################
|
||||||
export urlg="https://portwine-linux.ru/portwine-faq/"
|
export urlg="https://portwine-linux.ru/portwine-faq/"
|
||||||
export PW_FTP_URL="https://portwine-linux.ru/ftp"
|
export PW_FTP_URL="https://portwine-linux.ru/ftp"
|
||||||
########################################################################
|
########################################################################
|
||||||
export PW_TERM=""
|
export PW_TERM=""
|
||||||
|
#if [ ! -f "${PORT_WINE_TMP_PATH}/init_run_suc" ]; then
|
||||||
|
# export PW_USE_TERMINAL="1"
|
||||||
|
#fi
|
||||||
|
########################################################################
|
||||||
|
START_PORTWINE ()
|
||||||
|
{
|
||||||
if [ "${PW_USE_TERMINAL}" = "1" ]; then
|
if [ "${PW_USE_TERMINAL}" = "1" ]; then
|
||||||
if [ -x "`which konsole 2>/dev/null`" ]; then
|
if [ -x "`which konsole 2>/dev/null`" ]; then
|
||||||
export PW_TERM="konsole -e"
|
export PW_TERM="konsole -e"
|
||||||
@ -70,38 +87,25 @@ if [ "${PW_USE_TERMINAL}" = "1" ]; then
|
|||||||
# export PW_TERM="xfce4-terminal -x" #test
|
# export PW_TERM="xfce4-terminal -x" #test
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
########################################################################
|
|
||||||
START_PORTWINE ()
|
|
||||||
{
|
|
||||||
sh "${PORT_SCRIPTS_PATH}"/port_update
|
sh "${PORT_SCRIPTS_PATH}"/port_update
|
||||||
echo "########################"
|
########################################################################
|
||||||
if [ ! -d "${WINELIB}" ]; then
|
if [ ! -d "${WINELIB}" ]; then
|
||||||
echo "Download and install libraries..."
|
echo "Download and install libraries..."
|
||||||
wget -T 2 --output-document="${HOME}/.PortWINE/tmp/libs.tar.xz" "${PW_FTP_URL}"/dist/libs.tar.xz | sszen &&
|
wget -T 2 --output-document="${HOME}/.PortWINE/tmp/libs${pw_libs_ver}.tar.xz" "${PW_FTP_URL}"/dist/libs${pw_libs_ver}.tar.xz | sszen &&
|
||||||
tar -Jxvf "${HOME}/.PortWINE/tmp/libs.tar.xz" -C "${HOME}/.PortWINE/" | sszen &&
|
tar -Jxvf "${HOME}/.PortWINE/tmp/libs${pw_libs_ver}.tar.xz" -C "${HOME}/.PortWINE/" | sszen &&
|
||||||
rm -f "${HOME}/.PortWINE/tmp/libs.tar.xz"
|
rm -f "${HOME}/.PortWINE/tmp/libs${pw_libs_ver}.tar.xz"
|
||||||
|
"${WINELIB}"/setup.sh --force
|
||||||
fi
|
fi
|
||||||
if [ -d "${WINELIB}" ]; then
|
if [ -d "${WINELIB}" ]; then
|
||||||
host_lib_paths=
|
echo "######################################################"
|
||||||
/sbin/ldconfig -XNv | grep "/" | cut -d: -f1 1> "${config_path}"/default_lib_paths
|
|
||||||
while read lib_path_prefix; do
|
|
||||||
export host_lib_paths=$host_lib_paths$lib_path_prefix:
|
|
||||||
done < "${config_path}"/default_lib_paths
|
|
||||||
host_lib_paths="${WINELIB}/pinned_libs_32:${WINELIB}/pinned_libs_64:$host_lib_paths"
|
|
||||||
portwine_runtime_libs_paths="$host_lib_paths${WINELIB}/lib/i386-linux-gnu:${WINELIB}/usr/lib/i386-linux-gnu:${WINELIB}/lib/x86_64-linux-gnu:${WINELIB}/usr/lib/x86_64-linux-gnu:${WINELIB}/lib:${WINELIB}/usr/lib"
|
|
||||||
if [ ! -z $LD_LIBRARY_PATH ]; then
|
|
||||||
export LD_LIBRARY_PATH="$portwine_runtime_libs_paths:${LD_LIBRARY_PATH-}"
|
|
||||||
else
|
|
||||||
export LD_LIBRARY_PATH="$portwine_runtime_libs_paths"
|
|
||||||
fi
|
|
||||||
echo "########################"
|
|
||||||
echo "Runtime libraries is enabled"
|
echo "Runtime libraries is enabled"
|
||||||
|
# "${PW_RUNTIME}" --print-steam-runtime-library-paths
|
||||||
else
|
else
|
||||||
echo "########################"
|
echo "######################################################"
|
||||||
echo "Runtime libraries is disabled"
|
echo "Runtime libraries is disabled"
|
||||||
fi
|
fi
|
||||||
########################################################################
|
########################################################################
|
||||||
if [ ! -f "${config_path}/dxvk_on" ]
|
if [ ! -f "${PORT_WINE_TMP_PATH}/dxvk_on" ]
|
||||||
then
|
then
|
||||||
start_settings=`zenity --title "${ss_title}" --text "${ss_text}" --list --radiolist \
|
start_settings=`zenity --title "${ss_title}" --text "${ss_text}" --list --radiolist \
|
||||||
--column="${inst_set}" --column "${ss_ver}" --column "${ss_dr}" --width=500 --height=220 \
|
--column="${inst_set}" --column "${ss_ver}" --column "${ss_dr}" --width=500 --height=220 \
|
||||||
@ -110,7 +114,7 @@ then
|
|||||||
if [ $? -eq 1 ];then exit 1; fi
|
if [ $? -eq 1 ];then exit 1; fi
|
||||||
case $start_settings in
|
case $start_settings in
|
||||||
"VKD3D and OpenGL")
|
"VKD3D and OpenGL")
|
||||||
echo "off" > "${config_path}/dxvk_on" ;;
|
echo "off" > "${PORT_WINE_TMP_PATH}/dxvk_on" ;;
|
||||||
"DXVK")
|
"DXVK")
|
||||||
hud_settings=`zenity --list --title "HUD" --text "${hud_text}" --list --checklist \
|
hud_settings=`zenity --list --title "HUD" --text "${hud_text}" --list --checklist \
|
||||||
--column="${inst_set}" --column="HUD info:" --column="${hud_info}" --width=800 --height=550 \
|
--column="${inst_set}" --column="HUD info:" --column="${hud_info}" --width=800 --height=550 \
|
||||||
@ -130,11 +134,11 @@ then
|
|||||||
if [ ! -z $hud_settings ]; then
|
if [ ! -z $hud_settings ]; then
|
||||||
for hud_set in $hud_settings
|
for hud_set in $hud_settings
|
||||||
do
|
do
|
||||||
echo "${hud_set}" >> "${config_path}/dxvk_on"
|
echo "${hud_set}" >> "${PORT_WINE_TMP_PATH}/dxvk_on"
|
||||||
done
|
done
|
||||||
sed -i "s/|/,/g" "${config_path}/dxvk_on"
|
sed -i "s/|/,/g" "${PORT_WINE_TMP_PATH}/dxvk_on"
|
||||||
else
|
else
|
||||||
echo "0" > "${config_path}/dxvk_on"
|
echo "0" > "${PORT_WINE_TMP_PATH}/dxvk_on"
|
||||||
fi ;;
|
fi ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
@ -142,7 +146,7 @@ fi
|
|||||||
if [ ! -z $dxvk_ogl_var ]; then
|
if [ ! -z $dxvk_ogl_var ]; then
|
||||||
var_dxvk_on="${dxvk_ogl_var}"
|
var_dxvk_on="${dxvk_ogl_var}"
|
||||||
else
|
else
|
||||||
read "var_dxvk_on" < "${config_path}/dxvk_on"
|
read "var_dxvk_on" < "${PORT_WINE_TMP_PATH}/dxvk_on"
|
||||||
fi
|
fi
|
||||||
export DXVK_HUD="${var_dxvk_on}"
|
export DXVK_HUD="${var_dxvk_on}"
|
||||||
echo "DXVK_HUD=${DXVK_HUD}"
|
echo "DXVK_HUD=${DXVK_HUD}"
|
||||||
@ -150,7 +154,6 @@ echo "DXVK_HUD=${DXVK_HUD}"
|
|||||||
if [ "${var_dxvk_on}" != "off" ]; then
|
if [ "${var_dxvk_on}" != "off" ]; then
|
||||||
export PW_USE_WINED3D=0
|
export PW_USE_WINED3D=0
|
||||||
echo "Use DXVK and D9VK (DX9-DX11 to Vulkan)"
|
echo "Use DXVK and D9VK (DX9-DX11 to Vulkan)"
|
||||||
export PW_VKD3D_FEATURE_LEVEL=0
|
|
||||||
else
|
else
|
||||||
export PW_USE_WINED3D=1
|
export PW_USE_WINED3D=1
|
||||||
echo "Use OpenGL and VKD3D (DX9-DX11 to OpenGL and DX12 to vulkan)"
|
echo "Use OpenGL and VKD3D (DX9-DX11 to OpenGL and DX12 to vulkan)"
|
||||||
@ -201,10 +204,6 @@ case "$PW_FORCE_USE_VSYNC" in # 0-FORCE_OFF, 1-FORCE_ON, 2-BY_DEFAULT
|
|||||||
esac
|
esac
|
||||||
export DXVK_CONFIG_FILE="${PORT_WINE_PATH}/data/dxvk.conf"
|
export DXVK_CONFIG_FILE="${PORT_WINE_PATH}/data/dxvk.conf"
|
||||||
########################################################################
|
########################################################################
|
||||||
export def_pfx="${PORT_WINE_PATH}/data/dist/share/default_pfx/"
|
|
||||||
if [ ! -d "${def_pfx}" ]; then
|
|
||||||
"${port_on_run}" "run" | pwzen
|
|
||||||
fi
|
|
||||||
export int_xneur=0
|
export int_xneur=0
|
||||||
if [ $(pgrep xneur)>'0' ]; then
|
if [ $(pgrep xneur)>'0' ]; then
|
||||||
killall xneur
|
killall xneur
|
||||||
@ -224,7 +223,28 @@ else
|
|||||||
export PW_GAMEMODERUN=0
|
export PW_GAMEMODERUN=0
|
||||||
echo "Gamemod is not installed or disabled in vars script: PW_FORCE_DISABLED_GAMEMOD=$PW_FORCE_DISABLED_GAMEMOD"
|
echo "Gamemod is not installed or disabled in vars script: PW_FORCE_DISABLED_GAMEMOD=$PW_FORCE_DISABLED_GAMEMOD"
|
||||||
fi
|
fi
|
||||||
echo "########################"
|
echo "######################################################"
|
||||||
|
########################################################################
|
||||||
|
if [ ! -d "${WINEPREFIX}" ] || [ ! -d "${WINEPREFIX}"/dosdevices ] || [ ! -d "${WINEPREFIX}"/drive_c/windows ] || [ ! -f "${WINEPREFIX}"/system.reg ] || [ ! -f "${WINEPREFIX}"/user.reg ] || [ ! -f "${WINEPREFIX}"/userdef.reg ]; then
|
||||||
|
"${PW_RUNTIME}" $PW_TERM "${WINELOADER}" wineboot -u
|
||||||
|
fi
|
||||||
|
########################################################################
|
||||||
|
#if [ ! -f "${PORT_WINE_TMP_PATH}/init_run_suc" ]; then
|
||||||
|
# "${PW_RUNTIME}" "${port_on_run}" "init_run"
|
||||||
|
# if [ -f "${PORT_WINE_TMP_PATH}"/winetricks ]; then
|
||||||
|
# rm -f "${PORT_WINE_TMP_PATH}"/winetricks
|
||||||
|
# fi
|
||||||
|
# wget -T 3 --output-document=${PORT_WINE_TMP_PATH}/winetricks https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
|
||||||
|
# chmod +x "${PORT_WINE_TMP_PATH}/winetricks"
|
||||||
|
# PW_INIT_RUN
|
||||||
|
# echo "#####################PW_INIT_RUN######################"
|
||||||
|
# cat "${PORT_WINE_TMP_PATH}/init_run_suc"
|
||||||
|
# echo "######################################################"
|
||||||
|
#fi
|
||||||
|
########################################################################
|
||||||
|
cp -f "${WINEDIR}/lib/wine/fakedlls/dxgi.dll" "${WINEDIR}/lib/wine/dxgi.dll"
|
||||||
|
cp -f "${WINEDIR}/lib64/wine/fakedlls/dxgi.dll" "${WINEDIR}/lib64/wine/dxgi.dll"
|
||||||
|
|
||||||
ADD_IN_START_PORTWINE
|
ADD_IN_START_PORTWINE
|
||||||
}
|
}
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@ -3,13 +3,8 @@
|
|||||||
. "$(dirname $(readlink -f "$0"))/runlib"
|
. "$(dirname $(readlink -f "$0"))/runlib"
|
||||||
|
|
||||||
rm -f "${PORT_WINE_PATH}/"*".log"
|
rm -f "${PORT_WINE_PATH}/"*".log"
|
||||||
rm -f "${PORT_WINE_PATH}/data/"*".lock"
|
rm -f "${PORT_WINE_TMP_PATH}/update_notifier"
|
||||||
|
rm -f "${PORT_WINE_TMP_PATH}/init_run_suc"
|
||||||
rm -f "${config_path}/update_notifier"
|
|
||||||
|
|
||||||
if [ -d "${PORT_WINE_PATH}/data/__pycache__" ]; then
|
|
||||||
rm -fr "${PORT_WINE_PATH}/data/__pycache__"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -d "/home/${USER}/.local/share/applications" ]
|
if [ ! -d "/home/${USER}/.local/share/applications" ]
|
||||||
then
|
then
|
||||||
@ -121,7 +116,6 @@ fi
|
|||||||
if [ -f "${PORT_WINE_PATH}/restart.desktop" ]; then
|
if [ -f "${PORT_WINE_PATH}/restart.desktop" ]; then
|
||||||
rm "${PORT_WINE_PATH}/restart.desktop"
|
rm "${PORT_WINE_PATH}/restart.desktop"
|
||||||
fi
|
fi
|
||||||
START_PORTWINE
|
|
||||||
ADD_IN_POST_INSTALL
|
|
||||||
|
|
||||||
|
update-desktop-database -q "${HOME}/.local/share/applications"
|
||||||
xdg-open "http://portwine-linux.ru/portwine-faq/" > /dev/null 2>&1 & exit 0
|
xdg-open "http://portwine-linux.ru/portwine-faq/" > /dev/null 2>&1 & exit 0
|
||||||
|
@ -6,15 +6,15 @@ START_PORTWINE
|
|||||||
|
|
||||||
if [ ! -z "$1" ]; then
|
if [ ! -z "$1" ]; then
|
||||||
if [ ! -z $optirun_on ]; then
|
if [ ! -z $optirun_on ]; then
|
||||||
$PW_TERM ${optirun_on} "${port_on_run}" "run" "$1"
|
"${PW_RUNTIME}" $PW_TERM ${optirun_on} "${port_on_run}" "run" "$1"
|
||||||
else
|
else
|
||||||
$PW_TERM "${port_on_run}" "run" "$1"
|
"${PW_RUNTIME}" $PW_TERM "${port_on_run}" "run" "$1"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [ ! -z $optirun_on ]; then
|
if [ ! -z $optirun_on ]; then
|
||||||
$PW_TERM ${optirun_on} "${port_on_run}" "run" "${gamestart}" ${launch_parameters}
|
"${PW_RUNTIME}" $PW_TERM ${optirun_on} "${port_on_run}" "run" "${gamestart}" ${launch_parameters}
|
||||||
else
|
else
|
||||||
$PW_TERM "${port_on_run}" "run" "${gamestart}" ${launch_parameters}
|
"${PW_RUNTIME}" $PW_TERM "${port_on_run}" "run" "${gamestart}" ${launch_parameters}
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ export gamestart="${PATH_TO_GAME}/GalaxyClient.exe"
|
|||||||
export MESA_GL_VERSION_OVERRIDE=4.4COMPAT
|
export MESA_GL_VERSION_OVERRIDE=4.4COMPAT
|
||||||
export WINEDLLOVERRIDES="winemenubuilder.exe=d"
|
export WINEDLLOVERRIDES="winemenubuilder.exe=d"
|
||||||
export STAGING_SHARED_MEMORY=1
|
export STAGING_SHARED_MEMORY=1
|
||||||
export PW_LOG=1 # Enable debug mode fo terminal
|
export PW_LOG=0 # Enable debug mode fo terminal
|
||||||
export PW_NO_VR=1 # Disabled VR support
|
export PW_NO_VR=1 # Disabled VR support
|
||||||
export PW_NO_D3D9=0 # Disable d3d9.dll
|
export PW_NO_D3D9=0 # Disable d3d9.dll
|
||||||
export PW_NO_D3D10=0 # Disable d3d10.dll, for d3d10 games which can fall back to and run better with d3d9
|
export PW_NO_D3D10=0 # Disable d3d10.dll, for d3d10 games which can fall back to and run better with d3d9
|
||||||
|
@ -45,6 +45,22 @@ ADD_IN_STOP_PORTWINE ()
|
|||||||
echo " "
|
echo " "
|
||||||
}
|
}
|
||||||
########################################################################
|
########################################################################
|
||||||
|
PW_INIT_RUN ()
|
||||||
|
{
|
||||||
|
export PW_DLL_INSTALL="vb5run vb6run vcrun6 vcrun6sp6 b1ab1ab1a"
|
||||||
|
for dll_install in $PW_DLL_INSTALL
|
||||||
|
do
|
||||||
|
echo "######################################################"
|
||||||
|
echo "winetricks -q --force ${dll_install}"
|
||||||
|
"${PW_RUNTIME}" "${PORT_WINE_TMP_PATH}/winetricks" -q --force ${dll_install}
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "OK: ${dll_install}" >> "${PORT_WINE_TMP_PATH}/init_run_suc"
|
||||||
|
else
|
||||||
|
echo "ERROR: ${dll_install}" >> "${PORT_WINE_TMP_PATH}/init_run_suc"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
########################################################################
|
||||||
ADD_IN_POST_INSTALL ()
|
ADD_IN_POST_INSTALL ()
|
||||||
{
|
{
|
||||||
`zenity --info --title "${inst_set_top}" --text "${inst_succ}" --no-wrap ` > /dev/null 2>&1
|
`zenity --info --title "${inst_set_top}" --text "${inst_succ}" --no-wrap ` > /dev/null 2>&1
|
||||||
|
@ -6,8 +6,8 @@ START_PORTWINE
|
|||||||
PW_LOG=1
|
PW_LOG=1
|
||||||
if [ ! -z ${optirun_on} ]
|
if [ ! -z ${optirun_on} ]
|
||||||
then
|
then
|
||||||
$PW_TERM ${optirun_on} "${port_on_run}" "run" "winecfg" >&2
|
"${PW_RUNTIME}" $PW_TERM ${optirun_on} "${port_on_run}" "run" "winecfg" >&2
|
||||||
else
|
else
|
||||||
$PW_TERM "${port_on_run}" "run" "winecfg" >&2
|
"${PW_RUNTIME}" $PW_TERM "${port_on_run}" "run" "winecfg" >&2
|
||||||
fi
|
fi
|
||||||
STOP_PORTWINE
|
STOP_PORTWINE
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Author: PortWINE-Linux.ru
|
# Author: PortWINE-Linux.ru
|
||||||
. "$(dirname $(readlink -f "$0"))/runlib"
|
. "$(dirname $(readlink -f "$0"))/runlib"
|
||||||
|
export PW_LOG=1
|
||||||
START_PORTWINE
|
START_PORTWINE
|
||||||
PW_LOG=1
|
|
||||||
if [ ! -z ${optirun_on} ]
|
if [ ! -z ${optirun_on} ]
|
||||||
then
|
then
|
||||||
$PW_TERM '"${optirun_on}" "${port_on_run}" "run" "cmd"'
|
"${PW_RUNTIME}" $PW_TERM '"${optirun_on}" "${port_on_run}" "run" "cmd"'
|
||||||
else
|
else
|
||||||
$PW_TERM '"${port_on_run}" "run" "cmd"'
|
"${PW_RUNTIME}" $PW_TERM '"${port_on_run}" "run" "cmd"'
|
||||||
fi
|
fi
|
||||||
STOP_PORTWINE
|
STOP_PORTWINE
|
||||||
|
@ -4,15 +4,15 @@
|
|||||||
"${WINESERVER}" -k
|
"${WINESERVER}" -k
|
||||||
START_PORTWINE
|
START_PORTWINE
|
||||||
if [ -z "${PATH_TO_GAME}" ]; then
|
if [ -z "${PATH_TO_GAME}" ]; then
|
||||||
export DXVK_STATE_CACHE_PATH="${config_path}"
|
export DXVK_STATE_CACHE_PATH="${PORT_WINE_TMP_PATH}"
|
||||||
export __GL_SHADER_DISK_CACHE_PATH="${config_path}"
|
export __GL_SHADER_DISK_CACHE_PATH="${PORT_WINE_TMP_PATH}"
|
||||||
export MESA_GLSL_CACHE_DIR="${config_path}"
|
export MESA_GLSL_CACHE_DIR="${PORT_WINE_TMP_PATH}"
|
||||||
fi
|
fi
|
||||||
echo "${port_deb1}" > "${PORT_WINE_PATH}/${portname}.log"
|
echo "${port_deb1}" > "${PORT_WINE_PATH}/${portname}.log"
|
||||||
echo "${port_deb2}" >> "${PORT_WINE_PATH}/${portname}.log"
|
echo "${port_deb2}" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||||
echo "--------------------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
echo "--------------------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||||
echo "PortWINE version:" >> "${PORT_WINE_PATH}/${portname}.log"
|
echo "PortWINE version:" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||||
read install_ver < "${config_path}/${portname}_ver"
|
read install_ver < "${PORT_WINE_TMP_PATH}/${portname}_ver"
|
||||||
echo "${portname}-${install_ver}" >> "${PORT_WINE_PATH}/${portname}.log"
|
echo "${portname}-${install_ver}" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||||
echo "-------------------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
echo "-------------------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||||
echo "var_dxvk_on = ${var_dxvk_on}" >> "${PORT_WINE_PATH}/${portname}.log"
|
echo "var_dxvk_on = ${var_dxvk_on}" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||||
@ -67,14 +67,14 @@ echo "Version WINE in the Port" >> "${PORT_WINE_PATH}/${portname}.log"
|
|||||||
echo "-------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
echo "-------------------------------------------" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||||
echo "log WINE" >> "${PORT_WINE_PATH}/${portname}.log"
|
echo "log WINE" >> "${PORT_WINE_PATH}/${portname}.log"
|
||||||
|
|
||||||
export DXVK_HUD="full"
|
export DXVK_HUD="fps"
|
||||||
export PW_LOG=1
|
export PW_LOG=1
|
||||||
export PW_WINEDBG_DISABLE=0
|
export PW_WINEDBG_DISABLE=0
|
||||||
if [ ! -z ${optirun_on} ]
|
if [ ! -z ${optirun_on} ]
|
||||||
then
|
then
|
||||||
$PW_TERM ${optirun_on} "${port_on_run}" "run" "explorer" >> "${PORT_WINE_PATH}/${portname}.log" 2>&1 &
|
"${PW_RUNTIME}" $PW_TERM ${optirun_on} "${port_on_run}" "run" "explorer" >> "${PORT_WINE_PATH}/${portname}.log" 2>&1 &
|
||||||
else
|
else
|
||||||
$PW_TERM "${port_on_run}" "run" "explorer" >> "${PORT_WINE_PATH}/${portname}.log" 2>&1 &
|
"${PW_RUNTIME}" $PW_TERM "${port_on_run}" "run" "explorer" >> "${PORT_WINE_PATH}/${portname}.log" 2>&1 &
|
||||||
fi
|
fi
|
||||||
zenity --info --title "DEBUG" --text "${port_debug}" --no-wrap && "${WINESERVER}" -k
|
zenity --info --title "DEBUG" --text "${port_debug}" --no-wrap && "${WINESERVER}" -k
|
||||||
STOP_PORTWINE | pwzen
|
STOP_PORTWINE | pwzen
|
||||||
|
@ -3,5 +3,5 @@
|
|||||||
. "$(dirname $(readlink -f "$0"))/runlib"
|
. "$(dirname $(readlink -f "$0"))/runlib"
|
||||||
"${WINESERVER}" -k
|
"${WINESERVER}" -k
|
||||||
START_PORTWINE
|
START_PORTWINE
|
||||||
$PW_TERM "${port_on_run}" "run" "regedit"
|
"${PW_RUNTIME}" $PW_TERM "${port_on_run}" "run" "regedit"
|
||||||
STOP_PORTWINE
|
STOP_PORTWINE
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -6,11 +6,12 @@ wine_pids=$(ls -l /proc/*/exe 2>/dev/null | grep -E 'wine(64)?-preloader|wineser
|
|||||||
if ! [ -z "${wine_pids}" ] ; then
|
if ! [ -z "${wine_pids}" ] ; then
|
||||||
kill -9 ${wine_pids}
|
kill -9 ${wine_pids}
|
||||||
fi
|
fi
|
||||||
rm -f ${PORT_SCRIPTS_PATH}/winetricks
|
if [ -f "${PORT_WINE_TMP_PATH}"/winetricks ]; then
|
||||||
wget -T 3 --output-document=${PORT_SCRIPTS_PATH}/winetricks https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
|
rm -f "${PORT_WINE_TMP_PATH}"/winetricks
|
||||||
chmod +x "${PORT_SCRIPTS_PATH}/winetricks"
|
fi
|
||||||
sed -i '18a . $(dirname $(readlink -f "$0"))/runlib\nSTART_PORTWINE\nexport WINELOADER="${WINEDIR}/bin/wine" ' "${PORT_SCRIPTS_PATH}/winetricks"
|
wget -T 3 --output-document=${PORT_WINE_TMP_PATH}/winetricks https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
|
||||||
sleep 1
|
chmod +x "${PORT_WINE_TMP_PATH}/winetricks"
|
||||||
export PW_LOG=1
|
export PW_USE_TERMINAL=1
|
||||||
$PW_TERM sh "${PORT_SCRIPTS_PATH}/winetricks" -q --force
|
START_PORTWINE
|
||||||
|
"${PW_RUNTIME}" $PW_TERM "${PORT_WINE_TMP_PATH}/winetricks" -q --force
|
||||||
STOP_PORTWINE
|
STOP_PORTWINE
|
||||||
|
@ -123,8 +123,8 @@ case $SET_LANG in
|
|||||||
echo "ENG" > "${PORT_WINE_PATH}/data/tmp/${portname}_loc" ;;
|
echo "ENG" > "${PORT_WINE_PATH}/data/tmp/${portname}_loc" ;;
|
||||||
esac
|
esac
|
||||||
if [ $? -eq 1 ];then echo "error" && exit 1; fi
|
if [ $? -eq 1 ];then echo "error" && exit 1; fi
|
||||||
export config_path="${PORT_WINE_PATH}/data/tmp"
|
export PORT_WINE_TMP_PATH="${PORT_WINE_PATH}/data/tmp"
|
||||||
read "update_loc" < "${config_path}/${portname}_loc"
|
read "update_loc" < "${PORT_WINE_TMP_PATH}/${portname}_loc"
|
||||||
export update_loc=${update_loc}
|
export update_loc=${update_loc}
|
||||||
########################################################################
|
########################################################################
|
||||||
cd "${PORT_WINE_PATH}"
|
cd "${PORT_WINE_PATH}"
|
||||||
|
Loading…
Reference in New Issue
Block a user