Skip to content

How to compile

AlessandroZ edited this page Mar 22, 2018 · 10 revisions

Using pyinstaller

For Windows only

  • To get a better compatibility between systems, msvcp100.dll and msvcr100.dll could be added. These files could be found in "C:\Windows\System32". Place it on the root folder of the pyinstaller directory.

  • Create a .spec file adding all options wanted. Mine is as follow:

# -*- mode: python -*-
import sys
a = Analysis(
	['../Windows/laZagne.py'],
	pathex=[''],
	hiddenimports=[],
	hookspath=None,
	runtime_hooks=None
)

for d in a.datas:
  if 'pyconfig' in d[0]: 
	a.datas.remove(d)
	break

pyz = PYZ(a.pure)
exe = EXE(
	pyz,
	a.scripts,
	a.binaries + [
		('msvcp100.dll', 'msvcp100.dll', 'BINARY'),
		('msvcr100.dll', 'msvcr100.dll', 'BINARY')
	]
	if sys.platform == 'win32' else a.binaries,
	a.zipfiles,
	a.datas,
	name='laZagne.exe',
	debug=False,
	strip=None,
	upx=True,
	console=True
)

  • Generate your executable file: python pyinstaller.py --onefile -w lazagne.spec
Clone this wiki locally