Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dist
*.tgz
.build
apps/electron/release
apps/electron/electron-builder.generated.yml
apps/electron/resources/session-mcp-server/
apps/electron/resources/pi-agent-server/

Expand Down
166 changes: 0 additions & 166 deletions apps/electron/electron-builder.modelstudio.yml

This file was deleted.

8 changes: 4 additions & 4 deletions apps/electron/electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ asar: false

mac:
category: public.app-category.productivity
icon: resources/icon.icns
icon: resources/brands/qwen-code/icon.icns
# macOS 26+ Liquid Glass: Tell macOS to look for icon in Assets.car
# The value must match --app-icon used in actool (see afterPack.js)
extendInfo:
Expand Down Expand Up @@ -108,7 +108,7 @@ dmg:
# Custom background (multi-resolution TIFF with 1x+2x for retina support)
background: resources/dmg-background.tiff
# Use app icon as the mounted volume icon in Finder
icon: resources/icon.icns
icon: resources/brands/qwen-code/icon.icns
iconSize: 80
title: "Qwen Code Desktop"
contents:
Expand All @@ -123,7 +123,7 @@ dmg:
height: 380

win:
icon: resources/icon.ico
icon: resources/brands/qwen-code/icon.ico
target:
- target: nsis
arch:
Expand Down Expand Up @@ -164,7 +164,7 @@ nsis:
deleteAppDataOnUninstall: true

linux:
icon: resources/icon.png
icon: resources/brands/qwen-code/icon.png
category: Utility
maintainer: "Alibaba Group"
target:
Expand Down
Binary file added apps/electron/resources/brands/openwork/dock.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/electron/resources/brands/qwen-code/dock.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
36 changes: 20 additions & 16 deletions apps/electron/resources/generate-icons.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
#!/bin/bash
# Generate app icons for all platforms from a source PNG
# Usage: ./generate-icons.sh source.png
# Usage: ./generate-icons.sh source.png [brand-id]

set -e

SOURCE="${1:-source.png}"
BRAND_ID="${2:-qwen-code}"
OUTPUT_DIR="brands/$BRAND_ID"

if [ ! -f "$SOURCE" ]; then
echo "Error: Source file '$SOURCE' not found"
echo "Usage: ./generate-icons.sh source.png"
echo "Usage: ./generate-icons.sh source.png [brand-id]"
exit 1
fi

echo "Generating icons from: $SOURCE"
echo "Output brand directory: $OUTPUT_DIR"
mkdir -p "$OUTPUT_DIR"

# Create temporary iconset directory for macOS
ICONSET="icon.iconset"
ICONSET="$OUTPUT_DIR/icon.iconset"
rm -rf "$ICONSET"
mkdir -p "$ICONSET"

Expand All @@ -34,29 +38,29 @@ sips -z 1024 1024 "$SOURCE" --out "$ICONSET/[email protected]" > /dev/null

# Generate .icns for macOS
echo "Creating icon.icns..."
iconutil -c icns "$ICONSET" -o icon.icns
iconutil -c icns "$ICONSET" -o "$OUTPUT_DIR/icon.icns"

# Generate icon.png for Linux (512x512)
echo "Creating icon.png for Linux..."
sips -z 512 512 "$SOURCE" --out icon.png > /dev/null
sips -z 512 512 "$SOURCE" --out "$OUTPUT_DIR/icon.png" > /dev/null

# Generate icon.ico for Windows using ImageMagick (if available)
# If not, we'll create individual PNGs that can be converted online
if command -v convert &> /dev/null; then
echo "Creating icon.ico for Windows..."
# Create multiple sizes for ICO
sips -z 16 16 "$SOURCE" --out icon_16.png > /dev/null
sips -z 24 24 "$SOURCE" --out icon_24.png > /dev/null
sips -z 32 32 "$SOURCE" --out icon_32.png > /dev/null
sips -z 48 48 "$SOURCE" --out icon_48.png > /dev/null
sips -z 64 64 "$SOURCE" --out icon_64.png > /dev/null
sips -z 128 128 "$SOURCE" --out icon_128.png > /dev/null
sips -z 256 256 "$SOURCE" --out icon_256.png > /dev/null
sips -z 16 16 "$SOURCE" --out "$OUTPUT_DIR/icon_16.png" > /dev/null
sips -z 24 24 "$SOURCE" --out "$OUTPUT_DIR/icon_24.png" > /dev/null
sips -z 32 32 "$SOURCE" --out "$OUTPUT_DIR/icon_32.png" > /dev/null
sips -z 48 48 "$SOURCE" --out "$OUTPUT_DIR/icon_48.png" > /dev/null
sips -z 64 64 "$SOURCE" --out "$OUTPUT_DIR/icon_64.png" > /dev/null
sips -z 128 128 "$SOURCE" --out "$OUTPUT_DIR/icon_128.png" > /dev/null
sips -z 256 256 "$SOURCE" --out "$OUTPUT_DIR/icon_256.png" > /dev/null

convert icon_16.png icon_24.png icon_32.png icon_48.png icon_64.png icon_128.png icon_256.png icon.ico
convert "$OUTPUT_DIR/icon_16.png" "$OUTPUT_DIR/icon_24.png" "$OUTPUT_DIR/icon_32.png" "$OUTPUT_DIR/icon_48.png" "$OUTPUT_DIR/icon_64.png" "$OUTPUT_DIR/icon_128.png" "$OUTPUT_DIR/icon_256.png" "$OUTPUT_DIR/icon.ico"

# Clean up temp files
rm -f icon_16.png icon_24.png icon_32.png icon_48.png icon_64.png icon_128.png icon_256.png
rm -f "$OUTPUT_DIR"/icon_*.png
else
echo "Warning: ImageMagick not installed. Skipping .ico generation."
echo "Install with: brew install imagemagick"
Expand All @@ -68,9 +72,9 @@ rm -rf "$ICONSET"

echo ""
echo "✅ Icons generated:"
ls -la icon.*
ls -la "$OUTPUT_DIR"/icon.*

echo ""
echo "Next steps:"
echo "1. Update apps/electron/src/main/index.ts to use icon.icns on macOS"
echo "1. Ensure BRAND.assets points to resources/brands/$BRAND_ID/"
echo "2. Run: bun run electron:build:resources"
Binary file removed apps/electron/resources/icon.icns
Binary file not shown.
14 changes: 11 additions & 3 deletions apps/electron/scripts/afterPack.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
* into the app bundle when present. Without it, macOS falls back to icon.icns.
*
* If a future Icon Composer workflow produces Assets.car for the current app
* icon, place it at resources/Assets.car and this hook will bundle it.
* icon, place it at resources/brands/<brand>/Assets.car and this hook will
* bundle it.
*
* For older macOS versions, or builds without Assets.car, the app falls back
* to icon.icns which is included separately by electron-builder.
Expand All @@ -24,14 +25,21 @@ module.exports = async function afterPack(context) {
const appPath = context.appOutDir;
const productName = context.packager.appInfo.productName;
const resourcesDir = path.join(appPath, `${productName}.app`, 'Contents', 'Resources');
const precompiledAssets = path.join(context.packager.projectDir, 'resources', 'Assets.car');
const brandId = process.env.CRAFT_BRAND || 'qwen-code';
const precompiledAssets = path.join(
context.packager.projectDir,
'resources',
'brands',
brandId,
'Assets.car',
);

console.log(`afterPack: projectDir=${context.packager.projectDir}`);
console.log(`afterPack: looking for Assets.car at ${precompiledAssets}`);

// Check if pre-compiled Assets.car exists
if (!fs.existsSync(precompiledAssets)) {
console.log('Warning: Pre-compiled Assets.car not found in resources/');
console.log(`Warning: Pre-compiled Assets.car not found for brand ${brandId}`);
console.log('The app will use the fallback icon.icns on all macOS versions');
return;
}
Expand Down
Loading