source: sasview/sansview/setup_exe.py @ c6036f5

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 c6036f5 was 07e88d7, checked in by Mathieu Doucet <doucetm@…>, 15 years ago

sansview: remove non-standard default option

  • Property mode set to 100644
File size: 3.8 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
17   
18from distutils.core import setup
19from distutils.filelist import findall
20import matplotlib
21import py2exe
22
23manifest = """
24   <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
25   <assembly xmlns="urn:schemas-microsoft-com:asm.v1"
26   manifestVersion="1.0">
27   <assemblyIdentity
28       version="0.64.1.0"
29       processorArchitecture="x86"
30       name="Controls"
31       type="win32"
32   />
33   <description>SansView</description>
34   <dependency>
35       <dependentAssembly>
36           <assemblyIdentity
37               type="win32"
38               name="Microsoft.Windows.Common-Controls"
39               version="6.0.0.0"
40               processorArchitecture="X86"
41               publicKeyToken="6595b64144ccf1df"
42               language="*"
43           />
44       </dependentAssembly>
45   </dependency>
46   </assembly>
47  """
48
49   
50class Target:
51    def __init__(self, **kw):
52        self.__dict__.update(kw)
53        # for the versioninfo resources
54        self.version = "0.9.1"
55        self.company_name = "U Tennessee"
56        self.copyright = "copyright 2009"
57        self.name = "SansView"
58       
59#
60# Adapted from http://www.py2exe.org/index.cgi/MatPlotLib
61# to use the MatPlotLib.
62#
63matplotlibdatadir = matplotlib.get_data_path()
64matplotlibdata = findall(matplotlibdatadir)
65data_files = []
66# Copying SLD data
67import periodictable
68import logging
69
70data_files += periodictable.data_files()
71
72
73for f in matplotlibdata:
74    dirname = os.path.join('mpl-data', f[len(matplotlibdatadir)+1:])
75    data_files.append((os.path.split(dirname)[0], [f]))
76
77# Copy the settings file for the DataLoader file extension associations
78import DataLoader.readers
79f = os.path.join(DataLoader.readers.get_data_path(),'defaults.xml')
80if os.path.isfile(f):
81    data_files.append(('.', [f]))
82
83# Copying the images directory to the distribution directory.
84for f in findall('images'):
85    if os.path.split(f)[0].count('.svn')==0:
86        data_files.append((os.path.split(f)[0], [f]))
87
88# Copying the HTML help docs
89for f in findall('doc'):
90    if os.path.split(f)[0].count('.svn')==0:
91        data_files.append((os.path.split(f)[0], [f]))
92
93# Copying the sample data user data
94for f in findall('test'):
95    if os.path.split(f)[0].count('.svn')==0:
96        data_files.append((os.path.split(f)[0], [f]))
97       
98# Copying the sample data user data
99for f in findall('plugins'):
100    if os.path.split(f)[0].count('.svn')==0:
101        data_files.append((os.path.split(f)[0], [f]))
102
103   
104#
105# packages
106#
107packages = ['matplotlib', 'pytz','encodings']
108includes = []
109excludes = [] 
110
111dll_excludes = [
112    'libgdk_pixbuf-2.0-0.dll', 
113    'libgobject-2.0-0.dll',
114    'libgdk-win32-2.0-0.dll',
115    ]
116
117target_wx_client = Target(
118    description = 'SansView',
119    script = 'sansview.py',
120    icon_resources = [(1, "images/ball.ico")],
121    other_resources = [(24,1,manifest)],
122    dest_base = "SansView"
123    )
124
125
126
127setup(
128    windows=[target_wx_client],
129    console=[],
130   
131    options={
132        'py2exe': {
133            'dll_excludes': dll_excludes,
134            'packages' : packages,
135            'includes':includes,
136            'excludes':excludes,
137            "compressed": 1,
138            "optimize": 0,
139            "bundle_files":2,
140            },
141    },
142    data_files=data_files,
143   
144)
145
146
Note: See TracBrowser for help on using the repository browser.