f5749947e1
Pillow's ICO saver stores all sizes as PNG-compressed ("Vista icon"
format). PyInstaller's Windows resource-updater cannot embed
PNG-compressed entries for small sizes and silently falls back to its
default gear icon.
Fix build_icons.py to write the ICO manually: BMP DIB for sizes ≤ 128 px,
PNG only for the 256 px entry (where Windows Explorer expects PNG).
Regenerate icons/app.ico with the new code.
Also set upx=False in bcc.spec for the Windows/Linux EXE; UPX is another
known cause of icon resources being stripped from PE files.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
112 lines
2.8 KiB
RPMSpec
112 lines
2.8 KiB
RPMSpec
# -*- mode: python ; coding: utf-8 -*-
|
|
#
|
|
# PyInstaller spec for Better Claude Config.
|
|
#
|
|
# macOS → onedir build wrapped in a .app bundle (double-click native)
|
|
# Windows → onefile .exe (no console window)
|
|
# Linux → onefile binary (no console window)
|
|
#
|
|
# Build:
|
|
# pip install pyinstaller
|
|
# pyinstaller bcc.spec
|
|
#
|
|
# Output:
|
|
# macOS → dist/BetterClaudeConfig.app
|
|
# Windows → dist/BetterClaudeConfig.exe
|
|
# Linux → dist/BetterClaudeConfig
|
|
|
|
import sys
|
|
|
|
APP_NAME = "BetterClaudeConfig"
|
|
BUNDLE_ID = "com.betterclaude.config"
|
|
|
|
if sys.platform == "darwin":
|
|
icon = "icons/app.icns"
|
|
elif sys.platform == "win32":
|
|
icon = "icons/app.ico"
|
|
else:
|
|
icon = None # Linux: icon embedded via .desktop file, not the binary
|
|
|
|
a = Analysis(
|
|
["bcc.py"],
|
|
pathex=[],
|
|
binaries=[],
|
|
datas=[],
|
|
hiddenimports=[],
|
|
hookspath=[],
|
|
hooksconfig={},
|
|
runtime_hooks=[],
|
|
excludes=["_tkinter", "tkinter"],
|
|
noarchive=False,
|
|
)
|
|
pyz = PYZ(a.pure)
|
|
|
|
if sys.platform == "darwin":
|
|
# ------------------------------------------------------------------ macOS
|
|
# onedir so PyInstaller produces a proper .app bundle structure.
|
|
exe = EXE(
|
|
pyz,
|
|
a.scripts,
|
|
[],
|
|
exclude_binaries=True,
|
|
name=APP_NAME,
|
|
debug=False,
|
|
bootloader_ignore_signals=False,
|
|
strip=False,
|
|
upx=False,
|
|
console=False,
|
|
argv_emulation=True, # lets macOS open files by passing argv
|
|
target_arch=None,
|
|
codesign_identity=None,
|
|
entitlements_file=None,
|
|
icon=icon,
|
|
)
|
|
coll = COLLECT(
|
|
exe,
|
|
a.binaries,
|
|
a.datas,
|
|
strip=False,
|
|
upx=False,
|
|
upx_exclude=[],
|
|
name=APP_NAME,
|
|
)
|
|
app = BUNDLE(
|
|
coll,
|
|
name=f"{APP_NAME}.app",
|
|
icon=icon,
|
|
bundle_identifier=BUNDLE_ID,
|
|
info_plist={
|
|
"CFBundleName": "Better Claude Config",
|
|
"CFBundleDisplayName": "Better Claude Config",
|
|
"CFBundleShortVersionString": "1.0.0",
|
|
"CFBundleVersion": "1.0.0",
|
|
"NSHighResolutionCapable": True,
|
|
"NSRequiresAquaSystemAppearance": False, # supports dark mode
|
|
"LSMinimumSystemVersion": "11.0",
|
|
},
|
|
)
|
|
|
|
else:
|
|
# ----------------------------------------------- Windows / Linux (onefile)
|
|
exe = EXE(
|
|
pyz,
|
|
a.scripts,
|
|
a.binaries,
|
|
a.datas,
|
|
[],
|
|
name=APP_NAME,
|
|
debug=False,
|
|
bootloader_ignore_signals=False,
|
|
strip=False,
|
|
upx=False, # UPX can strip icon resources from the PE on Windows
|
|
upx_exclude=[],
|
|
runtime_tmpdir=None,
|
|
console=False,
|
|
disable_windowed_traceback=False,
|
|
argv_emulation=False,
|
|
target_arch=None,
|
|
codesign_identity=None,
|
|
entitlements_file=None,
|
|
icon=icon,
|
|
)
|