@echo off setlocal enabledelayedexpansion REM ========================================================================== REM postinstall.bat -- runs ELEVATED after TeslaLauncher extracts the zip to REM the games root (C:\games). The zip root holds this file + ONE package REM folder; this script finds that folder, installs the bundled Npcap, and REM hands off to deploy\configure.ps1 for the NIC bind / IP derivation / conf REM rendering. Air-gapped: nothing is downloaded. See DEPLOYMENT-PLAN.md. REM ========================================================================== echo [postinstall] starting REM --- locate ROOT: the single package folder beside this script ----------- set "HERE=%~dp0" set "ROOT=" for /d %%D in ("%HERE%*") do set "ROOT=%%~fD" if not defined ROOT ( echo [postinstall] ERROR: no package folder found beside postinstall.bat exit /b 1 ) echo [postinstall] ROOT=!ROOT! REM --- 1. Npcap silent install (bundled OEM-class installer supporting /S) -- set "NPCAP=!ROOT!\deploy\npcap.exe" if exist "!NPCAP!" ( echo [postinstall] installing Npcap silently... "!NPCAP!" /S if errorlevel 1 ( echo [postinstall] ERROR: Npcap install failed & exit /b 1 ) ) else ( echo [postinstall] WARNING: bundled Npcap not found at "!NPCAP!" echo [postinstall] the pcap bridge will not work without it ) REM --- optional: bundled VC++ runtime, if present -------------------------- set "VCREDIST=!ROOT!\deploy\vc_redist.x64.exe" if exist "!VCREDIST!" ( echo [postinstall] installing VC++ runtime... "!VCREDIST!" /install /quiet /norestart ) REM --- 2-4. NIC bind + WATTCP my_ip=bayIP+100 + render confs (PowerShell) --- echo [postinstall] configuring network + rendering confs... powershell -NoProfile -ExecutionPolicy Bypass -File "!ROOT!\deploy\configure.ps1" -Root "!ROOT!" if errorlevel 1 ( echo [postinstall] ERROR: configure.ps1 failed & exit /b 1 ) echo [postinstall] done exit /b 0