Skip to content

Commit

Permalink
Add disable_zoffline.bat
Browse files Browse the repository at this point in the history
  • Loading branch information
oldnapalm committed Aug 12, 2024
1 parent c4e6d52 commit 515583c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ To install zoffline on Windows:
* If you are not running zoffline on the same PC that Zwift is running: create a ``server-ip.txt`` file in the ``storage`` directory containing the IP address of the PC running zoffline.
* Run the downloaded zoffline.exe
* Once run, zoffline will create a ``storage`` directory in the same folder it's in to store your Zwift progress.
* Start Zwift with zoffline.exe running (__after completing step 2__ or running __configure_client__ script from https://github.com/zoffline/zwift-offline/releases/tag/zoffline_helper)
* Start Zwift with zoffline.exe running (__after completing step 2__ or running __configure_client__ script from https://github.com/oldnapalm/zoffline-helper/releases/latest)
* It takes zoffline a few seconds to start. Wait until text appears in the command prompt before opening Zwift.
* When done with Zwift, press Ctrl+C in the command line to close zoffline.
</details>
Expand Down Expand Up @@ -100,7 +100,7 @@ zoffline can be installed on the same machine as Zwift or another local machine.
* If Zwift is not installed, install it before installing zoffline.
* If your Zwift version is newer than 1.0.133616 and zoffline is running from source: copy ``C:\Program Files (x86)\Zwift\Zwift_ver_cur.xml`` to zoffline's ``cdn/gameassets/Zwift_Updates_Root/`` overwriting the existing file.
* If your Zwift version is newer than 1.0.133616 and zoffline is not running from source: wait for zoffline to be updated.
* __NOTE:__ instead of performing the steps below you can instead just run the __configure_client__ script from https://github.com/zoffline/zwift-offline/releases/tag/zoffline_helper
* __NOTE:__ instead of performing the steps below you can instead just run the __configure_client__ script from https://github.com/oldnapalm/zoffline-helper/releases/latest
* On your Windows machine running Zwift, copy the following files in this repo to a known location:
* [ssl/cert-zwift-com.p12](https://github.com/zoffline/zwift-offline/raw/master/ssl/cert-zwift-com.p12)
* [ssl/cert-zwift-com.pem](https://github.com/zoffline/zwift-offline/raw/master/ssl/cert-zwift-com.pem)
Expand Down Expand Up @@ -219,7 +219,7 @@ To obtain your current profile:
* __NOTE:__ instead of performing the steps below you can instead use the "Settings - Zwift" button in the launcher window (Windows and macOS only).
* Ensure zoffline is disabled.
* Run ``scripts/get_profile.py -u <your_zwift_username>``
* Or, if using the Windows zoffline.exe version without Python installed you can run ``get_profile.exe`` obtained from https://github.com/zoffline/zwift-offline/releases/tag/zoffline_helper in place of ``scripts/get_profile.py``
* Or, if using the Windows zoffline.exe version without Python installed you can run ``get_profile.exe`` obtained from https://github.com/oldnapalm/zoffline-helper/releases/latest in place of ``scripts/get_profile.py``
* Move the resulting ``profile.bin``, ``achievements.bin`` and ``economy_config.txt`` (saved in whatever directory you ran get_profile.py in) into the ``storage/1`` directory.
* If using zoffline.exe on Windows, create a ``storage/1`` directory within the same folder as zoffline.exe if it does not already exist.
* If using Docker, the directory ``1`` should be in the path you passed to ``-v``
Expand All @@ -233,7 +233,7 @@ To obtain your current profile:
* Get CLIENT_ID and CLIENT_SECRET from https://www.strava.com/settings/api
* __NOTE:__ instead of performing the steps below you can instead set the authorization callback domain of your API application to ``launcher.zwift.com`` and use the "Settings - Strava" button in the launcher window (Windows and macOS only).
* Run ``scripts/strava_auth.py --client-id CLIENT_ID --client-secret CLIENT_SECRET``
* Or, if using the Windows zoffline.exe version without Python installed you can run ``strava_auth.exe`` obtained from https://github.com/zoffline/zwift-offline/releases/tag/zoffline_helper in place of ``scripts/strava_auth.py``
* Or, if using the Windows zoffline.exe version without Python installed you can run ``strava_auth.exe`` obtained from https://github.com/oldnapalm/zoffline-helper/releases/latest in place of ``scripts/strava_auth.py``
* Open http://localhost:8000/ and authorize.
* Move the resulting ``strava_token.txt`` (saved in whatever directory you ran ``strava_auth.py`` in) into the ``storage/1`` directory.
* If testing, ride at least 300 meters, shorter activities won't be uploaded.
Expand Down
4 changes: 2 additions & 2 deletions scripts/configure_client.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ ECHO.

NET SESSION >nul 2>&1 || ( PowerShell start -verb runas '%~0' & EXIT /B )

CD /D "%~dp0"

SET HOSTS="%WINDIR%\system32\drivers\etc\hosts"
COPY %HOSTS% %HOSTS%.bak >nul
TYPE %HOSTS%.bak | FINDSTR /V /I zwift > %HOSTS%
Expand Down Expand Up @@ -164,4 +162,6 @@ IF %ERRORLEVEL% NEQ 0 (

ECHO.

TASKKILL /F /IM ZwiftLauncher.exe >nul 2>&1

PAUSE
15 changes: 15 additions & 0 deletions scripts/disable_zoffline.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@ECHO OFF
TITLE disable_zoffline

NET SESSION >nul 2>&1 || ( PowerShell start -verb runas '%~0' & EXIT /B )

SET HOSTS="%WINDIR%\system32\drivers\etc\hosts"
COPY %HOSTS% %HOSTS%.bak >nul
ECHO Removing servers from hosts file
TYPE %HOSTS%.bak | FINDSTR /V /I zwift > %HOSTS%

ECHO.

TASKKILL /F /IM ZwiftLauncher.exe >nul 2>&1

PAUSE

0 comments on commit 515583c

Please sign in to comment.