Skip to content

Commit

Permalink
Windows icon as ico file
Browse files Browse the repository at this point in the history
  • Loading branch information
scosman committed Feb 10, 2025
1 parent 3637150 commit 85924e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions app/desktop/build_desktop_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,30 +41,27 @@ echo "Building for $(uname)"
if [ "$(uname)" == "Darwin" ]; then
echo "Building MacOS app"
cp desktop/mac_taskbar.png desktop/build/taskbar.png
cp desktop/mac_icon.png desktop/build/icon.png
# onedir launches faster, and still looks like 1 file with MacOS .app bundles
PLATFORM_OPTS="--onedir --windowed --osx-bundle-identifier=com.kiln-ai.kiln.studio"
PLATFORM_OPTS="--onedir --windowed --icon=../mac_icon.png --osx-bundle-identifier=com.kiln-ai.kiln.studio"

PY_PLAT=$(python -c 'import platform; print(platform.machine())')
echo "Building MacOS app for single platform ($PY_PLAT)"
elif [[ "$(uname)" =~ ^MINGW64_NT-10.0 ]] || [[ "$(uname)" =~ ^MSYS_NT-10.0 ]]; then
echo "Building Windows App"
cp desktop/win_taskbar.png desktop/build/taskbar.png
cp desktop/win_icon.png desktop/build/icon.png
PLATFORM_OPTS="--windowed --splash=../win_splash.png"
PLATFORM_OPTS="--windowed --splash=../win_splash.png --icon=../win_icon.ico"
elif [ "$(uname)" == "Linux" ]; then
echo "Building Linux App"
cp desktop/mac_taskbar.png desktop/build/taskbar.png
cp desktop/mac_icon.png desktop/build/icon.png
PLATFORM_OPTS="--windowed --onefile --splash=../win_splash.png"
PLATFORM_OPTS="--windowed --onefile --splash=../win_splash.png --icon=../mac_icon.png"
else
echo "Unsupported operating system: $(uname)"
exit 1
fi

# Builds the desktop app
# TODO: use a spec instead of long winded command line
pyinstaller $(printf %s "$PLATFORM_OPTS") --icon="./icon.png" \
pyinstaller $(printf %s "$PLATFORM_OPTS") \
--add-data "./taskbar.png:." --add-data "../../web_ui/build:./web_ui/build" \
--noconfirm --distpath=./desktop/build/dist --workpath=./desktop/build/work \
-n Kiln --specpath=./desktop/build \
Expand Down
Binary file added app/desktop/win_icon.ico
Binary file not shown.

0 comments on commit 85924e9

Please sign in to comment.