Repository navigation
Expand file tree
/
Copy pathlaunch.bat
More file actions
47 lines (41 loc) · 1.61 KB
/
Copy pathlaunch.bat
File metadata and controls
47 lines (41 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
@echo off
REM Xenosaga II Extractor — Windows double-click launcher.
REM Starts the local GUI on a free port and opens your browser.
REM The kit needs numpy, fontTools and uharfbuzz (requirements.txt). If your
REM Python lacks any of them, the first run makes a private environment in .venv\
REM beside this file and installs them there; later runs use that environment.
setlocal
cd /d "%~dp0"
set "BASE="
where py >nul 2>nul && set "BASE=py -3"
if not defined BASE (where python >nul 2>nul && set "BASE=python")
set "PY=%BASE%"
if exist ".venv\Scripts\python.exe" set "PY=.venv\Scripts\python.exe"
if not defined PY goto nopython
%PY% -c "import numpy, fontTools, uharfbuzz" >nul 2>nul
if not errorlevel 1 goto run
if not defined BASE goto noinstall
echo Setting up numpy, fontTools and uharfbuzz (music and new alphabets) in .venv\ ...
%BASE% -m venv .venv
if errorlevel 1 goto noinstall
".venv\Scripts\python.exe" -m pip install --quiet -r requirements.txt
if errorlevel 1 goto noinstall
set "PY=.venv\Scripts\python.exe"
:run
%PY% gui.py %*
REM If gui.py errored out, keep the window open so the user can see why.
if errorlevel 1 pause
exit /b
:nopython
echo Python 3 was not found on your PATH.
echo Install Python 3.9 or newer from https://www.python.org/downloads/
echo (make sure to tick "Add Python to PATH" during install),
echo then double-click this launcher again.
pause
exit /b 1
:noinstall
echo Could not install the requirements automatically. Install them yourself with
echo py -3 -m pip install -r requirements.txt
echo then double-click this launcher again.
pause
exit /b 1