From de09eacabc1c05a1eacbf79d341b5abe81589cd6 Mon Sep 17 00:00:00 2001 From: jianf <2198972886@qq.com> Date: Fri, 17 Apr 2026 08:27:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20AppImage=20?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E8=84=9A=E6=9C=AC=E7=9A=84=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 创建缺失的 usr/share/trulymem 目录 - 修复 desktop 文件分类,使用 X-AI 替代非标准的 AI - 改进图标文件查找逻辑,支持多个可能的位置 - 添加完整的构建临时文件清理逻辑 - 成功时自动删除 AppDir,失败时保留以便调试 🤖 Generated with CodeArts Agent --- build/build_appimage.sh | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/build/build_appimage.sh b/build/build_appimage.sh index dc73e01..cef4bed 100755 --- a/build/build_appimage.sh +++ b/build/build_appimage.sh @@ -11,6 +11,7 @@ fi APPDIR="$PROJECT_ROOT/TrulyMEM.AppDir" rm -rf "$APPDIR" mkdir -p "$APPDIR/usr/bin" +mkdir -p "$APPDIR/usr/share/trulymem" echo "===== Step 1: Build binary with PyInstaller =====" VENV_DIR="$PROJECT_ROOT/.venv_appimage" rm -rf "$VENV_DIR" @@ -80,9 +81,21 @@ Exec=TrulyMEM %U Icon=trulymem Terminal=true Type=Application -Categories=Utility;AI; +Categories=Utility;X-AI; EOF -[ -f "$PROJECT_ROOT/pic/TrulyMEM.png" ] && cp "$PROJECT_ROOT/pic/TrulyMEM.png" "$APPDIR/trulymem.png" +# Copy icon file (try multiple possible locations) +if [ -f "$PROJECT_ROOT/pic/TrulyMEM.png" ]; then + cp "$PROJECT_ROOT/pic/TrulyMEM.png" "$APPDIR/trulymem.png" +elif [ -f "$PROJECT_ROOT/pic/TrulyMEM.iconset/icon_256x256.png" ]; then + cp "$PROJECT_ROOT/pic/TrulyMEM.iconset/icon_256x256.png" "$APPDIR/trulymem.png" +elif [ -f "$PROJECT_ROOT/pic/TrulyMEM.iconset/icon_128x128.png" ]; then + cp "$PROJECT_ROOT/pic/TrulyMEM.iconset/icon_128x128.png" "$APPDIR/trulymem.png" +else + echo "Warning: No icon file found, creating placeholder" + # Create a simple placeholder icon + convert -size 256x256 xc:blue "$APPDIR/trulymem.png" 2>/dev/null || \ + echo "Note: Install ImageMagick to generate placeholder icon" +fi APPIMAGE="$PROJECT_ROOT/TrulyMEM.AppImage" rm -f "$APPIMAGE" echo "===== Step 3: Package as AppImage =====" @@ -108,7 +121,17 @@ fi echo "===== Build Complete =====" [ -f "$APPIMAGE" ] && echo "AppImage: $APPIMAGE" && ls -la "$APPIMAGE" [ -d "$APPDIR" ] && echo "AppDir: $APPDIR (can be packaged manually with appimagetool)" +echo "===== Cleaning up build artifacts =====" deactivate rm -rf "$VENV_DIR" +rm -rf "$PROJECT_ROOT/build/pyinstaller_build" +rm -rf "$PROJECT_ROOT/build/pyinstaller_build" rm -f /tmp/appimagetool +# Only remove AppDir if AppImage was successfully created +if [ -f "$APPIMAGE" ]; then + echo "Removing AppDir since AppImage was created successfully" + rm -rf "$APPDIR" +else + echo "Keeping AppDir for manual packaging" +fi echo "Done!" \ No newline at end of file