调整文件目录

This commit is contained in:
2026-07-07 14:37:04 +08:00
parent 98a1e9d371
commit 295558836b
53 changed files with 22339 additions and 4242 deletions
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

-95
View File
@@ -1,95 +0,0 @@
@echo off
chcp 65001 >nul
cd /d "%~dp0"
set "ROOT=%~dp0.."
set "TOOLS=%ROOT%\tools"
set NAME=启源Q07刷入工具
title %NAME% - Build
echo ============================================================
echo %NAME% - Cython Build
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%
echo [1/6] Installing deps...
%PY% -m pip install pyinstaller cython pyzipper -q
if errorlevel 1 (
%PY% -m pip install pyinstaller cython pyzipper -q -i https://pypi.tuna.tsinghua.edu.cn/simple
)
echo [2/6] Clean...
if exist "dist_cy" rmdir /s /q dist_cy 2>nul
if exist "build" rmdir /s /q build 2>nul
if exist "dist" rmdir /s /q dist 2>nul
echo [3/6] Cython compile...
mkdir dist_cy 2>nul
copy app.py dist_cy\_core.py >nul
%PY% -c "open('dist_cy/setup_cython.py','w').write('from setuptools import setup\nfrom Cython.Build import cythonize\nsetup(ext_modules=cythonize(\"_core.py\", compiler_directives={\"language_level\":\"3\"}))\n')"
cd dist_cy
%PY% setup_cython.py build_ext --inplace
if errorlevel 1 (
cd ..
echo [WARN] Cython failed, fallback
goto :NORMAL
)
for %%f in (_core*.pyd) do set PYD=%%f
if "%PYD%"=="" (
cd ..
echo [WARN] No pyd, fallback
goto :NORMAL
)
echo PYD: %PYD%
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=zipfile --hidden-import=json --hidden-import=urllib --collect-all tkinter --uac-admin launcher.py
if errorlevel 1 (
cd ..
echo [ERROR] PyInstaller failed
pause
exit /b
)
echo [6/6] Cleanup...
del /q _core.py _core.c _core.pyd %PYD% launcher.py setup_cython.py 2>nul
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=zipfile --hidden-import=json --hidden-import=urllib --collect-all tkinter --uac-admin app.py
:DONE
echo.
echo Done.
if exist "dist_cy\dist\%NAME%.exe" (
echo Output: dist_cy\dist\%NAME%.exe
) else if exist "dist\%NAME%.exe" (
echo Output: dist\%NAME%.exe
) else (
echo Check dist folder
)
pause
+45 -20
View File
@@ -3,8 +3,9 @@ chcp 65001 >nul
cd /d "%~dp0"
set "ROOT=%~dp0.."
set "TOOLS=%ROOT%\tools"
set NAME=启源Q07刷入工具
set SRC=app.py
set "ICON=%~dp0app.ico"
set NAME=Qiyuan_Q07-multi-lan-installer
set SRC=Qiyuan_Q07-multi-lan-installer.py
title %NAME% - Build
echo ============================================================
@@ -27,14 +28,42 @@ if errorlevel 1 (
%PY% -m pip install pyinstaller cython pyzipper -q -i https://pypi.tuna.tsinghua.edu.cn/simple
)
echo [2/6] Clean...
echo [2/7] Clean...
if exist "dist_cy" rmdir /s /q dist_cy 2>nul
if exist "build" rmdir /s /q build 2>nul
if exist "dist" rmdir /s /q dist 2>nul
echo [3/6] Cython compile...
echo [3/7] Checking resources...
if not exist "%ICON%" (
echo [ERROR] app.ico not found in Q07 folder: %ICON%
pause
exit /b 1
)
if not exist "%TOOLS%\adb.exe" (
echo [ERROR] Missing ADB file: %TOOLS%\adb.exe
pause
exit /b 1
)
if not exist "%TOOLS%\AdbWinApi.dll" (
echo [ERROR] Missing ADB file: %TOOLS%\AdbWinApi.dll
pause
exit /b 1
)
if not exist "%TOOLS%\AdbWinUsbApi.dll" (
echo [ERROR] Missing ADB file: %TOOLS%\AdbWinUsbApi.dll
pause
exit /b 1
)
if not exist "%TOOLS%\7za.exe" (
echo [ERROR] Missing 7za file: %TOOLS%\7za.exe
pause
exit /b 1
)
echo [4/7] Cython compile...
mkdir dist_cy 2>nul
copy %SRC% dist_cy\_core.py >nul
set "PYD="
%PY% -c "open('dist_cy/setup_cython.py','w').write('from setuptools import setup\nfrom Cython.Build import cythonize\nsetup(ext_modules=cythonize(\"_core.py\", compiler_directives={\"language_level\":\"3\"}))\n')"
@@ -42,54 +71,50 @@ cd dist_cy
%PY% setup_cython.py build_ext --inplace
if errorlevel 1 (
cd ..
echo [WARN] Cython failed, fallback
goto :NORMAL
echo [ERROR] Cython build failed. Install Microsoft C++ Build Tools and retry.
pause
exit /b 1
)
for %%f in (_core*.pyd) do set PYD=%%f
if "%PYD%"=="" (
cd ..
echo [WARN] No pyd, fallback
goto :NORMAL
echo [ERROR] Cython build did not generate _core*.pyd. Stop.
pause
exit /b 1
)
echo PYD: %PYD%
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...
echo [5/7] 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
copy "%ICON%" . >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
echo [6/7] 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
pause
exit /b
exit /b 1
)
echo [6/6] Cleanup...
echo [7/7] Cleanup...
del /q _core.py _core.c _core.pyd %PYD% launcher.py setup_cython.py 2>nul
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%
:DONE
echo.
echo Done.
if exist "dist_cy\dist\%NAME%.exe" (
echo Output: dist_cy\dist\%NAME%.exe
) else if exist "dist\%NAME%.exe" (
echo Output: dist\%NAME%.exe
) else (
echo Check dist folder
)