[IMP] Layout of forum
[odoo/odoo.git] / setup / win32 / win32_setup.py
1 # -*- coding: utf-8 -*-
2
3 import os
4 import glob
5 import py2exe
6 from distutils.core import setup
7
8
9 execfile(os.path.join(os.path.dirname(__file__), '..', '..', 'openerp', 'release.py'))
10
11
12 def generate_files():
13     actions = {
14         'start': ['stop', 'start'],
15         'stop': ['stop'],
16     }
17
18     files = []
19     if os.name == 'nt':
20         files.append(("Microsoft.VC90.CRT", glob.glob('C:\Microsoft.VC90.CRT\*.*')))
21     for action, steps in actions.items():
22         fname = action + '.bat'
23         files.append(fname)
24         with open(fname, 'w') as fp:
25             fp.write('@PATH=%WINDIR%\system32;%WINDIR%;%WINDIR%\System32\Wbem;.\n')
26             for step in steps:
27                 fp.write('@net %s %s\n' % (step, nt_service_name))
28     return files
29
30 setup(
31     service=["win32_service"],
32     version=version,
33     license=license,
34     url=url,
35     author=author,
36     author_email=author_email,
37     data_files=generate_files(),
38     options={
39         "py2exe": {
40             "excludes": [
41                 'Tkconstants',
42                 'Tkinter',
43                 'tcl',
44                 '_imagingtk',
45                 'PIL._imagingtk',
46                 'ImageTk',
47                 'PIL.ImageTk',
48                 'FixTk'
49             ],
50             "skip_archive": 1,
51             "optimize": 2,
52         }
53     },
54 )