换位置
This commit is contained in:
@@ -3,6 +3,7 @@ chcp 65001 >nul
|
||||
title Server Manager - 打包便携版
|
||||
for %%I in ("%~dp0..\..") do set "ROOT=%%~fI"
|
||||
set "SRC=%ROOT%\src"
|
||||
set "APP_NAME=ServerManager"
|
||||
pushd "%SRC%" || (
|
||||
echo [错误] 未找到 src 目录: %SRC%
|
||||
exit /b 1
|
||||
@@ -42,11 +43,11 @@ if not exist "%ROOT%\resources\icon\icon.ico" (
|
||||
echo [3/5] 清理旧的构建文件...
|
||||
if exist "dist" rd /s /q dist
|
||||
if exist "build" rd /s /q build
|
||||
if exist "main.spec" del /q "main.spec"
|
||||
if exist "%APP_NAME%.spec" del /q "%APP_NAME%.spec"
|
||||
|
||||
echo [4/5] 开始打包(单文件版本)...
|
||||
pyinstaller --noconfirm --onefile --windowed ^
|
||||
--name "main" ^
|
||||
--name "%APP_NAME%" ^
|
||||
%ICON_PARAM% ^
|
||||
--add-data "%ROOT%\resources\icon;icon" ^
|
||||
--hidden-import "PyQt6.QtWidgets" ^
|
||||
@@ -72,7 +73,7 @@ if errorlevel 1 (
|
||||
echo [错误] 打包失败,尝试使用目录模式...
|
||||
|
||||
pyinstaller --noconfirm --onedir --windowed ^
|
||||
--name "main" ^
|
||||
--name "%APP_NAME%" ^
|
||||
%ICON_PARAM% ^
|
||||
--add-data "%ROOT%\resources\icon;icon" ^
|
||||
--hidden-import "PyQt6.QtWidgets" ^
|
||||
@@ -104,10 +105,10 @@ echo [5/5] 打包完成!
|
||||
|
||||
echo.
|
||||
echo ============================================================
|
||||
if exist "dist\main.exe" (
|
||||
echo 打包成功!单文件版本: dist\main.exe
|
||||
) else if exist "dist\main\main.exe" (
|
||||
echo 打包成功!目录版本: dist\main\main.exe
|
||||
if exist "dist\%APP_NAME%.exe" (
|
||||
echo 打包成功!单文件版本: dist\%APP_NAME%.exe
|
||||
) else if exist "dist\%APP_NAME%\%APP_NAME%.exe" (
|
||||
echo 打包成功!目录版本: dist\%APP_NAME%\%APP_NAME%.exe
|
||||
)
|
||||
echo ============================================================
|
||||
echo.
|
||||
|
||||
Reference in New Issue
Block a user