58 lines
1.1 KiB
Batchfile
58 lines
1.1 KiB
Batchfile
@echo off
|
|
echo 开始打包 NotifyWin...
|
|
|
|
:: 创建图标目录
|
|
if not exist icons mkdir icons
|
|
|
|
:: 生成图标
|
|
echo 生成图标...
|
|
python create_icon.py
|
|
|
|
:: 清理旧的构建文件
|
|
if exist build rmdir /s /q build
|
|
if exist dist rmdir /s /q dist
|
|
|
|
:: 临时删除 typing 包
|
|
echo 删除 typing 包...
|
|
pip uninstall -y typing
|
|
|
|
:: 打包
|
|
echo 开始打包...
|
|
pyinstaller ^
|
|
--name=NotifyWin ^
|
|
--noconsole ^
|
|
--onefile ^
|
|
--icon=icons/notify.ico ^
|
|
--add-data="config.yml;." ^
|
|
--hidden-import=websockets ^
|
|
--hidden-import=winotify ^
|
|
--hidden-import=yaml ^
|
|
--hidden-import=PIL ^
|
|
--hidden-import=pystray ^
|
|
--hidden-import=asyncio ^
|
|
--hidden-import=logging ^
|
|
--hidden-import=logging.handlers ^
|
|
--hidden-import=pyperclip ^
|
|
notification_client.py
|
|
|
|
:: 复制必要文件
|
|
echo 复制配置文件...
|
|
if not exist dist mkdir dist
|
|
copy config.yml dist\config.yml
|
|
|
|
:: 复制图标目录
|
|
if exist icons (
|
|
echo 复制图标...
|
|
xcopy /s /i icons dist\icons
|
|
)
|
|
|
|
:: 复制声音目录
|
|
if exist sounds (
|
|
echo 复制声音...
|
|
xcopy /s /i sounds dist\sounds
|
|
)
|
|
|
|
echo 打包完成!
|
|
echo 生成的文件在 dist 目录中
|
|
|
|
pause |