commit 26a5d1b00e30be8f1f08b333ae606e37e57f0c13
parent 74294685b09795fda23e7ab692dffe83c9cc0b00
Author: ganten7 <ganten7@users.noreply.github.com>
Date: Sat, 13 Dec 2025 23:24:17 -0600
Fix Windows/macOS builds - use explicit Python module and exclude problematic dependencies
Diffstat:
2 files changed, 94 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
@@ -102,14 +102,23 @@ jobs:
- name: Build executable with PyInstaller
shell: pwsh
run: |
- pyinstaller --onefile --windowed --name ivory `
- --add-data "chord_detector.py;." `
+ python -m PyInstaller --onefile --windowed --name ivory `
--hidden-import chord_detector `
+ --collect-submodules chord_detector `
--hidden-import PyQt5.QtCore `
--hidden-import PyQt5.QtGui `
--hidden-import PyQt5.QtWidgets `
+ --hidden-import PyQt5.QtWidgets.QApplication `
+ --collect-all PyQt5 `
--hidden-import mido `
--hidden-import rtmidi `
+ --collect-all mido `
+ --collect-all rtmidi `
+ --exclude-module tkinter `
+ --exclude-module matplotlib `
+ --exclude-module numpy `
+ --exclude-module scipy `
+ --exclude-module pandas `
ivory.py
if ($LASTEXITCODE -ne 0) {
@@ -128,6 +137,10 @@ jobs:
Get-ChildItem "dist/" | Select-Object Name
exit 1
}
+
+ # Verify it's a valid PE executable (not Node.js)
+ Write-Host "Verifying executable..."
+ file dist/ivory.exe || Get-Item dist/ivory.exe | Select-Object Length, LastWriteTime
- name: Upload artifact
uses: actions/upload-artifact@v4
@@ -153,14 +166,21 @@ jobs:
- name: Build .app bundle
run: |
# PyInstaller with --windowed creates .app bundle automatically
- pyinstaller --onedir --windowed --name Ivory \
- --add-data "chord_detector.py:." \
+ python -m PyInstaller --onedir --windowed --name Ivory \
--hidden-import chord_detector \
+ --collect-submodules chord_detector \
--hidden-import PyQt5.QtCore \
--hidden-import PyQt5.QtGui \
--hidden-import PyQt5.QtWidgets \
+ --hidden-import PyQt5.QtWidgets.QApplication \
+ --collect-all PyQt5 \
--hidden-import mido \
--hidden-import rtmidi \
+ --collect-all mido \
+ --collect-all rtmidi \
+ --exclude-module tkinter \
+ --exclude-module matplotlib \
+ --exclude-module numpy \
ivory.py || {
echo "PyInstaller failed, checking output..."
ls -la dist/ || true
@@ -171,6 +191,8 @@ jobs:
# Move the .app bundle to current directory
if [ -d "dist/Ivory.app" ]; then
mv dist/Ivory.app .
+ # Remove quarantine attribute (helps with Gatekeeper)
+ xattr -cr Ivory.app || true
else
echo "Error: Ivory.app not found in dist/"
echo "Contents of dist/:"
diff --git a/INSTALLATION_NOTES.md b/INSTALLATION_NOTES.md
@@ -0,0 +1,68 @@
+# Installation Notes for Windows and macOS
+
+## Windows Installation
+
+If you encounter a "JavaScript error" or "Node.js error" when running `ivory.exe`:
+
+1. **This is a known issue** - The executable may have been incorrectly packaged. Please download the latest build from the releases page.
+
+2. **Alternative: Run from source**
+ ```bash
+ pip install -r requirements_pyqt5.txt
+ python ivory.py
+ ```
+
+3. **Check Windows Defender** - Sometimes antivirus software blocks PyInstaller executables. Add an exception if needed.
+
+## macOS Installation
+
+### Gatekeeper Warning
+
+macOS may block the application because it's not signed. To open it:
+
+1. **Right-click** (or Control-click) the `Ivory.dmg` file
+2. Select **"Open"** from the context menu
+3. When prompted, click **"Open"** again
+
+### Alternative: Remove Quarantine Attribute
+
+If the above doesn't work, open Terminal and run:
+
+```bash
+# Navigate to where you downloaded Ivory.dmg
+cd ~/Downloads
+
+# Mount the DMG
+hdiutil attach Ivory.dmg
+
+# Remove quarantine attribute
+xattr -cr /Volumes/Ivory/Ivory.app
+
+# Copy to Applications
+cp -R /Volumes/Ivory/Ivory.app /Applications/
+
+# Unmount
+hdiutil detach /Volumes/Ivory
+```
+
+### Run from Source (Recommended for Testing)
+
+```bash
+pip3 install -r requirements_pyqt5.txt
+python3 ivory.py
+```
+
+## Troubleshooting
+
+### Windows: "The application failed to initialize properly"
+- Install [Visual C++ Redistributable](https://aka.ms/vs/17/release/vc_redist.x64.exe)
+- Ensure Python 3.6+ is installed (though the .exe should be standalone)
+
+### macOS: "Ivory.app is damaged and can't be opened"
+- This is a Gatekeeper issue. Use the methods above to bypass it.
+- Or run: `sudo xattr -rd com.apple.quarantine /Applications/Ivory.app`
+
+### Both Platforms: Missing MIDI Input
+- Ensure your MIDI device is connected and recognized by the OS
+- Check system MIDI settings
+- Try selecting a different MIDI input from the application menu