120 Commits

Author SHA1 Message Date
R1kaB3rN
8f6d383c9f
ulwgl_test: add tests for when retrieving latest Proton release 2024-02-17 18:54:42 -08:00
R1kaB3rN
dfa8f975db
ulwgl_test: update test when interrupting cache extraction
- Removes assertions that check for state of variables when an error is raised and updates comments
2024-02-17 18:50:19 -08:00
R1kaB3rN
63fba6c892
ulwgl_test: add tests for cache 2024-02-17 17:35:16 -08:00
R1kaB3rN
15c483ed60
ulwgl_test: add tests for steam compat 2024-02-17 17:34:54 -08:00
R1kaB3rN
88a47e3ea0
ulwgl_dl_util: fix bug when referencing old Proton from cache
- Fixes a logic error by terminating prematurely when referencing an old Proton version that has been saved in the cache
2024-02-17 17:32:58 -08:00
R1kaB3rN
9a425dd784
ulwgl_test: update test when removing files
- Creates more test files within the compat/cache directories to verify that there wasn't any side effects after executing _cleanup
2024-02-17 15:13:23 -08:00
R1kaB3rN
ae6d5675d0
ulwgl_test: add test when removing files
- Arguably the most important test of this test suite as we do **not** want to remove files that isn't ours. We test both the positive and negative case. In the latter, the state of the cache or Steam compat should be left the same state as it was before executing the function when passed files that do not exist.
2024-02-17 15:02:45 -08:00
R1kaB3rN
3c0534edd2
ulwgl_test: add test when extracting files 2024-02-17 14:57:21 -08:00
R1kaB3rN
679cbffc2a
ulwgl_dl_util: format 2024-02-17 14:56:05 -08:00
R1kaB3rN
f666c8f8d0
ulwgl_run: change error msg
- Prefer a shorter message when download fails or Proton cannot be found, and reference ULWGL-Proton Github repository instead of GE-Proton
2024-02-17 12:29:15 -08:00
R1kaB3rN
9f2de76c5a
ulwgl_dl_util: prefer creating a var for the Proton dir
- Referencing the tuple element within the array for the tarball name then parsing it was becoming highly error prone/unreadable.
2024-02-17 12:18:43 -08:00
R1kaB3rN
71eaff0ca5
ulwgl_dl_util: change GE-Proton -> ULWGL-Proton 2024-02-17 12:16:27 -08:00
R1kaB3rN
744cedc6b8
ulwgl_dl_util: be smarter about imports 2024-02-17 10:37:12 -08:00
R1kaB3rN
3e5e1e138b
ulwgl_dl_util: delete references to requests module 2024-02-16 18:40:00 -08:00
R1kaB3rN
3a5b4b10f2
ulwgl_dl_util: prefer joining paths 2024-02-16 18:32:03 -08:00
R1kaB3rN
83a59dcf1d
ulwgl_dl_util: refactor _get_from_cache 2024-02-16 18:31:45 -08:00
R1kaB3rN
ecde7f642f
ulwgl_dl_util: prefer using stdlib than requests module for network 2024-02-16 18:31:26 -08:00
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
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