13 lines
670 B
Batchfile
13 lines
670 B
Batchfile
@echo off
|
|
setlocal EnableExtensions DisableDelayedExpansion
|
|
set "PLANET_LAUNCHER_SOURCE=%~f0"
|
|
set "PLANET_LAUNCHER_INSTALL_ONLY="
|
|
if /i "%~1"=="--install-only" set "PLANET_LAUNCHER_INSTALL_ONLY=1"
|
|
set "PLANET_POWERSHELL=powershell.exe"
|
|
where.exe pwsh.exe >nul 2>&1
|
|
if not errorlevel 1 set "PLANET_POWERSHELL=pwsh.exe"
|
|
%PLANET_POWERSHELL% -NoLogo -NoProfile -ExecutionPolicy Bypass -Command "& (Join-Path (Split-Path -LiteralPath $env:PLANET_LAUNCHER_SOURCE) 'scripts\windows\planet-launcher.ps1') -InstallOnly:($env:PLANET_LAUNCHER_INSTALL_ONLY -eq '1')"
|
|
set "planet_launcher_exit=%errorlevel%"
|
|
if not "%planet_launcher_exit%"=="0" pause
|
|
exit /b %planet_launcher_exit%
|