-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor updating/installing/running Zwift into their own scripts. (#108
) * Refactor updating/installing/running Zwift into their own scripts. * Add new update/run files to workflow files * Remove zwift_common.sh Fix issue where $HOME doesn't work as expected in entrypoint.sh because it's run as root in Docker.
- Loading branch information
Showing
5 changed files
with
74 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
set -e | ||
set -x | ||
|
||
ZWIFT_HOME="$HOME/.wine/drive_c/Program Files (x86)/Zwift" | ||
|
||
if [ ! -d "$ZWIFT_HOME" ]; then | ||
echo "Directory $ZWIFT_HOME does not exist. Has Zwift been installed?" | ||
exit 1 | ||
fi | ||
|
||
cd "$ZWIFT_HOME" | ||
|
||
# Do this in the run script in case a user sets this option post-install. | ||
if [[ ! -z "$WINE_EXPERIMENTAL_WAYLAND" ]]; | ||
then | ||
echo "enabling wayland support in wine 9.0" | ||
wine reg.exe add HKCU\\Software\\Wine\\Drivers /v Graphics /d x11,wayland | ||
fi | ||
|
||
echo "starting zwift..." | ||
wine start ZwiftLauncher.exe SilentLaunch | ||
|
||
LAUNCHER_PID_HEX=$(winedbg --command "info proc" | grep -P "ZwiftLauncher.exe" | grep -oP "^\s\K.+?(?=\s)") | ||
LAUNCHER_PID=$((16#$LAUNCHER_PID_HEX)) | ||
|
||
if [[ ! -z "$ZWIFT_USERNAME" ]] && [[ ! -z "$ZWIFT_PASSWORD" ]]; | ||
then | ||
echo "authenticating with zwift..." | ||
wine start /exec /bin/runfromprocess-rs.exe $LAUNCHER_PID ZwiftApp.exe --token=$(zwift-auth) | ||
else | ||
wine start /exec /bin/runfromprocess-rs.exe $LAUNCHER_PID ZwiftApp.exe | ||
fi | ||
|
||
sleep 3 | ||
|
||
until pgrep -f ZwiftApp.exe &> /dev/null | ||
do | ||
echo "Waiting for zwift to start ..." | ||
sleep 1 | ||
done | ||
|
||
echo "Killing uneccesary applications" | ||
pkill ZwiftLauncher | ||
pkill ZwiftWindowsCra | ||
pkill -f MicrosoftEdgeUpdate | ||
|
||
wineserver -w |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters