source: sasview/sansview/setup_exe.py @ 9619367

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since 9619367 was ead38a7, checked in by Jae Cho <jhjcho@…>, 15 years ago

added py2exe script

  • Property mode set to 100644
File size: 3.2 KB
Line 
1#!/usr/bin/env python
2
3#
4# The setup to create a Windows executable.
5# Inno Setup can then be used with the installer.iss file
6# in the top source directory to create an installer.
7#
8# Setuptools clashes with py2exe 0.6.8 (and probably later too).
9# For that reason, most of the code needs to have direct imports
10# that are not going through pkg_resources.
11#
12# Attention should be paid to dynamic imports. Data files can
13# be added to the distribution directory for that purpose.
14# See for example the 'images' directory below.
15
16import os, sys
17from distutils.core import setup
18from distutils.filelist import findall
19import matplotlib
20import py2exe
21
22if len(sys.argv) == 1:
23    sys.argv.append('py2exe')
24
25manifest = """
26   <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
27   <assembly xmlns="urn:schemas-microsoft-com:asm.v1"
28   manifestVersion="1.0">
29   <assemblyIdentity
30       version="0.64.1.0"
31       processorArchitecture="x86"
32       name="Controls"
33       type="win32"
34   />
35   <description>SansView</description>
36   <dependency>
37       <dependentAssembly>
38           <assemblyIdentity
39               type="win32"
40               name="Microsoft.Windows.Common-Controls"
41               version="6.0.0.0"
42               processorArchitecture="X86"
43               publicKeyToken="6595b64144ccf1df"
44               language="*"
45           />
46       </dependentAssembly>
47   </dependency>
48   </assembly>
49  """
50
51   
52class Target:
53    def __init__(self, **kw):
54        self.__dict__.update(kw)
55        # for the versioninfo resources
56        self.version = "0.1"
57        self.company_name = "U Tennessee"
58        self.copyright = "copyright 2008"
59        self.name = "SansView"
60       
61#
62# Adapted from http://www.py2exe.org/index.cgi/MatPlotLib
63# to use the MatPlotLib.
64#
65matplotlibdatadir = matplotlib.get_data_path()
66matplotlibdata = findall(matplotlibdatadir)
67data_files = []
68
69for f in matplotlibdata:
70    dirname = os.path.join('mpl-data', f[len(matplotlibdatadir)+1:])
71    data_files.append((os.path.split(dirname)[0], [f]))
72
73# Copying the images directory to the distribution directory.
74for f in findall('images'):
75    if os.path.split(f)[0].count('.svn')==0:
76        data_files.append((os.path.split(f)[0], [f]))
77
78# Copying the HTML help docs
79for f in findall('doc'):
80    if os.path.split(f)[0].count('.svn')==0:
81        data_files.append((os.path.split(f)[0], [f]))
82   
83#
84# packages
85#
86packages = ['matplotlib', 'pytz']
87includes = []
88excludes = [] 
89
90dll_excludes = [
91    'libgdk_pixbuf-2.0-0.dll', 
92    'libgobject-2.0-0.dll',
93    'libgdk-win32-2.0-0.dll',
94    ]
95
96target_wx_client = Target(
97    description = 'SanView',
98    script = 'sansview.py',
99    icon_resources = [(1, "images/ball.ico")],
100    other_resources = [(24,1,manifest)],
101    dest_base = "SansView"
102    )
103
104
105
106setup(
107    windows=[target_wx_client],
108    console=[],
109   
110    options={
111        'py2exe': {
112            'dll_excludes': dll_excludes,
113            'packages' : packages,
114            'includes':includes,
115            'excludes':excludes,
116            "compressed": 1,
117            "optimize": 0,
118            "bundle_files":2,
119            },
120    },
121    data_files=data_files
122   
123)
124
125
Note: See TracBrowser for help on using the repository browser.