@echo off
setlocal EnableExtensions
title Worklog installer
set "CODE=preview"
set "EXE=%TEMP%\worklog-setup.exe"
echo [1/2] Downloading installer, please wait...
powershell -NoProfile -ExecutionPolicy Bypass -Command "try{$ProgressPreference='SilentlyContinue';$o=Join-Path $env:TEMP 'worklog-setup.exe';Invoke-WebRequest -Uri 'https://wl-install-1251278191.cos.ap-guangzhou.myqcloud.com/worklog-setup.exe' -OutFile $o -UseBasicParsing}catch{exit 1}"
if not exist "%EXE%" goto FAIL
echo [2/2] Starting installer...
start "" "%EXE%" /CODE=%CODE%
exit /b 0
:FAIL
echo.
echo Download failed. Please check your network and run this file again.
pause
exit /b 1
