specter-desktop/pyinstaller
Chris Beams f5a11fc136
Enable macOS dock icon (#520)
Prior to this change, Specter desktop had no dock icon on macOS, only a
menu bar icon. This meant that users were forced to navigate with the
cursor to the menu bar icon and select 'Open Specter App' in order to
focus the Specter desktop window, resulting in a confusing and
cumbersome user experience.

The original commit of `specter_desktop.spec` in commit 2a799dde set the
macOS launch services `LSUIElement` key to `1` for unknown reasons.
This, along with what appears to be a default value of `False` for the
`LSBackgroundOnly` key have the effect of disabling the dock icon.

This change sets the value for both of these keys to to `False`,
enabling the dock icon to appear as expected. Experimentation showed
that eliminating one or both keys was not enough; they both must
explicitly be set to `False`.

See the Apple Information Property List Launch Services Keys developer
documentation for further details.

Fixes #455.
2020-10-16 16:12:38 +02:00
..
hooks blacklify everything (#464) 2020-09-30 11:42:30 +02:00
icons app: run threaded server (#370) 2020-09-09 21:39:37 +02:00
windll Pyinstaller builds (#258) 2020-07-26 11:20:13 +02:00
build-osx.sh add pip-compile and hash support for security/reproducibility (#496) 2020-10-11 18:48:55 +02:00
build-unix.sh add pip-compile and hash support for security/reproducibility (#496) 2020-10-11 18:48:55 +02:00
build-win.bat add pip-compile and hash support for security/reproducibility (#496) 2020-10-11 18:48:55 +02:00
hwibridge.py blacklify everything (#464) 2020-09-30 11:42:30 +02:00
hwibridge.spec add hwibridge binary (#271) 2020-08-04 14:01:43 +02:00
README.md add pip-compile and hash support for security/reproducibility (#496) 2020-10-11 18:48:55 +02:00
requirements.in fix broken windows build (#508) 2020-10-15 12:27:44 +02:00
requirements.txt fix broken windows build (#508) 2020-10-15 12:27:44 +02:00
specter-desktop.iss fix #407 showing proper version in windows binary (#431) 2020-09-23 15:31:08 +02:00
specter_desktop.py blacklify everything (#464) 2020-09-30 11:42:30 +02:00
specter_desktop.spec Enable macOS dock icon (#520) 2020-10-16 16:12:38 +02:00
specterd.py blacklify everything (#464) 2020-09-30 11:42:30 +02:00
specterd.spec move version checker to a thread (#421) 2020-09-21 18:12:03 +02:00

Build scripts

Run build-<your-os> <version_number> file to build everything.

For example, build-osx.sh 1.2.3 will create SpecterDesktop-1.2.3.dmg and specterd-1.2.3-osx.zip in the release folder.

On Windows release folder is empty, but dist folder contains a specter_desktop folder for inno setup and specterd.exe binary.

Pyinstaller build

cd into this directory (specter-desktop/pyinstaller) and install requirements:

$ pip3 install -r requirements.txt --require-hashes

Now run:

$ pyinstaller specterd.spec

And for HWIBridge, run:

pyinstaller hwibridge.spec

Building Specter launcher (tray app)

Creating a Windows setup file

From Powershell:

  1. Build specterd in onedir mode:
pyinstaller specterd_onedir.spec

You should get a specterd directory in the dist folder.

  1. Copy specterd folder from dist folder to this directory.
  2. Run pyinstaller specter_desktop.spec - this should create a specter_desktop folder in the dist directory. Check that it works by running dist\specter_desktop\specter_desktop.exe
  3. Create an installer using InnoSetup, select dist\specter_desktop\specter_desktop.exe as main executable, add dist\specter_desktop folder to the setup wizard as well.

Creating a DMG for macOS

Note: pyinstaller doesn't fully support python3.8 at the moment, use python3.7.

  1. Build specterd in onedir mode:
pyinstaller specterd_onedir.spec

You should get a specterd directory in the dist folder.

  1. Copy specterd folder from dist folder to this directory: cp -r dist/specterd/ ./specterd
  2. Now in the terminal, run pyinstaller specter_desktop.spec (you might need to use sudo). This should create a new Specter and Specter.app files.
  3. The Specter.app file is the executable macOS app we will need to package now as a .dmg for distribution.
  4. Make sure you have NPM installed, and run npm install --global create-dmg.
  5. Now run create-dmg 'dist/Specter.app'. This should generate a new Specter 0.0.0.dmg.
  6. The .dmg should now be ready to use! Note: You can rename the .dmg file to have the proper version (or just say Specter).

Creating a binary for Linux

  1. Build specterd in onedir mode:
pyinstaller specterd_onedir.spec

You should get a specterd directory in the dist folder.

  1. Copy specterd folder from dist folder to this directory: cp -r dist/specterd/ ./specterd
  2. Run pyinstaller specter_desktop.spec. This should create a Specter executable.