154 Commits

Author SHA1 Message Date
R1kaB3rN
d457847920
ulwgl_test: update tests for new usage
- Update the check_env tests for new usage when PROTONPATH is not set by mocking the callout.
2024-02-16 12:12:00 -08:00
R1kaB3rN
f6aa2f31e9
ulwgl_dl_util: update comment 2024-02-16 12:08:49 -08:00
R1kaB3rN
9de0628fb0
ulwgl_run: only import the func 2024-02-16 12:06:30 -08:00
R1kaB3rN
05d7f4d141
ulwgl_dl_util: move var inside block 2024-02-16 11:41:55 -08:00
R1kaB3rN
f24dbc8591
ulwgl_dl_util: print on extraction complete 2024-02-16 11:38:35 -08:00
R1kaB3rN
4691e26f23
ulwgl_dl_util: move download to func 2024-02-16 11:37:52 -08:00
R1kaB3rN
e3563cb8f3
ulwgl_dl_util: move cache to func
- Code block in which the digest mismatched, user interrupt or failure to download/no internet.
2024-02-16 11:37:00 -08:00
R1kaB3rN
fbb60288eb
ulwgl_dl_util: move cache to func 2024-02-16 11:34:25 -08:00
R1kaB3rN
f64b473157
ulwgl_dl_util: move steamcompat to func 2024-02-16 11:32:08 -08:00
R1kaB3rN
08d18203f8
ulwgl_dl_util: handle connection timeout 2024-02-15 23:45:33 -08:00
R1kaB3rN
ba54f167f4
ulwgl_dl_util: handle interrupts whenever extracting
- When extracting from the cache to the compatibilitytools.d directory, be sure to remove the leftover data after the interrupt to avoid future errors.
2024-02-15 23:42:27 -08:00
R1kaB3rN
2512cdc23a
ulwgl_dl_util: add post cleanup routine
- When we're downloading the latest Proton, it's possible the user can interrupt download or extraction process which can lead to corrupted or incomplete files. As a result, in the next run of the launcher, a FileNotFoundError can be falsely raised for the $PROTONPATH/proton file. In the case of an interrupt, be sure to remove the relevant files before we exit.
2024-02-15 19:39:24 -08:00
R1kaB3rN
621b6c1dd5
ulwgl_dl_util: prefer joining Paths 2024-02-15 11:03:22 -08:00
R1kaB3rN
9a116c6a0a
ulwgl_dl_util: fix bug when referring to cache for latest
- Add missing return statement

- Delete property access of name
2024-02-15 11:02:23 -08:00
R1kaB3rN
f2ddf93d33
Add Github Action for ulwgl_*.py files (#26)
workflows: add Github Action for ulwgl_*.py files
2024-02-15 09:09:26 -08:00
R1kaB3rN
d1c24b16e6
Add download functionality to ulwgl_run
- When the user does not specify the PROTONPATH, attempt to download the latest Proton if Proton cannot be found in either the Steam compat tools or local cache. Otherwise, prioritize referring to existing ones -- $HOME/.local/share/Steam/compatibilitytools.d and $HOME/.cache/ULWGL.

- Effectively, new installations will always download the latest Proton, while existing ones will simply be warned of a later version. Downloading is avoided if the latest version already exists in the cache, and the cache will be used as a last resort to set the variable. When we're unable to find an existing Proton or download one, we raise an error.
2024-02-15 08:22:23 -08:00
R1kaB3rN
e23ed300ee
ulwgl_run: prefer referencing parent than cwd
- Related to 29827d076f
2024-02-14 09:21:25 -08:00
R1kaB3rN
dd079fdac6
Merge pull request #28 from R1kaB3rN/prefix
ulwgl_run: recreate the symlink each run
2024-02-14 08:40:53 -08:00
R1kaB3rN
08f73c9fe1
ulwgl_test.py: add test for setup_prefix
- Test the case when the user runs the launcher again after moving the WINEPREFIX. An error should not be raised when creating a symbolic link.

- Related to https://github.com/Open-Wine-Components/ULWGL-launcher/issues/27
2024-02-13 22:07:40 -08:00
R1kaB3rN
3bb00480b9
ulwgl_run.py: check dir before creating the symlink
- Setup can fail when creating the symlink if the pfx somehow exists already. One case this can probably happen is if the user references a Steam created prefix as the WINEPREFIX since pfx directory would exist.
2024-02-13 22:04:45 -08:00
R1kaB3rN
4ba702565d
ulwgl_run.py: always recreate the symlink
- Related to https://github.com/Open-Wine-Components/ULWGL-launcher/issues/27
2024-02-13 17:56:25 -08:00
Thomas Crider
4f64389ec4
Merge pull request #23 from R1kaB3rN/args
Change usage for Python rewrite
2024-02-12 21:54:40 -07:00
R1kaB3rN
14b323e3dc
Add ULWGL_ID to dict
- Also, update the test to check for expected environment variables in the dictionary. Notably, when a valid ULWGL_ID is set, the STEAM_COMPAT_ID and related env var should be the stripped ULWGL_ID.
2024-02-12 18:20:15 -08:00
R1kaB3rN
d5772c0eb3
ulwgl_test.py: update tests for set_env 2024-02-12 17:36:03 -08:00
R1kaB3rN
1dbcace209
ulwgl_test.py: add test for env usage
- Test that options and the game are distinct arguments when executing the script via the environment variable usage.
2024-02-12 17:34:39 -08:00
R1kaB3rN
6987fde6c3
Change parsing of arguments
- Before, the executable and its options were joined as a single string to be executed. Instead, prefer separating them as distinct arguments. As a result, the command as an Array becomes something like:

['/home/foo/.local/share/ULWGL/ULWGL', '--verb', 'waitforexitandrun', '--', '/home/foo/GE-Proton8-30/proton', 'waitforexitandrun', '/home/foo/foo.exe', '-foo', '-bar', '-baz']
2024-02-12 17:19:58 -08:00
R1kaB3rN
2e8faa1f41
Delete print statements 2024-02-12 00:29:20 -08:00
R1kaB3rN
f73ef0f268
Fix bug that ignores arguments
- After specifying the executable, all arguments following the first were ignored unless they were escaped to be interpreted as part of the first argument.
2024-02-12 00:27:30 -08:00
R1kaB3rN
f28d170994
Symlink ulwgl-run to ulwgl_run.py 2024-02-12 00:13:28 -08:00
R1kaB3rN
d6eb1c8484
Rename gamelauncher files 2024-02-12 00:12:29 -08:00
R1kaB3rN
e1414dd460
Rename ulwgl-run to ulwgl-run-posix 2024-02-12 00:04:01 -08:00
GloriousEggroll
3cb00833d3 bump proton version 2024-02-11 18:58:52 -07:00
R1kaB3rN
9edc4d6d30
gamelauncher.py: update comments 2024-02-11 10:28:59 -08:00
R1kaB3rN
86f04a939e
gamelauncher_test.py: update tests for new usage 2024-02-11 10:28:49 -08:00
R1kaB3rN
490ecd1bb0
gamelauncher.py: define return type to game drive 2024-02-11 09:59:14 -08:00
R1kaB3rN
0712a21d48
gamelauncher.py: move config checks to check_env 2024-02-11 09:58:40 -08:00
R1kaB3rN
db6c81eacb
gamelauncher.py: update comments 2024-02-10 18:10:18 -08:00
R1kaB3rN
9b0402074c
gamelauncher.py: add PROTON_VERB to build_command 2024-02-10 18:09:59 -08:00
R1kaB3rN
bba9f0d060
gamelauncher.py: refactor main
- Move environment variable functionality to set_env and execute it for both usages.
2024-02-10 18:09:18 -08:00
R1kaB3rN
9642748cb0
gamelauncher.py: move setup_pfx to main 2024-02-10 18:03:45 -08:00
R1kaB3rN
d0dbe23663
gamelauncher.py: update parse_args
- Reimplement parse_args to simply return a single positional argument string or a Namespace object. As a result the new usage will be:

$ gamelauncher.py /home/foo/foo.exe
$ gamelauncher.py /home/foo/foo.exe -opengl ...
$ gamelauncher.py --config example.toml

- Everything following the program will be interpreted as a single positional argument and this removes the need for quotes for the envvar usage. The optional arguments: --exe, --options, --store and --verb will no longer be supported.
2024-02-10 18:01:12 -08:00
GloriousEggroll
fc91d60e65 ulwgl-run: update ULWGL proton version 2024-02-10 00:49:06 -07:00
Thomas Crider
4b483f1aa8
Update README.md -- change gamelauncher.sh references to ulwgl-run 2024-02-10 00:18:58 -07:00
R1kaB3rN
81f5b36a8c
Merge pull request #19 from R1kaB3rN/local-share
gamelauncher.py: support finding ULWGL in $HOME/.local/share in addition to the current working directory and give it priority
2024-02-09 20:10:46 -08:00
R1kaB3rN
fc9cfb1247
gamelauncher.py: support finding _v2-entry-point in $HOME/.local/share 2024-02-09 20:04:48 -08:00
R1kaB3rN
a4c320096d
Merge pull request #20 from R1kaB3rN/ulwgl-id
Support ULWGL_ID env var
2024-02-09 19:53:03 -08:00
R1kaB3rN
4622516693
Add --store option to gamelauncher
- Enable users to optionally specify the game's distribution platform (store). This allows them to properly apply a fix from a specific store rather than Steam's to their game's WINE prefix. As a side effect, this allows users to apply a protonfix from other stores (e.g. gog).
2024-02-09 19:42:22 -08:00
R1kaB3rN
b5a3ac2b0f
Support setting ULWGL_ID
- Set STEAM_COMPAT_APP_ID to a valid ULWGL_ID to allow applying non-steam protonfixes to games.

- Related to c3c016bcdc and 99b3166e83.
2024-02-09 19:39:15 -08:00
R1kaB3rN
066e869485
RFC: Rewrite gamelauncher in Python (#8)
- In its current form, executing the gamelauncher script can be tedious especially when not using a modern shell that supports auto completions. For instance:

$ WINEPREFIX=$HOME/Games/epic-games-store GAMEID=egs PROTONPATH=$HOME/.steam/steam/compatibilitytools.d/GE-Proton8-28 ./gamelauncher.sh $HOME/Games/epic-games-store/drive_c/Program Files (x86)/Epic Games/Launcher/Portal/Binaries/Win32/EpicGamesLauncher.exe -opengl -SkipBuildPatchPrereq

- By rewriting the gamelauncher script in Python, we can support reading from a configuration file(s) instead which increases ease of use and provides better organization. This effectively results in this:

$ gamelauncher.py --config example.toml

- Additionally, due to the rich Python ecosystem, the rewrite leaves room for future features and formal testing if needed.
2024-02-09 19:21:10 -08:00
GloriousEggroll
a702bab465 fixup incorrect posix ldconfig_output case (credits user: https://github.com/apprehensions) and remove double exit 1 lines 2024-02-08 18:34:33 -07:00