Changeset f4a1433 in sasview for installers
- Timestamp:
- Oct 24, 2017 2:44:26 AM (7 years ago)
- Branches:
- ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- fca1f50, d6b234b
- Parents:
- 16afe01 (diff), 5582b078 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Location:
- installers
- Files:
-
- 4 added
- 9 moved
Legend:
- Unmodified
- Added
- Removed
-
installers/README.txt
rc416a17 rf4a1433 4 4 1- Features 5 5 =========== 6 - New in Version 4.1.2 7 -------------------- 8 This point release is a bug-fix release addressing: 9 10 - Fixes #984: PDF Reports Generate Empty PDFs 11 - Fixes a path typo 12 - 64 bit and 32 bit Windows executables now available 13 14 It is recommended that all users upgrade to this version 15 16 - New in Version 4.1.1 17 -------------------- 18 This point release is a bug-fix release addressing: 19 20 - Fixes #948: Mathjax CDN is going away 21 - Fixes #938: Cannot read canSAS1D file output by SasView 22 - Fixes #960: Save project throws error if empty fit page 23 - Fixes #929: Problem deleting data in first fit page 24 - Fixes #918: Test folders not bundled with release 25 - Fixes an issue with the live discovery of plugin models 26 - Fixes an issue with the NXcanSAS data loader 27 - Updated tutorials for SasView 4.x.y 28 6 29 - New in Version 4.1.0 7 30 ------------------ -
installers/installer_generator.py
ra1b8fee r460d3a1 6 6 from __future__ import print_function 7 7 8 import local_config9 import os8 import os 9 import sys 10 10 import string 11 11 12 13 REG_PROGRAM = """{app}\MYPROG.EXE"" ""%1""" 12 root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 13 sys.path.insert(0, os.path.join(root, 'sasview-install', 'Lib', 'site-packages')) 14 from sas.sasview import local_config 15 16 #REG_PROGRAM = """{app}\MYPROG.EXE"" ""%1""" 14 17 APPLICATION = str(local_config.__appname__ )+ '.exe' 15 18 AppName = str(local_config.__appname__ ) … … 23 26 AppUpdatesURL = local_config._homepage 24 27 ChangesEnvironment = 'true' 25 DefaultDirName = os.path.join("{pf}" , AppName+Dev) 28 DefaultDirName = os.path.join("{pf}" , AppName+Dev) 26 29 DefaultGroupName = os.path.join(local_config.DefaultGroupName, AppVerName) 27 30 28 31 OutputBaseFilename = local_config.OutputBaseFilename 29 SetupIconFile = "images\\ball.ico"32 SetupIconFile = local_config.SetupIconFile_win 30 33 LicenseFile = 'license.txt' 31 34 DisableProgramGroupPage = 'yes' … … 46 49 list_app =[] 47 50 try: 48 51 49 52 #(ext, type, name, flags) 50 53 from sas.sascalc.dataloader.loader import Loader … … 55 58 if ext.strip() not in ['.*', ''] and ext.strip() not in list_data: 56 59 list_data.append((ext, 'string', file_type)) 57 except :60 except Exception: 58 61 pass 59 62 try: … … 61 64 if ext.strip() not in ['.', ''] and ext.strip() not in list_app: 62 65 list_app.append((ext, 'string', file_type)) 63 except :66 except Exception: 64 67 pass 65 68 try: … … 67 70 file_type, ext = string.split(item, "|*", 1) 68 71 if ext.strip() not in ['.', ''] and ext.strip() not in list_app: 69 list_app.append((ext, 'string', file_type)) 70 except :72 list_app.append((ext, 'string', file_type)) 73 except Exception: 71 74 pass 72 75 return list_data, list_app … … 91 94 % str(APPLICATION) 92 95 msg += """ValueType: %s; """ % str('string') 93 msg += """ValueName: "%s";\t""" %str('') 96 msg += """ValueName: "%s";\t""" %str('') 94 97 msg += """ValueData: \"""{app}\%s"" ""%s1\"""; \t"""% (str(APPLICATION), 95 str('%')) 98 str('%')) 96 99 msg += """ Flags: %s""" % str('uninsdeletevalue noerror') 97 100 msg += "\n" 98 user_list = "Software\Classes" 101 user_list = "Software\Classes" 99 102 for (ext, type, _) in data_extension: 100 103 list = os.path.join(user_list, ext, openwithlist) … … 107 110 % (str(user_list), str(APPLICATION)) 108 111 msg += """ValueType: %s; """ % str('string') 109 msg += """ValueName: "%s";\t""" %str('') 112 msg += """ValueName: "%s";\t""" %str('') 110 113 msg += """ValueData: \"""{app}\%s"" ""%s1\"""; \t"""% (str(APPLICATION), 111 str('%')) 114 str('%')) 112 115 msg += """ Flags: %s""" % str('uninsdeletevalue noerror') 113 msg += "\n" 116 msg += "\n" 114 117 if app_extension is not None and app_extension: 115 118 for (ext, type, _) in app_extension: 116 119 msg += """Root: HKCR;\tSubkey: "%s";\t""" % str(ext) 117 120 msg += """ValueType: %s;\t""" % str(type) 118 #file type empty set the current application as the default 121 #file type empty set the current application as the default 119 122 #reader for this file. change the value of file_type to another 120 123 #string modify the default reader … … 126 129 msg += """Root: HKCR; Subkey: "{app}\%s";\t""" % str(APPLICATION) 127 130 msg += """ValueType: %s; """ % str('string') 128 msg += """ValueName: "%s";\t""" % str('') 129 msg += """ValueData: "{app}\%s";\t""" % str("SasView File") 131 msg += """ValueName: "%s";\t""" % str('') 132 msg += """ValueData: "{app}\%s";\t""" % str("SasView File") 130 133 msg += """ Flags: %s \t""" % str("uninsdeletekey noerror") 131 134 msg += "\n" 132 135 133 136 #execute the file on double-click 134 137 msg += """Root: HKCR; Subkey: "{app}\%s\shell\open\command";\t""" % str(APPLICATION) 135 138 msg += """ValueType: %s; """ % str('string') 136 msg += """ValueName: "%s";\t""" %str('') 139 msg += """ValueName: "%s";\t""" %str('') 137 140 msg += """ValueData: \"""{app}\%s"" ""%s1\""";\t"""% (str(APPLICATION), 138 str('%')) 141 str('%')) 139 142 msg += """ Flags: %s \t""" % str("uninsdeletevalue noerror") 140 msg += "\n" 143 msg += "\n" 141 144 #create default icon 142 145 msg += """Root: HKCR; Subkey: "{app}\%s";\t""" % str(SetupIconFile) 143 146 msg += """ValueType: %s; """ % str('string') 144 msg += """ValueName: "%s";\t""" % str('') 147 msg += """ValueName: "%s";\t""" % str('') 145 148 msg += """ValueData: "{app}\%s,0";\t""" % str(APPLICATION) 146 149 msg += """ Flags: %s \t""" % str("uninsdeletevalue noerror") 147 msg += "\n" 148 149 150 msg += "\n" 151 152 150 153 #SASVIEWPATH 151 154 msg += """Root: HKLM; Subkey: "%s";\t""" % str('SYSTEM\CurrentControlSet\Control\Session Manager\Environment') 152 155 msg += """ValueType: %s; """ % str('expandsz') 153 msg += """ValueName: "%s";\t""" % str('SASVIEWPATH') 156 msg += """ValueName: "%s";\t""" % str('SASVIEWPATH') 154 157 msg += """ValueData: "{app}";\t""" 155 158 msg += """ Flags: %s""" % str('uninsdeletevalue noerror') 156 159 msg += "\n" 157 160 158 161 #PATH 159 162 msg += """; Write to PATH (below) is disabled; need more tests\n""" 160 163 msg += """;Root: HKCU; Subkey: "%s";\t""" % str('Environment') 161 164 msg += """ValueType: %s; """ % str('expandsz') 162 msg += """ValueName: "%s";\t""" % str('PATH') 165 msg += """ValueName: "%s";\t""" % str('PATH') 163 166 msg += """ValueData: "%s;{olddata}";\t""" % str('%SASVIEWPATH%') 164 167 msg += """ Check: %s""" % str('NeedsAddPath()') 165 168 msg += "\n" 166 167 return msg 168 169 def write_language (language=['english'], msfile="compiler:Default.isl"):169 170 return msg 171 172 def write_languages(languages=('english',), msfile="compiler:Default.isl"): 170 173 """ 171 174 define the language of the application 172 """ 175 """ 173 176 msg = '' 174 if language :177 if languages: 175 178 msg = "\n\n[Languages]\n" 176 for lang in language: 177 msg += """Name: "%s";\tMessagesFile: "%s"\n""" % (str(lang), 178 str(msfile)) 179 return msg 179 for lang in languages: 180 msg += """Name: "%s";\tMessagesFile: "%s"\n""" % (str(lang), str(msfile)) 181 return msg 180 182 181 183 def write_tasks(): … … 201 203 msg += """Flags: ignoreversion recursesubdirs createallsubdirs\n""" 202 204 msg += """Source: "dist\plugin_models\*";\tDestDir: "{userdesktop}\..\.sasview\plugin_models";\t""" 203 msg += """Flags: recursesubdirs createallsubdirs\n""" 205 msg += """Flags: recursesubdirs createallsubdirs\n""" 204 206 msg += """Source: "dist\compiled_models\*";\tDestDir: "{userdesktop}\..\.sasmodels\compiled_models";\t""" 205 207 msg += """Flags: recursesubdirs createallsubdirs\n""" 206 msg += """Source: "dist\config\custom_config.py";\tDestDir: "{userdesktop}\..\.sasview\config";\t""" 208 msg += """Source: "dist\config\custom_config.py";\tDestDir: "{userdesktop}\..\.sasview\config";\t""" 207 209 msg += """Flags: recursesubdirs createallsubdirs\n""" 208 #msg += """Source: "dist\default_categories.json"; DestDir: "{userdesktop}\..\.sasview";\t""" 210 #msg += """Source: "dist\default_categories.json"; DestDir: "{userdesktop}\..\.sasview";\t""" 209 211 #msg += """DestName: "categories.json";\n""" 210 212 msg += """;\tNOTE: Don't use "Flags: ignoreversion" on any shared system files""" … … 235 237 msg = """\n\n[Run]\n""" 236 238 msg += """Filename: "{app}\%s";\t""" % str(APPLICATION) 237 msg += """Description: "{cm:LaunchProgram, %s}";\t""" %str(AppName) 239 msg += """Description: "{cm:LaunchProgram, %s}";\t""" %str(AppName) 238 240 msg += """Flags: nowait postinstall skipifsilent\n""" 239 241 msg += """; Install the Microsoft C++ DLL redistributable package if it is """ … … 260 262 msg = """\n\n[Dirs]\n""" 261 263 msg += """Name: "{app}\%s";\t""" % str('') 262 msg += """Permissions: everyone-modify\t""" 263 msg += """\n""" 264 msg += """Permissions: everyone-modify\t""" 265 msg += """\n""" 264 266 return msg 265 267 266 268 def write_code(): 267 269 """ 268 Code that checks the existing path and snaviewpath 270 Code that checks the existing path and snaviewpath 269 271 in the environmental viriables/PATH 270 272 """ 271 273 msg = """\n\n[Code]\n""" 272 msg += """function InstallVC90CRT(): Boolean;\n""" 274 msg += """function InstallVC90CRT(): Boolean;\n""" 273 275 msg += """begin\n""" 274 276 msg += """ Result := not DirExists('C:\WINDOWS\WinSxS\\x86_Microsoft.VC90.""" 275 277 msg += """CRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_d08d0375');\n""" 276 278 msg += """end;\n\n""" 277 msg += """function NeedsAddPath(): boolean;\n""" 278 msg += """var\n""" 279 msg += """function NeedsAddPath(): boolean;\n""" 280 msg += """var\n""" 279 281 msg += """ oldpath: string;\n""" 280 msg += """ newpath: string;\n""" 281 msg += """ pathArr: TArrayOfString;\n""" 282 msg += """ i: Integer;\n""" 283 msg += """begin\n""" 282 msg += """ newpath: string;\n""" 283 msg += """ pathArr: TArrayOfString;\n""" 284 msg += """ i: Integer;\n""" 285 msg += """begin\n""" 284 286 msg += """ RegQueryStringValue(HKEY_CURRENT_USER,'Environment',""" 285 287 msg += """'PATH', oldpath)\n""" … … 324 326 msg += """; installation.\n""" 325 327 msg += """Type: dirifempty; Name: "{app}"\n""" 326 msg += """\n""" 328 msg += """\n""" 327 329 return msg 328 330 … … 333 335 TEMPLATE += "\n; and local_config.py located in this directory.\n " 334 336 TEMPLATE += "; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!" 335 TEMPLATE += "\n[Setup]\n\n" 337 TEMPLATE += "\n[Setup]\n\n" 336 338 TEMPLATE += "ChangesAssociations=%s\n" %str('yes') 337 339 TEMPLATE += "AppName=%s\n" % str(AppName) … … 352 354 TEMPLATE += "PrivilegesRequired=%s\n" % str(PrivilegesRequired) 353 355 TEMPLATE += "UsePreviousAppDir=no\n" 354 356 355 357 TEMPLATE += write_registry(data_extension=DATA_EXTENSION, 356 358 app_extension=APP_EXTENSION) 357 TEMPLATE += write_language ()359 TEMPLATE += write_languages() 358 360 TEMPLATE += write_tasks() 359 361 TEMPLATE += write_file() … … 364 366 TEMPLATE += write_uninstalldelete() 365 367 path = '%s.iss' % str(INSTALLER_FILE) 366 f = open(path,'w') 368 f = open(path,'w') 367 369 f.write(TEMPLATE) 368 370 f.close() 369 371 print("Generate Inno setup installer script complete") 370 372 print("A new file %s.iss should be created.Please refresh your directory" % str(INSTALLER_FILE)) 371 373 372 374 if __name__ == "__main__": 373 375 generate_installer() -
installers/setup_exe.py
- Property mode changed from 100644 to 100755
ra1b8fee r3da8692 3 3 # 4 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. 5 # Inno Setup can then be used with the installer.iss file 6 # in the top source directory to create an installer. 7 7 # 8 8 # Setuptools clashes with py2exe 0.6.8 (and probably later too). 9 9 # For that reason, most of the code needs to have direct imports 10 # that are not going through pkg_resources. 10 # that are not going through pkg_resources. 11 11 # 12 12 # Attention should be paid to dynamic imports. Data files can … … 17 17 import os 18 18 import sys 19 from glob import glob 19 20 import warnings 20 from glob import glob21 21 import shutil 22 22 … … 25 25 from distutils.filelist import findall 26 26 from distutils.sysconfig import get_python_lib 27 import py2exe28 27 29 28 #from idlelib.PyShell import warning_stream 30 29 30 # Need the installer dir on the python path to find helper modules 31 installer_dir = os.path.abspath(os.path.dirname(__file__)) 32 if installer_dir != os.path.abspath(os.getcwd()): 33 raise RuntimeError("Must run setup_exe from the installers directory") 34 sys.path.append(installer_dir) 35 36 # Need the installer dir on the python path to find helper modules 37 if os.path.abspath(os.path.dirname(__file__)) != os.path.abspath(os.getcwd()): 38 raise RuntimeError("Must run setup_exe from the installers directory") 39 sys.path.append(installer_dir) 40 31 41 # put the build directory at the front of the path 32 if os.path.abspath(os.path.dirname(__file__)) != os.path.abspath(os.getcwd()):33 raise RuntimeError("Must run setup_exe from the sasview directory")34 42 root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 35 43 platform = '%s-%s'%(get_platform(), sys.version[:3]) 36 build_path = os.path.join(root, 'build', 'lib.'+platform)37 #build_path = os.path.join(root, 'sasview-install', 'Lib', 'site-packages')44 doc_path = os.path.join(root, 'build', 'lib.'+platform, 'doc') 45 build_path = os.path.join(root, 'sasview-install', 'Lib', 'site-packages') 38 46 sys.path.insert(0, build_path) 39 47 40 import local_config41 48 from installer_generator import generate_installer 42 49 … … 62 69 del sys.argv[path_flag_idx+1] 63 70 sys.argv.remove('--extrapath') 64 except :71 except Exception: 65 72 print("Error processing extra python path needed to build SasView\n %s" % 66 73 sys.exc_value) 67 74 75 from sas import get_local_config 76 local_config = get_local_config() 68 77 69 78 # Solution taken from here: http://www.py2exe.org/index.cgi/win32com.shell … … 149 158 """%{'arch': arch} 150 159 151 if is_64bits:152 msvcrtdll = glob(r"C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*.*")153 else:154 msvcrtdll = glob(r"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*.*")155 if msvcrtdll:156 msvcrtdll_data_files = ("Microsoft.VC90.CRT", msvcrtdll)157 else:158 msvcrtdll_data_files = None159 160 161 160 class Target: 162 161 def __init__(self, **kw): … … 168 167 self.name = "SasView" 169 168 169 data_files = [] 170 171 if tinycc: 172 data_files += tinycc.data_files() 173 174 # Include data for supporting packages 175 import periodictable 176 data_files += periodictable.data_files() 177 170 178 # 171 179 # Adapted from http://www.py2exe.org/index.cgi/MatPlotLib 172 180 # to use the MatPlotLib. 173 181 # 174 path = os.getcwd() 175 176 media_dir = os.path.join(path, "media") 177 images_dir = os.path.join(path, "images") 178 test_dir = os.path.join(path, "test") 179 test_1d_dir = os.path.join(path, "test\\1d_data") 180 test_2d_dir = os.path.join(path, "test\\2d_data") 181 test_save_dir = os.path.join(path, "test\\save_states") 182 test_upcoming_dir = os.path.join(path, "test\\upcoming_formats") 183 184 matplotlibdatadir = matplotlib.get_data_path() 185 matplotlibdata = findall(matplotlibdatadir) 186 187 site_loc = get_python_lib() 188 opencl_include_dir = os.path.join(site_loc, "pyopencl", "cl") 189 190 data_files = [] 191 192 if tinycc: 193 data_files += tinycc.data_files() 194 195 # Copying SLD data 196 import periodictable 197 data_files += periodictable.data_files() 198 199 import sas.sasgui.perspectives.fitting as fitting 200 data_files += fitting.data_files() 201 202 import sas.sasgui.perspectives.calculator as calculator 203 data_files += calculator.data_files() 204 205 import sas.sasgui.perspectives.invariant as invariant 206 data_files += invariant.data_files() 207 208 import sas.sasgui.guiframe as guiframe 209 data_files += guiframe.data_files() 182 mpl_dir = matplotlib.get_data_path() 183 for dirpath, dirnames, filenames in os.walk(mpl_dir): 184 target_dir = os.path.join("mpl-data", os.path.relpath(dirpath, mpl_dir)) 185 source_files = [os.path.join(dirpath, f) for f in filenames] 186 data_files.append((target_dir, source_files)) 187 188 import sasmodels 189 data_files += sasmodels.data_files() 210 190 211 191 # precompile sas models into the sasview build path; doesn't matter too much … … 219 199 data_files.append(('compiled_models', compiled_dlls)) 220 200 221 import sasmodels 222 data_files += sasmodels.data_files() 223 224 for f in matplotlibdata: 225 dirname = os.path.join('mpl-data', f[len(matplotlibdatadir)+1:]) 226 data_files.append((os.path.split(dirname)[0], [f])) 227 228 # Copy the settings file for the sas.dataloader file extension associations 229 import sas.sascalc.dataloader.readers 230 f = os.path.join(sas.sascalc.dataloader.readers.get_data_path(), 'defaults.json') 231 if os.path.isfile(f): 232 data_files.append(('.', [f])) 233 f = 'custom_config.py' 234 if os.path.isfile(f): 235 data_files.append(('.', [f])) 236 data_files.append(('config', [f])) 237 f = 'local_config.py' 238 if os.path.isfile(f): 239 data_files.append(('.', [f])) 240 241 f = 'logging.ini' 242 if os.path.isfile(f): 243 data_files.append(('.', [f])) 244 245 #f = 'default_categories.json' 246 #if os.path.isfile(f): 247 # data_files.append(('.', [f])) 248 249 # numerical libraries 201 # Data files for the different perspectives 202 from sas.sasgui.perspectives import fitting 203 data_files += fitting.data_files() 204 205 from sas.sasgui.perspectives import calculator 206 data_files += calculator.data_files() 207 208 from sas.sasgui.perspectives import invariant 209 data_files += invariant.data_files() 210 211 from sas.sasgui import guiframe 212 data_files += guiframe.data_files() 213 214 # Copy the config files 215 sasview_path = os.path.join('..', 'src', 'sas', 'sasview') 216 data_files.append(('.', [os.path.join(sasview_path, 'custom_config.py')])) 217 data_files.append(('config', [os.path.join(sasview_path, 'custom_config.py')])) 218 data_files.append(('.', [os.path.join(sasview_path, 'local_config.py')])) 219 220 # Copy the logging config 221 sas_path = os.path.join('..', 'src', 'sas') 222 data_files.append(('.', [os.path.join(sas_path, 'logging.ini')])) 223 224 if os.path.isfile("BUILD_NUMBER"): 225 data_files.append(('.', ["BUILD_NUMBER"])) 226 227 # Copying the images directory to the distribution directory. 228 data_files.append(("images", findall(local_config.icon_path))) 229 230 # Copying the HTML help docs 231 data_files.append(("media", findall(local_config.media_path))) 232 233 # Copying the sample data user data 234 test_dir = local_config.test_path 235 for dirpath, dirnames, filenames in os.walk(test_dir): 236 target_dir = os.path.join("test", os.path.relpath(dirpath, test_dir)) 237 source_files = [os.path.join(dirpath, f) for f in filenames] 238 data_files.append((target_dir, source_files)) 239 240 # See if the documentation has been built, and if so include it. 241 if os.path.exists(doc_path): 242 for dirpath, dirnames, filenames in os.walk(doc_path): 243 target_dir = os.path.join("doc", os.path.relpath(dirpath, doc_path)) 244 source_files = [os.path.join(dirpath, f) for f in filenames] 245 data_files.append((target_dir, source_files)) 246 else: 247 raise Exception("You must first build the documentation before creating an installer.") 248 249 # Copying opencl include files 250 opencl_source = os.path.join(get_python_lib(), "pyopencl", "cl") 251 opencl_target = os.path.join("includes", "pyopencl") 252 data_files.append((opencl_target, findall(opencl_source))) 253 254 # Numerical libraries 255 python_root = os.path.dirname(os.path.abspath(sys.executable)) 250 256 def dll_check(dll_path, dlls): 251 257 dll_includes = [os.path.join(dll_path, dll+'.dll') for dll in dlls] 252 258 return [dll for dll in dll_includes if os.path.exists(dll)] 253 259 254 python_root = os.path.dirname(os.path.abspath(sys.executable))255 260 # Check for ATLAS 256 dll_path = os.path.join(python_root, 'lib', 'site-packages', 'numpy', 'core') 257 dlls = ['numpy-atlas'] 258 atlas_dlls = dll_check(dll_path, dlls) 261 numpy_path = os.path.join(python_root, 'lib', 'site-packages', 'numpy', 'core') 262 atlas_dlls = dll_check(numpy_path, ['numpy-atlas']) 259 263 260 264 # Check for MKL 261 dll_path = os.path.join(python_root, 'Library', 'bin') 262 dlls = ['mkl_core', 'mkl_def', 'libiomp5md'] 263 mkl_dlls = dll_check(dll_path, dlls) 264 265 mkl_path = os.path.join(python_root, 'Library', 'bin') 266 mkl_dlls = dll_check(mkl_path, ['mkl_core', 'mkl_def', 'libiomp5md']) 267 268 if mkl_dlls: 269 data_files.append(('.', mkl_dlls)) 265 270 if atlas_dlls: 266 271 data_files.append(('.', atlas_dlls)) 267 elif mkl_dlls: 268 data_files.append(('.', mkl_dlls)) 269 270 if os.path.isfile("BUILD_NUMBER"): 271 data_files.append(('.', ["BUILD_NUMBER"])) 272 273 # Copying the images directory to the distribution directory. 274 for f in findall(images_dir): 275 if not ".svn" in f: 276 data_files.append(("images", [f])) 277 278 # Copying the HTML help docs 279 for f in findall(media_dir): 280 if not ".svn" in f: 281 data_files.append(("media", [f])) 282 283 # Copying the sample data user data 284 for f in findall(test_1d_dir): 285 if not ".svn" in f: 286 data_files.append(("test\\1d_data", [f])) 287 288 # Copying the sample data user data 289 for f in findall(test_2d_dir): 290 if not ".svn" in f: 291 data_files.append(("test\\2d_data", [f])) 292 293 # Copying the sample data user data 294 for f in findall(test_save_dir): 295 if not ".svn" in f: 296 data_files.append(("test\\save_states", [f])) 297 298 # Copying the sample data user data 299 for f in findall(test_upcoming_dir): 300 if not ".svn" in f: 301 data_files.append(("test\\upcoming_formats", [f])) 302 303 # Copying opencl include files 304 for f in findall(opencl_include_dir): 305 data_files.append(("includes\\pyopencl",[f])) 306 307 # See if the documentation has been built, and if so include it. 308 doc_path = os.path.join(build_path, "doc") 309 if os.path.exists(doc_path): 310 for dirpath, dirnames, filenames in os.walk(doc_path): 311 for filename in filenames: 312 sub_dir = os.path.join("doc", os.path.relpath(dirpath, doc_path)) 313 data_files.append((sub_dir, [os.path.join(dirpath, filename)])) 272 273 if is_64bits: 274 msvcrtdll = glob(r"C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*.*") 314 275 else: 315 raise Exception("You must first build the documentation before creating an installer.") 316 317 if msvcrtdll_data_files is not None: 276 msvcrtdll = glob(r"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*.*") 277 if msvcrtdll: 318 278 # install the MSVC 9 runtime dll's into the application folder 319 data_files.append( msvcrtdll_data_files)279 data_files.append(("Microsoft.VC90.CRT", msvcrtdll)) 320 280 321 281 # NOTE: … … 326 286 packages = [ 327 287 'matplotlib', 'scipy', 'encodings', 'comtypes', 'h5py', 328 'win32com', 'xhtml2pdf', 'bumps', 'sasmodels', 'sas',288 'win32com', 'xhtml2pdf', 'bumps', 'sasmodels', 'sas', 329 289 ] 330 290 packages.extend([ … … 341 301 ]) 342 302 packages.append('periodictable.core') # not found automatically 343 # packages.append('IPython') 303 304 # For the interactive interpreter SasViewCom make sure ipython is available 305 #packages.extend(['IPython', 'pyreadline', 'pyreadline.unicode_helper']) 306 307 # individual models 344 308 includes = ['site', 'lxml._elementpath', 'lxml.etree'] 345 309 … … 349 313 # Exclude packages that are not needed but are often found on build systems 350 314 excludes = ['Tkinter', 'PyQt4', '_tkagg', 'sip', 'pytz', 'sympy'] 351 352 315 353 316 dll_excludes = [ … … 356 319 'tcl84.dll', 'tk84.dll', 'QtGui4.dll', 'QtCore4.dll', 357 320 # numpy 1.8 openmp bindings (still seems to use all the cores without them) 321 # ... but we seem to need them when building from anaconda, so don't exclude ... 358 322 #'libiomp5md.dll', 'libifcoremd.dll', 'libmmd.dll', 'svml_dispmd.dll','libifportMD.dll', 359 323 'numpy-atlas.dll', … … 369 333 370 334 target_wx_client = Target( 371 description ='SasView',372 script = 'sasview.py',373 icon_resources = [(1, os.path.join(images_dir, "ball.ico"))],374 other_resources =[(24, 1, manifest)],375 dest_base ="SasView"335 description='SasView', 336 script='sasview_gui.py', 337 icon_resources=[(1, local_config.SetupIconFile_win)], 338 other_resources=[(24, 1, manifest)], 339 dest_base="SasView" 376 340 ) 377 341 378 # bundle_option = 2 342 target_console_client = Target( 343 description='SasView console', 344 script='sasview_console.py', 345 icon_resources=[(1, local_config.SetupIconFile_win)], 346 other_resources=[(24, 1, manifest)], 347 dest_base="SasViewCom" 348 ) 349 350 #bundle_option = 3 if is_64bits else 2 379 351 bundle_option = 3 380 if is_64bits:381 bundle_option = 3382 352 generate_installer() 383 353 #initialize category stuff … … 385 355 #CategoryInstaller.check_install(s) 386 356 357 #import pprint; pprint.pprint(data_files); sys.exit() 358 359 import py2exe 387 360 setup( 388 361 windows=[target_wx_client], 389 console=[ ],362 console=[target_console_client], 390 363 options={ 391 364 'py2exe': {
Note: See TracChangeset
for help on using the changeset viewer.