Commit 8a85db39 authored by carlosperate's avatar carlosperate

Add build script to create standalone application.

Still needs Arduino IDE to compile and upload.
parent a39d1334
@echo off
start win/start.exe
\ No newline at end of file
#!/usr/bin/env python2
import os
import sys
import shutil
import fnmatch
from glob import glob
try:
from cefpython3 import cefpython
from distutils.core import setup
import py2exe
except ImportError:
print("You need to have cefpython3, distutils, and py2exe installed!")
sys.exit(1)
# set up directories
this_file_dir = os.path.dirname(os.path.realpath(sys.argv[0]))
this_file_parent = os.path.dirname(this_file_dir)
# Enable the ArdublocklyServer package access the sys path for py2exe to find
sys.path.append(this_file_parent)
def get_install_folder():
""" Install directory will be folder 'win' on root directory. """
return os.path.join(this_file_parent, "win")
def remove_install_dir():
""" Removes the installation folder. """
install_folder = get_install_folder()
if os.path.exists(install_folder):
shutil.rmtree(install_folder)
def remove_build_dir():
""" Removes the build folder. """
build_folder = os.path.join(this_file_dir, "build")
if os.path.exists(build_folder):
shutil.rmtree(build_folder)
def get_data_files():
""" Collects the required redistributable dlls. """
cef_path = os.path.dirname(cefpython.__file__)
data_files = [
('', ['%s/icudt.dll' % cef_path,
'%s/d3dcompiler_43.dll' % cef_path,
'%s/devtools_resources.pak' % cef_path,
'%s/ffmpegsumo.dll' % cef_path,
'%s/libEGL.dll' % cef_path,
'%s/libGLESv2.dll' % cef_path,
'%s/subprocess.exe' % cef_path]),
('locales', glob(r'%s/locales/*.*' % cef_path)),
("Microsoft.VC90.CRT", glob(r'msvcm90\*.*'))]
return data_files
def get_options():
""" Prepares and returns the py2exe options dictionary. """
# We don't really need a few of the pywin32 includes
excludes = ["pywin", "pywin.debugger", "pywin.debugger.dbgcon",
"pywin.dialogs", "pywin.dialogs.list", "win32com.server"]
# We don't need this packages either
excludes.extend(["unittest", "_ssl", "doctest", "pdb", "difflib", "email"])
# Py2exe options: http://www.py2exe.org/index.cgi/ListOfOptions
py2exe_options = {
"py2exe": {"dist_dir": get_install_folder(),
"compressed": False,
"bundle_files": 3,
"skip_archive": True,
"optimize": 0,
"packages": ["ArdublocklyServer"],
"dll_excludes": ["msvcp90.dll", "msvcm90.dll"],
"excludes": excludes}}
return py2exe_options
def get_py_files():
""" Returns the scripts to package, only needs the CEF entry point. """
start_file = os.path.join(this_file_parent, "start_cef.py")
return [start_file]
def build_exe(args):
setup(data_files=get_data_files(),
#windows=get_py_files(),
console=get_py_files(),
options=get_options(),
script_args=args)
if __name__ == "__main__":
remove_build_dir()
remove_install_dir()
if len(sys.argv) <= 1:
build_exe(['py2exe'])
else:
build_exe()
remove_build_dir()
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<noInheritable></noInheritable>
<assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
<file name="msvcr90.dll" hashalg="SHA1" hash="e0dcdcbfcb452747da530fae6b000d47c8674671"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>KSaO8M0iCtPF6YEr79P1dZsnomY=</dsig:DigestValue></asmv2:hash></file> <file name="msvcp90.dll" hashalg="SHA1" hash="81efe890e4ef2615c0bb4dda7b94bea177c86ebd"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>ojDmTgpYMFRKJYkPcM6ckpYkWUU=</dsig:DigestValue></asmv2:hash></file> <file name="msvcm90.dll" hashalg="SHA1" hash="5470081b336abd7b82c6387567a661a729483b04"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>tVogb8kezDre2mXShlIqpp8ErIg=</dsig:DigestValue></asmv2:hash></file>
</assembly>
\ No newline at end of file
cefpython3==31.2
py2exe==0.6.9
wxPython==3.0.2.0
wxPython-common==3.0.2.0
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment