feat: 接入统一桌面端产品图标

使用根目录 icon 资源替换托盘占位图标,并为 macOS App、Windows 安装器和 Linux 安装脚本接入对应图标格式。
This commit is contained in:
Christ committed 2026-08-11 23:07:13 +08:00
1 parent 07fea7d1e6
commit 137a08489d
14 files changed
+78 -39

No files matched your search

+6
View File
@@ -20,6 +20,7 @@ fi
SERVER_SOURCE="${XIANYU_SERVER_SOURCE:-$SCRIPT_DIR/xianyu-server}"
BROWSER_SOURCE="${XIANYU_BROWSER_INSTALL_SOURCE:-$SCRIPT_DIR/browser-install}"
ICON_SOURCE="${XIANYU_ICON_SOURCE:-$SCRIPT_DIR/icon.png}"
if [[ ! -x "$SERVER_SOURCE" ]]; then
echo "找不到 xianyu-server:$SERVER_SOURCE" >&2
exit 1
@@ -28,6 +29,10 @@ if [[ ! -x "$BROWSER_SOURCE" ]]; then
echo "找不到 browser-install:$BROWSER_SOURCE" >&2
exit 1
fi
if [[ ! -f "$ICON_SOURCE" ]]; then
echo "找不到应用图标:$ICON_SOURCE" >&2
exit 1
fi
if ! getent group "$APP_NAME" >/dev/null; then
groupadd --system "$APP_NAME"
@@ -43,6 +48,7 @@ install -d -o "$APP_NAME" -g "$APP_NAME" -m 0750 "$DATA_DIR/playwright-driver" "
install -d -m 0750 "$CONFIG_DIR"
install -m 0755 "$SERVER_SOURCE" "$INSTALL_DIR/xianyu-server"
install -m 0755 "$BROWSER_SOURCE" "$INSTALL_DIR/browser-install"
install -D -m 0644 "$ICON_SOURCE" "/usr/share/icons/hicolor/512x512/apps/$APP_NAME.png"
install -m 0644 "$SCRIPT_DIR/ydisks-xianyu-helper.service" "/etc/systemd/system/$SERVICE_NAME"
if [[ ! -f "$CONFIG_DIR/config.env" ]]; then
+1
View File
@@ -13,4 +13,5 @@ systemctl disable --now "$SERVICE_NAME" >/dev/null 2>&1 || true
rm -f "/etc/systemd/system/$SERVICE_NAME"
systemctl daemon-reload
rm -rf "/opt/$APP_NAME"
rm -f "/usr/share/icons/hicolor/512x512/apps/$APP_NAME.png"
echo "程序和服务已移除;数据仍保留在 /var/lib/$APP_NAME。"
+2
View File
@@ -18,5 +18,7 @@
<true/>
<key>CFBundleExecutable</key>
<string>xianyu-tray</string>
<key>CFBundleIconFile</key>
<string>icon.icns</string>
</dict>
</plist>
+7 -4
View File
@@ -3,6 +3,8 @@ set -eu
VERSION="${1:?version is required}"
DIST_DIR="${2:?dist directory is required}"
SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
PROJECT_ROOT="$(CDPATH= cd -- "$SCRIPT_DIR/../.." && pwd)"
ROOT_DIR="$DIST_DIR/pkgroot"
APP="$ROOT_DIR/Applications/Ydisks Xianyu Helper.app"
PACKAGE_PATH="$DIST_DIR/Ydisks-Xianyu-Helper-$VERSION.pkg"
@@ -13,9 +15,10 @@ mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Helpers" "$APP/Contents/Resources"
cp "$DIST_DIR/xianyu-server" "$APP/Contents/Helpers/xianyu-server"
cp "$DIST_DIR/browser-install" "$APP/Contents/Helpers/browser-install"
cp "$DIST_DIR/xianyu-tray" "$APP/Contents/MacOS/xianyu-tray"
cp "$(dirname "$0")/com.ydisks.xianyu-helper.server.plist.template" "$APP/Contents/Resources/"
cp "$(dirname "$0")/com.ydisks.xianyu-helper.tray.plist.template" "$APP/Contents/Resources/"
sed "s/__VERSION__/$VERSION/g" "$(dirname "$0")/Info.plist" > "$APP/Contents/Info.plist"
cp "$SCRIPT_DIR/com.ydisks.xianyu-helper.server.plist.template" "$APP/Contents/Resources/"
cp "$SCRIPT_DIR/com.ydisks.xianyu-helper.tray.plist.template" "$APP/Contents/Resources/"
cp "$PROJECT_ROOT/icon/macos/icon.icns" "$APP/Contents/Resources/icon.icns"
sed "s/__VERSION__/$VERSION/g" "$SCRIPT_DIR/Info.plist" > "$APP/Contents/Info.plist"
chmod 0755 "$APP/Contents/MacOS/xianyu-tray" "$APP/Contents/Helpers/xianyu-server" "$APP/Contents/Helpers/browser-install"
if [ -n "${MACOS_SIGNING_IDENTITY:-}" ]; then
@@ -47,7 +50,7 @@ rm -f "$PACKAGE_PATH" "$UNSIGNED_PACKAGE_PATH"
pkgbuild \
--root "$ROOT_DIR" \
--scripts "$(dirname "$0")/scripts" \
--scripts "$SCRIPT_DIR/scripts" \
--identifier com.ydisks.xianyu-helper \
--version "$VERSION" \
--install-location / \
+3 -1
View File
@@ -15,7 +15,8 @@ OutputBaseFilename=Ydisks-Xianyu-Helper-Setup
PrivilegesRequired=admin
ArchitecturesInstallIn64BitMode=x64compatible
DisableProgramGroupPage=yes
UninstallDisplayIcon={app}\{#AppExeName}
UninstallDisplayIcon={app}\icon.ico
SetupIconFile=..\..\icon\windows\icon.ico
Compression=lzma2
SolidCompression=yes
@@ -23,6 +24,7 @@ SolidCompression=yes
Source: "..\..\dist\windows\xianyu-server.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\dist\windows\browser-install.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\dist\windows\xianyu-tray.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\icon\windows\icon.ico"; DestDir: "{app}"; Flags: ignoreversion
[Dirs]
Name: "{#AppDataDir}\data"