Files
odoo_source/setup/win32/win32_setup.py
T
xmo-odoo 2e6a589f41 [FIX] builtins removed from Python 3
* Reverse wrapper courtesy of @rco-odoo's original P3 branch
* thin compat module stripped down from werkzeug (to augment as needed)

issue 8530
2017-04-27 13:59:33 +02:00

55 lines
1.3 KiB
Python

# -*- coding: utf-8 -*-
import os
import glob
import py2exe
from distutils.core import setup
exec(open(os.path.join(os.path.dirname(__file__), '..', '..', 'odoo', 'release.py'), 'rb').read())
def generate_files():
actions = {
'start': ['stop', 'start'],
'stop': ['stop'],
}
files = []
if os.name == 'nt':
files.append(("Microsoft.VC90.CRT", glob.glob('C:\Microsoft.VC90.CRT\*.*')))
for action, steps in actions.items():
fname = action + '.bat'
files.append(fname)
with open(fname, 'w') as fp:
fp.write('@PATH=%WINDIR%\system32;%WINDIR%;%WINDIR%\System32\Wbem;.\n')
for step in steps:
fp.write('@net %s %s\n' % (step, nt_service_name))
return files
setup(
service=["win32_service"],
version=version,
license=license,
url=url,
author=author,
author_email=author_email,
data_files=generate_files(),
options={
"py2exe": {
"excludes": [
'Tkconstants',
'Tkinter',
'tcl',
'_imagingtk',
'PIL._imagingtk',
'ImageTk',
'PIL.ImageTk',
'FixTk'
],
"skip_archive": 1,
"optimize": 2,
}
},
)