Skip to content

Commit

Permalink
Add support for building standalone windows binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
titusz committed Jul 21, 2015
1 parent 357c2dd commit 4e05f0a
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 1 deletion.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ include README.rst

include tox.ini .travis.yml appveyor.yml

global-exclude *.py[cod] __pycache__ *.so
global-exclude *.py[cod] __pycache__ *.so *.spec version_info.txt winbuild.bat
33 changes: 33 additions & 0 deletions pyinstaller.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# -*- mode: python -*-
from PyInstaller.build import Analysis, PYZ, EXE, Tree

a = Analysis(['./src/onixcheck/__main__.py'],
pathex=['c:\\dev\\onixcheck'],
hiddenimports=[],
hookspath=None,
runtime_hooks=None)

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

# Include all spellcheck dictionary files, as a folder named dict
xsd21 = Tree('./src/onixcheck/xsd2.1', prefix='xsd2.1')
xsd30 = Tree('./src/onixcheck/xsd3.0', prefix='xsd3.0')

pyz = PYZ(a.pure)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
xsd21,
xsd30,
name='onixcheck.exe',
debug=False,
strip=None,
upx=True,
console=True,
version='version_info.txt'
)
43 changes: 43 additions & 0 deletions version_info.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# UTF-8
#
# For more details about fixed file info 'ffi' see:
# http://msdn.microsoft.com/en-us/library/ms646997.aspx
VSVersionInfo(
ffi=FixedFileInfo(
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
# Set not needed items to zero 0.
filevers=(0, 4, 0, 0),
prodvers=(0, 4, 0, 0),
# Contains a bitmask that specifies the valid bits 'flags'r
mask=0x3f,
# Contains a bitmask that specifies the Boolean attributes of the file.
flags=0x0,
# The operating system for which this file was designed.
# 0x4 - NT and there is no need to change it.
OS=0x4,
# The general type of file.
# 0x1 - the file is an application.
fileType=0x1,
# The function of the file.
# 0x0 - the function is not defined for this fileType
subtype=0x0,
# Creation date and time stamp.
date=(0, 0)
),
kids=[
StringFileInfo(
[
StringTable(
u'040904b0',
[StringStruct(u'CompanyName', u'Craft AG http://craft.de'),
StringStruct(u'FileDescription', u'Validate ONIX for Books XML files'),
StringStruct(u'FileVersion', u'0.4.0 (2015-07-21)'),
StringStruct(u'InternalName', u'onixcheck.exe'),
StringStruct(u'LegalCopyright', u'© 2015 Titusz Pan'),
StringStruct(u'OriginalFilename', u'onixcheck.exe'),
StringStruct(u'ProductName', u'onixcheck'),
StringStruct(u'ProductVersion', u'0.4.0 (2015-07-21)')])
]),
VarFileInfo([VarStruct(u'Translation', [1033, 1200])])
]
)
1 change: 1 addition & 0 deletions winbuild.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pyi-build pyinstaller.spec

0 comments on commit 4e05f0a

Please sign in to comment.