- Launcher/build.bat now outputs to dist\TeslaLauncher\ (was TeslaLauncher\ at the Launcher root) and produces dist\TeslaLauncher-podpkg.zip, matching Console\dist\. - Both build scripts now zip the package themselves (Compress-Archive) instead of leaving it as a manual step: Console/build-package.bat -> dist\TeslaConsole-pkg.zip. - Launcher/.gitignore: ignore /dist/ (drop the obsolete /TeslaLauncher/ + staging entries); Console already ignores /dist/. - READMEs updated to point at dist\. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
67 lines
2.2 KiB
Batchfile
67 lines
2.2 KiB
Batchfile
@echo off
|
|
:: =============================================================================
|
|
:: TeslaConsole - Build ^& Package
|
|
:: =============================================================================
|
|
:: Publishes the console (net48, framework-dependent) into TeslaConsole\App and
|
|
:: assembles the installable package (App\ + install.bat) next to it. net48 is
|
|
:: in-box on Windows 10/11, so the target control PC needs no runtime install.
|
|
::
|
|
:: Requirements: .NET SDK (6.0+) to drive the build; internet for first restore.
|
|
::
|
|
:: Output:
|
|
:: TeslaConsole\
|
|
:: install.bat
|
|
:: App\ (TeslaConsole.exe + dependencies + RedPlanet\ content)
|
|
:: =============================================================================
|
|
|
|
setlocal
|
|
|
|
set ROOT=%~dp0
|
|
:: Package under dist\ so it never collides with the TeslaConsole\ SOURCE folder.
|
|
set BUILD_DIR=%ROOT%dist\TeslaConsole
|
|
set APP_OUT=%BUILD_DIR%\App
|
|
set ZIP=%ROOT%dist\TeslaConsole-pkg.zip
|
|
|
|
echo.
|
|
echo ============================================================
|
|
echo TeslaConsole - Build ^& Package (net48, framework-dependent)
|
|
echo Output : %BUILD_DIR%
|
|
echo ============================================================
|
|
echo.
|
|
|
|
where dotnet >nul 2>&1
|
|
if errorlevel 1 (
|
|
echo ERROR: dotnet not found. Install the .NET SDK from https://dotnet.microsoft.com/download
|
|
pause & exit /b 1
|
|
)
|
|
|
|
:: Don't publish over a running instance.
|
|
taskkill /F /IM TeslaConsole.exe >nul 2>&1
|
|
|
|
echo Publishing TeslaConsole...
|
|
if exist "%APP_OUT%" rmdir /s /q "%APP_OUT%"
|
|
dotnet publish "%ROOT%TeslaConsole.csproj" -c Release -o "%APP_OUT%"
|
|
if errorlevel 1 (
|
|
echo.
|
|
echo ERROR: Build failed.
|
|
pause & exit /b 1
|
|
)
|
|
|
|
if exist "%ROOT%install.bat" copy /y "%ROOT%install.bat" "%BUILD_DIR%\" >nul
|
|
|
|
echo Zipping package...
|
|
if exist "%ZIP%" del /q "%ZIP%"
|
|
powershell -NoProfile -Command "Compress-Archive -Path '%BUILD_DIR%' -DestinationPath '%ZIP%' -Force"
|
|
|
|
echo.
|
|
echo ============================================================
|
|
echo Package built: %BUILD_DIR%
|
|
echo Zip : %ZIP%
|
|
echo ============================================================
|
|
echo.
|
|
echo Next steps:
|
|
echo 1. Copy TeslaConsole-pkg.zip to the control PC and extract it
|
|
echo 2. Run TeslaConsole\install.bat as Administrator
|
|
echo.
|
|
pause
|