Skip to content
This repository has been archived by the owner on Feb 18, 2020. It is now read-only.

Creating Windows binaries

Christian Meter edited this page Aug 16, 2016 · 5 revisions

This is a section for the Tool-Devs

The process of creating binaries is a little bit complicated. This article tries to help keeping everything in check.

Prerequisites:

  • pynsist
  • The pycryptodomex package compiled on the target system. (32 or 64 Bit Windows)
    • You can install it via pip on a 32 / 64 Bit Windows to get it compiled
    • Then just grab the Cryptodome folder inside the <your-python.pyth>/lib/site-packages directory

Preparation:

  • Write an installer.cfg for pynsist and put it in the directory of app.py. I'll add mine at the end of the article for you to copy; refer to the pynsist documentation if something is unclear.
  • In the same directory create a dir called pynsist_pkgs.
    • Put the Cryptodome folder inside
    • Also get inside your local (virtualenv?) site-packages directory and copy the following folder as well: pgoapi, markupsafe
    • Get the google folder as well, but don't copy it whole, but just the protobuf folder inside. (Solves a whole bunch of problems, trust me)
  • You should now have the following folder structure:
pynsist_pkgs
├── Cryptodome
├── markupsafe
├── pgoapi
└── protobuf
  • Use your favorite editor to replace every mention of google.protobuf with protobuf inside all files contained in pgoapi and protobuf. (Yes I am serious, no there is no other way)
  • Open up the pynsist_pkgs/pgoapi/__init__.py file and comment or remove the following lines:
if (not protobuf_exist) or (int(protobuf_version[:1]) < 3):
    raise PleaseInstallProtobufVersion3()
  • Build the frontend and css files.
  • Copy the contents of frontend/resources/public into a directory called interface and place it beside the app.py
  • Build the installer with pyinsist installer.cfg
    • Change bitness inside the config to 32/64 accordingly first.
    • Change the version number if needed
  • The result will be the Pogo-Cruncher-<Version>.exe inside the build directory.

WeGis installer.cfg:

[Application]
name=Pogo-Cruncher
version=0.2.10-64bit
# How to launch the app - this calls the 'main' function from the 'myapp' package:
entry_point=app:main
# icon=myapp.ico
console=true

[Python]
version=3.5.2
bitness=64

[Include]
# Importable packages that your application requires, one per line
packages = click
  backend
  flask
  flask_cors
  future
  geopy
  gpsoauth
  itsdangerous
  Cryptodome
  jinja2
  markupsafe
  pgoapi
  protobuf
  pkg_resources
  requests
  s2sphere
  six
  werkzeug


# Other files and folders that should be installed
files = README.md
  interface