mirror of
https://github.com/tcsenpai/UWINE.git
synced 2025-06-06 19:45:20 +00:00
Added Wine support
This commit is contained in:
parent
ac006b900f
commit
198eea2ef9
13
libs/wine_runner.py
Normal file
13
libs/wine_runner.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
def wine_run(executable_path, wine_dir):
|
||||||
|
# NOTE The wineprefix is set in the environment variable WINEPREFIX and is not needed as an argument
|
||||||
|
print("[WINE_RUNNER] Running " + executable_path + " with Wine version: ")
|
||||||
|
os.system(wine_dir + "/bin/wine --version")
|
||||||
|
executable_dir = os.path.dirname(executable_path)
|
||||||
|
if executable_dir == "":
|
||||||
|
executable_dir = "."
|
||||||
|
# Composing the command
|
||||||
|
composed_command = ( "cd " + executable_dir + " && " + wine_dir + "/bin/wine " + executable_path + "$@")
|
||||||
|
print("[WINE_RUNNER] Composed command: " + composed_command)
|
||||||
|
os.system(composed_command)
|
18
uwine
18
uwine
@ -16,6 +16,7 @@ import libs.customvars_loader as customvars_loader
|
|||||||
import libs.predirectives_loader as predirectives_loader
|
import libs.predirectives_loader as predirectives_loader
|
||||||
import libs.postdirectives_loader as postdirectives_loader
|
import libs.postdirectives_loader as postdirectives_loader
|
||||||
import libs.ulwlg_runner as ulwlg_runner
|
import libs.ulwlg_runner as ulwlg_runner
|
||||||
|
import libs.wine_runner as wine_runner
|
||||||
|
|
||||||
# SECTION Constants
|
# SECTION Constants
|
||||||
LAUNCHDIR = os.getcwd()
|
LAUNCHDIR = os.getcwd()
|
||||||
@ -26,6 +27,7 @@ print("[*] UWINE is installed in " + UWINEDIR)
|
|||||||
# SECTION Default values
|
# SECTION Default values
|
||||||
ulwgl_dir = UWINEDIR + "/launcher"
|
ulwgl_dir = UWINEDIR + "/launcher"
|
||||||
proton_path = UWINEDIR + "/protons/current"
|
proton_path = UWINEDIR + "/protons/current"
|
||||||
|
use_wine = False
|
||||||
wine_prefix = UWINEDIR + "/PREFIX"
|
wine_prefix = UWINEDIR + "/PREFIX"
|
||||||
ids_json_path = UWINEDIR + "/ids.json"
|
ids_json_path = UWINEDIR + "/ids.json"
|
||||||
ids = {}
|
ids = {}
|
||||||
@ -85,6 +87,14 @@ if os.environ["CUSTOMVARS"]:
|
|||||||
else:
|
else:
|
||||||
env_defined_customvars = {}
|
env_defined_customvars = {}
|
||||||
|
|
||||||
|
if os.environ["USE_WINE"]:
|
||||||
|
if os.environ["USE_WINE"] == "True":
|
||||||
|
use_wine = True
|
||||||
|
else:
|
||||||
|
use_wine = False
|
||||||
|
print("[INFO] [USE_WINE] " + str(use_wine))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
# SECTION Loading methods
|
# SECTION Loading methods
|
||||||
@ -114,6 +124,7 @@ if __name__ == "__main__":
|
|||||||
["ULWGLDIR", ulwgl_dir],
|
["ULWGLDIR", ulwgl_dir],
|
||||||
["WINEPREFIX", os.environ["WINEPREFIX"]],
|
["WINEPREFIX", os.environ["WINEPREFIX"]],
|
||||||
["PROTONPATH", os.environ["PROTONPATH"]],
|
["PROTONPATH", os.environ["PROTONPATH"]],
|
||||||
|
["USE_WINE", use_wine],
|
||||||
["IDS_JSON", ids_json_path],
|
["IDS_JSON", ids_json_path],
|
||||||
["GAMEID", os.environ["GAMEID"]],
|
["GAMEID", os.environ["GAMEID"]],
|
||||||
["PREDIRECTIVES", predirectives],
|
["PREDIRECTIVES", predirectives],
|
||||||
@ -126,5 +137,10 @@ if __name__ == "__main__":
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
# Launching with ulwlg_runner
|
# Launching with ulwlg_runner or wine depending on the use_wine variable
|
||||||
|
if use_wine:
|
||||||
|
print("[*] Using Wine to launch the game")
|
||||||
|
wine_runner.wine_run(filepath, os.environ["PROTONPATH"])
|
||||||
|
else:
|
||||||
|
print("[*] Using ULWGL to launch the game")
|
||||||
ulwlg_runner.ulwlg_run(filepath, ulwgl_dir, os.environ["PROTONPATH"], os.environ["WINEPREFIX"], os.environ["GAMEID"])
|
ulwlg_runner.ulwlg_run(filepath, ulwgl_dir, os.environ["PROTONPATH"], os.environ["WINEPREFIX"], os.environ["GAMEID"])
|
Loading…
x
Reference in New Issue
Block a user