Fix missing icon file issue on Windows build

- Make icon files optional in PyInstaller spec
- Check for icon.ico existence before using it on Windows
- Check for icon.icns existence before using it on macOS
- Added ICON_INFO.md with instructions for creating icon files
- Build will now succeed even without icon files present
parent 8a4863ab
# Icon Files for MBetter USB Creator
## Optional Icon Files
The build script will look for these icon files but they are optional:
- **Windows**: `icon.ico` - Windows icon file (.ico format)
- **macOS**: `icon.icns` - macOS icon file (.icns format)
## Creating Icon Files
If you want to add icons to the executable:
### For Windows (.ico):
1. Create or find a suitable PNG/JPG image (preferably 256x256 or smaller)
2. Convert to .ico format using online tools like:
- https://convertio.co/png-ico/
- https://icoconvert.com/
3. Save as `icon.ico` in the same directory as `build_usb_creator.py`
### For macOS (.icns):
1. Create or find a suitable PNG image (preferably 512x512 or 1024x1024)
2. Convert to .icns format using tools like:
- Icon Composer (part of Xcode developer tools)
- Online converters like https://cloudconvert.com/png-to-icns
3. Save as `icon.icns` in the same directory as `build_usb_creator.py`
## Note
If no icon files are present, the executable will build successfully without icons. The icons are purely cosmetic and don't affect functionality.
\ No newline at end of file
...@@ -104,14 +104,14 @@ exe = EXE( ...@@ -104,14 +104,14 @@ exe = EXE(
target_arch=None, target_arch=None,
codesign_identity=None, codesign_identity=None,
entitlements_file=None, entitlements_file=None,
icon='icon.ico' if is_windows else None, icon='icon.ico' if is_windows and os.path.exists('icon.ico') else None,
) )
# Create app bundle on macOS # Create app bundle on macOS
if sys.platform == 'darwin': if sys.platform == 'darwin':
app = BUNDLE(exe, app = BUNDLE(exe,
name='MBetterUSBCreator.app', name='MBetterUSBCreator.app',
icon='icon.icns', icon='icon.icns' if os.path.exists('icon.icns') else None,
bundle_identifier='com.mbetter.usbcreator') bundle_identifier='com.mbetter.usbcreator')
''' '''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment