source: sasview/sansview/setup_exe.py @ a9a6896

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 a9a6896 was 698a734, checked in by Gervaise Alina <gervyh@…>, 15 years ago

working on bundle html files

  • Property mode set to 100644
File size: 4.0 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
69data_files += periodictable.data_files()
70
71import sans.perspectives.calculator as calculator
72data_files += calculator.data_files()
73
74import sans.perspectives.invariant as invariant
75data_files += invariant.data_files()
76
77for f in matplotlibdata:
78    dirname = os.path.join('mpl-data', f[len(matplotlibdatadir)+1:])
79    data_files.append((os.path.split(dirname)[0], [f]))
80
81# Copy the settings file for the DataLoader file extension associations
82import DataLoader.readers
83f = os.path.join(DataLoader.readers.get_data_path(),'defaults.xml')
84if os.path.isfile(f):
85    data_files.append(('.', [f]))
86
87# Copying the images directory to the distribution directory.
88for f in findall('images'):
89    if os.path.split(f)[0].count('.svn')==0:
90        data_files.append((os.path.split(f)[0], [f]))
91
92# Copying the HTML help docs
93for f in findall('media'):
94    if os.path.split(f)[0].count('.svn')==0:
95        data_files.append((os.path.split(f)[0], [f]))
96
97# Copying the sample data user data
98for f in findall('test'):
99    if os.path.split(f)[0].count('.svn')==0:
100        data_files.append((os.path.split(f)[0], [f]))
101       
102# Copying the sample data user data
103for f in findall('plugins'):
104    if os.path.split(f)[0].count('.svn')==0:
105        data_files.append((os.path.split(f)[0], [f]))
106
107   
108#
109# packages
110#
111packages = ['matplotlib', 'pytz','encodings']
112includes = []
113excludes = [] 
114
115dll_excludes = [
116    'libgdk_pixbuf-2.0-0.dll', 
117    'libgobject-2.0-0.dll',
118    'libgdk-win32-2.0-0.dll',
119    ]
120
121target_wx_client = Target(
122    description = 'SansView',
123    script = 'sansview.py',
124    icon_resources = [(1, "images/ball.ico")],
125    other_resources = [(24,1,manifest)],
126    dest_base = "SansView"
127    )
128
129
130
131setup(
132    windows=[target_wx_client],
133    console=[],
134   
135    options={
136        'py2exe': {
137            'dll_excludes': dll_excludes,
138            'packages' : packages,
139            'includes':includes,
140            'excludes':excludes,
141            "compressed": 1,
142            "optimize": 0,
143            "bundle_files":2,
144            },
145    },
146    data_files=data_files,
147   
148)
149
150
Note: See TracBrowser for help on using the repository browser.