调整文件目录
This commit is contained in:
+28
-22
@@ -2,10 +2,11 @@
|
||||
chcp 65001 >nul
|
||||
cd /d "%~dp0"
|
||||
set "ROOT=%~dp0.."
|
||||
set "TOOLS=%ROOT%\tools"
|
||||
set "NAME=Qiyuan_07_Multi-lan-installer"
|
||||
set "SRC=Qiyuan_A07_Multi-lan-installer.py"
|
||||
title %NAME% - Build
|
||||
set "TOOLS=%ROOT%\tools"
|
||||
set "NAME=Qiyuan_07_Multi-lan-installer"
|
||||
set "SRC=Qiyuan_A07_Multi-lan-installer.py"
|
||||
set "ICON=%~dp0app.ico"
|
||||
title %NAME% - Build
|
||||
|
||||
echo ============================================================
|
||||
echo %NAME% - Cython Build
|
||||
@@ -13,13 +14,18 @@ echo ============================================================
|
||||
echo.
|
||||
|
||||
where python >nul 2>&1
|
||||
if errorlevel 1 (
|
||||
echo [ERROR] Python not found
|
||||
pause
|
||||
exit /b
|
||||
)
|
||||
for /f "delims=" %%i in ('where python') do set PY=%%i
|
||||
echo Python: %PY%
|
||||
if errorlevel 1 (
|
||||
echo [ERROR] Python not found
|
||||
pause
|
||||
exit /b
|
||||
)
|
||||
if not exist "%ICON%" (
|
||||
echo [ERROR] app.ico not found in A07 folder: %ICON%
|
||||
pause
|
||||
exit /b
|
||||
)
|
||||
for /f "delims=" %%i in ('where python') do set PY=%%i
|
||||
echo Python: %PY%
|
||||
|
||||
echo [1/6] Installing deps...
|
||||
%PY% -m pip install pyinstaller cython pyzipper -q
|
||||
@@ -58,14 +64,14 @@ copy "%PYD%" _core.pyd >nul
|
||||
%PY% -c "open('launcher.py','w').write('# -*- coding: utf-8 -*-\nfrom _core import main\nmain()\n')"
|
||||
|
||||
echo [4/6] Copy resources...
|
||||
copy "%TOOLS%\adb.exe" . >nul
|
||||
copy "%TOOLS%\AdbWinApi.dll" . >nul
|
||||
copy "%TOOLS%\AdbWinUsbApi.dll" . >nul
|
||||
copy "%TOOLS%\7za.exe" . >nul
|
||||
if exist "%ROOT%\app.ico" copy "%ROOT%\app.ico" . >nul
|
||||
|
||||
echo [5/6] PyInstaller...
|
||||
%PY% -m PyInstaller --onefile --windowed --name="%NAME%" --icon="%ROOT%\app.ico" --add-data "%TOOLS%\adb.exe;." --add-data "%TOOLS%\AdbWinApi.dll;." --add-data "%TOOLS%\AdbWinUsbApi.dll;." --add-data "%TOOLS%\7za.exe;." --add-binary "_core.pyd;." --hidden-import=queue --hidden-import=threading --hidden-import=tkinter --hidden-import=tkinter.simpledialog --hidden-import=zipfile --hidden-import=json --hidden-import=urllib --hidden-import=urllib.parse --collect-all tkinter --uac-admin launcher.py
|
||||
copy "%TOOLS%\adb.exe" . >nul
|
||||
copy "%TOOLS%\AdbWinApi.dll" . >nul
|
||||
copy "%TOOLS%\AdbWinUsbApi.dll" . >nul
|
||||
copy "%TOOLS%\7za.exe" . >nul
|
||||
copy "%ICON%" . >nul
|
||||
|
||||
echo [5/6] PyInstaller...
|
||||
%PY% -m PyInstaller --onefile --windowed --name="%NAME%" --icon="%ICON%" --add-data "%ICON%;." --add-data "%TOOLS%\adb.exe;." --add-data "%TOOLS%\AdbWinApi.dll;." --add-data "%TOOLS%\AdbWinUsbApi.dll;." --add-data "%TOOLS%\7za.exe;." --add-binary "_core.pyd;." --hidden-import=queue --hidden-import=threading --hidden-import=tkinter --hidden-import=tkinter.simpledialog --hidden-import=zipfile --hidden-import=json --hidden-import=urllib --hidden-import=urllib.parse --collect-all tkinter --uac-admin launcher.py
|
||||
if errorlevel 1 (
|
||||
cd ..
|
||||
echo [ERROR] PyInstaller failed
|
||||
@@ -79,9 +85,9 @@ rmdir /s /q build 2>nul
|
||||
cd ..
|
||||
goto :DONE
|
||||
|
||||
:NORMAL
|
||||
echo [INFO] Normal PyInstaller...
|
||||
%PY% -m PyInstaller --onefile --windowed --name="%NAME%" --icon="%ROOT%\app.ico" --add-data "%TOOLS%\adb.exe;." --add-data "%TOOLS%\AdbWinApi.dll;." --add-data "%TOOLS%\AdbWinUsbApi.dll;." --add-data "%TOOLS%\7za.exe;." --hidden-import=queue --hidden-import=threading --hidden-import=tkinter --hidden-import=tkinter.simpledialog --hidden-import=zipfile --hidden-import=json --hidden-import=urllib --hidden-import=urllib.parse --collect-all tkinter --uac-admin %SRC%
|
||||
:NORMAL
|
||||
echo [INFO] Normal PyInstaller...
|
||||
%PY% -m PyInstaller --onefile --windowed --name="%NAME%" --icon="%ICON%" --add-data "%ICON%;." --add-data "%TOOLS%\adb.exe;." --add-data "%TOOLS%\AdbWinApi.dll;." --add-data "%TOOLS%\AdbWinUsbApi.dll;." --add-data "%TOOLS%\7za.exe;." --hidden-import=queue --hidden-import=threading --hidden-import=tkinter --hidden-import=tkinter.simpledialog --hidden-import=zipfile --hidden-import=json --hidden-import=urllib --hidden-import=urllib.parse --collect-all tkinter --uac-admin %SRC%
|
||||
|
||||
:DONE
|
||||
echo.
|
||||
|
||||
Reference in New Issue
Block a user