Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate launcher batch file so hosts file does not need editing. #122

Merged
merged 1 commit into from
May 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ zoffline can be installed on the same machine as Zwift or another local machine.
* Append this line: ``<zoffline ip> us-or-rly101.zwift.com secure.zwift.com cdn.zwift.com launcher.zwift.com``
<br />(Where ``<zoffline ip>`` is the ip address of the machine running zoffline. If
it's running on the same machine as Zwift, use ``127.0.0.1`` as the ip.)
* If you have the helper scripts, open the __ip_address.txt__ file and change it to the zwift server ip. Launch the __launch.bat__ script as admin to start Zwift. This way, if you use the normal Zwift launcher, it'll go to Zwift's servers, and use this as a standalone launcher.

Why: We need to redirect Zwift to use zoffline and convince Windows and Zwift to
accept zoffline's self signed certificates for Zwift's domain names. Feel free
Expand Down
1 change: 1 addition & 0 deletions scripts/ip_address.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
127.0.0.1
20 changes: 20 additions & 0 deletions scripts/launch.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
SET hostspath=%windir%\System32\drivers\etc\hosts
SET tmp_host=%windir%\temp\hosts

@ECHO Moving host file to tmp location...

COPY %hostspath% %tmp_host% /y >nul

SET/p ip_address=<%~dp0\ip_address.txt

ECHO .>>%hostspath%
ECHO %ip_address% us-or-rly101.zwift.com secure.zwift.com cdn.zwift.com launcher.zwift.com >> %hostspath%

START /d "C:\Program Files (x86)\Zwift" ZwiftLauncher.exe

PAUSE

@ECHO Moving host file back...

COPY %tmp_host% %hostspath% /y >nul