Changeset e912a58 in sasview for installers


Ignore:
Timestamp:
Aug 30, 2017 11:15:48 AM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, 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, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
7152c82
Parents:
25a42f99 (diff), b54440d (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.
Message:

Merge branch 'fix_loader_tests' into ticket-887-reorg

Location:
installers
Files:
4 added
9 moved

Legend:

Unmodified
Added
Removed
  • installers/installer_generator.py

    ra1b8fee ra67ec83  
    66from __future__ import print_function 
    77 
    8 import local_config 
    9 import os  
     8import os 
    109import string 
    1110 
     11root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 
     12sys.path.insert(0, os.path.join(root, 'sasview-install', 'Lib', 'site-packages')) 
     13from sas.sasview import local_config 
    1214 
    1315REG_PROGRAM = """{app}\MYPROG.EXE"" ""%1""" 
     
    2325AppUpdatesURL = local_config._homepage 
    2426ChangesEnvironment = 'true' 
    25 DefaultDirName = os.path.join("{pf}" , AppName+Dev)  
     27DefaultDirName = os.path.join("{pf}" , AppName+Dev) 
    2628DefaultGroupName = os.path.join(local_config.DefaultGroupName, AppVerName) 
    27                                  
     29 
    2830OutputBaseFilename = local_config.OutputBaseFilename 
    2931SetupIconFile = "images\\ball.ico" 
     
    4648    list_app =[] 
    4749    try: 
    48          
     50 
    4951        #(ext, type, name, flags) 
    5052        from sas.sascalc.dataloader.loader import Loader 
     
    5557            if ext.strip() not in ['.*', ''] and ext.strip() not in list_data: 
    5658                list_data.append((ext, 'string', file_type)) 
    57     except: 
     59    except Exception: 
    5860        pass 
    5961    try: 
     
    6163        if ext.strip() not in ['.', ''] and ext.strip() not in list_app: 
    6264            list_app.append((ext, 'string', file_type)) 
    63     except: 
     65    except Exception: 
    6466        pass 
    6567    try: 
     
    6769            file_type, ext = string.split(item, "|*", 1) 
    6870            if ext.strip() not in ['.', ''] and ext.strip() not in list_app: 
    69                 list_app.append((ext, 'string', file_type))  
    70     except: 
     71                list_app.append((ext, 'string', file_type)) 
     72    except Exception: 
    7173        pass 
    7274    return list_data, list_app 
     
    9193                              %  str(APPLICATION) 
    9294        msg += """ValueType: %s; """ % str('string') 
    93         msg += """ValueName: "%s";\t""" %str('')  
     95        msg += """ValueName: "%s";\t""" %str('') 
    9496        msg += """ValueData: \"""{app}\%s""  ""%s1\"""; \t"""% (str(APPLICATION), 
    95                                                           str('%'))     
     97                                                          str('%')) 
    9698        msg += """ Flags: %s""" % str('uninsdeletevalue noerror') 
    9799        msg += "\n" 
    98         user_list = "Software\Classes"  
     100        user_list = "Software\Classes" 
    99101        for (ext, type, _) in data_extension: 
    100102            list = os.path.join(user_list, ext, openwithlist) 
     
    107109                              %  (str(user_list), str(APPLICATION)) 
    108110        msg += """ValueType: %s; """ % str('string') 
    109         msg += """ValueName: "%s";\t""" %str('')  
     111        msg += """ValueName: "%s";\t""" %str('') 
    110112        msg += """ValueData: \"""{app}\%s""  ""%s1\"""; \t"""% (str(APPLICATION), 
    111                                                           str('%'))     
     113                                                          str('%')) 
    112114        msg += """ Flags: %s""" % str('uninsdeletevalue noerror') 
    113         msg += "\n"         
     115        msg += "\n" 
    114116    if app_extension is not None and app_extension: 
    115117        for (ext, type, _) in app_extension: 
    116118            msg +=  """Root: HKCR;\tSubkey: "%s";\t""" % str(ext) 
    117119            msg += """ValueType: %s;\t""" % str(type) 
    118             #file type empty set the current application as the default  
     120            #file type empty set the current application as the default 
    119121            #reader for this file. change the value of file_type to another 
    120122            #string modify the default reader 
     
    126128    msg += """Root: HKCR; Subkey: "{app}\%s";\t""" % str(APPLICATION) 
    127129    msg += """ValueType: %s; """ % str('string') 
    128     msg += """ValueName: "%s";\t""" % str('')  
    129     msg += """ValueData: "{app}\%s";\t""" % str("SasView File")  
     130    msg += """ValueName: "%s";\t""" % str('') 
     131    msg += """ValueData: "{app}\%s";\t""" % str("SasView File") 
    130132    msg += """ Flags: %s \t""" % str("uninsdeletekey  noerror") 
    131133    msg += "\n" 
    132          
     134 
    133135    #execute the file on double-click 
    134136    msg += """Root: HKCR; Subkey: "{app}\%s\shell\open\command";\t"""  %  str(APPLICATION) 
    135137    msg += """ValueType: %s; """ % str('string') 
    136     msg += """ValueName: "%s";\t""" %str('')  
     138    msg += """ValueName: "%s";\t""" %str('') 
    137139    msg += """ValueData: \"""{app}\%s""  ""%s1\""";\t"""% (str(APPLICATION), 
    138                                                           str('%'))   
     140                                                          str('%')) 
    139141    msg += """ Flags: %s \t""" % str("uninsdeletevalue noerror") 
    140     msg += "\n"                                                       
     142    msg += "\n" 
    141143    #create default icon 
    142144    msg += """Root: HKCR; Subkey: "{app}\%s";\t""" % str(SetupIconFile) 
    143145    msg += """ValueType: %s; """ % str('string') 
    144     msg += """ValueName: "%s";\t""" % str('')  
     146    msg += """ValueName: "%s";\t""" % str('') 
    145147    msg += """ValueData: "{app}\%s,0";\t""" % str(APPLICATION) 
    146148    msg += """ Flags: %s \t""" % str("uninsdeletevalue noerror") 
    147     msg += "\n"   
    148  
    149      
     149    msg += "\n" 
     150 
     151 
    150152    #SASVIEWPATH 
    151153    msg += """Root: HKLM; Subkey: "%s";\t"""  %  str('SYSTEM\CurrentControlSet\Control\Session Manager\Environment') 
    152154    msg += """ValueType: %s; """ % str('expandsz') 
    153     msg += """ValueName: "%s";\t""" % str('SASVIEWPATH')  
     155    msg += """ValueName: "%s";\t""" % str('SASVIEWPATH') 
    154156    msg += """ValueData: "{app}";\t""" 
    155157    msg += """ Flags: %s""" % str('uninsdeletevalue noerror') 
    156158    msg += "\n" 
    157      
     159 
    158160    #PATH 
    159161    msg += """; Write to PATH (below) is disabled; need more tests\n""" 
    160162    msg += """;Root: HKCU; Subkey: "%s";\t"""  %  str('Environment') 
    161163    msg += """ValueType: %s; """ % str('expandsz') 
    162     msg += """ValueName: "%s";\t""" % str('PATH')  
     164    msg += """ValueName: "%s";\t""" % str('PATH') 
    163165    msg += """ValueData: "%s;{olddata}";\t""" % str('%SASVIEWPATH%') 
    164166    msg += """ Check: %s""" % str('NeedsAddPath()') 
    165167    msg += "\n" 
    166          
    167     return msg 
    168  
    169 def write_language(language=['english'], msfile="compiler:Default.isl"):   
     168 
     169    return msg 
     170 
     171def write_languages(languages=('english',), msfile="compiler:Default.isl"): 
    170172    """ 
    171173    define the language of the application 
    172     """  
     174    """ 
    173175    msg = '' 
    174     if language: 
     176    if languages: 
    175177        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  
     178        for lang in languages: 
     179            msg += """Name: "%s";\tMessagesFile: "%s"\n""" % (str(lang), str(msfile)) 
     180    return msg 
    180181 
    181182def write_tasks(): 
     
    201202    msg += """Flags: ignoreversion recursesubdirs createallsubdirs\n""" 
    202203    msg += """Source: "dist\plugin_models\*";\tDestDir: "{userdesktop}\..\.sasview\plugin_models";\t""" 
    203     msg += """Flags: recursesubdirs createallsubdirs\n"""  
     204    msg += """Flags: recursesubdirs createallsubdirs\n""" 
    204205    msg += """Source: "dist\compiled_models\*";\tDestDir: "{userdesktop}\..\.sasmodels\compiled_models";\t""" 
    205206    msg += """Flags: recursesubdirs createallsubdirs\n""" 
    206     msg += """Source: "dist\config\custom_config.py";\tDestDir: "{userdesktop}\..\.sasview\config";\t"""  
     207    msg += """Source: "dist\config\custom_config.py";\tDestDir: "{userdesktop}\..\.sasview\config";\t""" 
    207208    msg += """Flags: recursesubdirs createallsubdirs\n""" 
    208     #msg += """Source: "dist\default_categories.json";    DestDir: "{userdesktop}\..\.sasview";\t"""  
     209    #msg += """Source: "dist\default_categories.json";    DestDir: "{userdesktop}\..\.sasview";\t""" 
    209210    #msg += """DestName: "categories.json";\n""" 
    210211    msg += """;\tNOTE: Don't use "Flags: ignoreversion" on any shared system files""" 
     
    235236    msg = """\n\n[Run]\n""" 
    236237    msg += """Filename: "{app}\%s";\t""" % str(APPLICATION) 
    237     msg += """Description: "{cm:LaunchProgram, %s}";\t""" %str(AppName)  
     238    msg += """Description: "{cm:LaunchProgram, %s}";\t""" %str(AppName) 
    238239    msg += """Flags: nowait postinstall skipifsilent\n""" 
    239240    msg += """; Install the Microsoft C++ DLL redistributable package if it is """ 
     
    260261    msg = """\n\n[Dirs]\n""" 
    261262    msg += """Name: "{app}\%s";\t""" % str('') 
    262     msg += """Permissions: everyone-modify\t"""  
    263     msg += """\n"""   
     263    msg += """Permissions: everyone-modify\t""" 
     264    msg += """\n""" 
    264265    return msg 
    265266 
    266267def write_code(): 
    267268    """ 
    268     Code that checks the existing path and snaviewpath  
     269    Code that checks the existing path and snaviewpath 
    269270    in the environmental viriables/PATH 
    270271    """ 
    271272    msg = """\n\n[Code]\n""" 
    272     msg += """function InstallVC90CRT(): Boolean;\n"""  
     273    msg += """function InstallVC90CRT(): Boolean;\n""" 
    273274    msg += """begin\n""" 
    274275    msg += """    Result := not DirExists('C:\WINDOWS\WinSxS\\x86_Microsoft.VC90.""" 
    275276    msg += """CRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_d08d0375');\n""" 
    276277    msg += """end;\n\n""" 
    277     msg += """function NeedsAddPath(): boolean;\n"""  
    278     msg += """var\n"""  
     278    msg += """function NeedsAddPath(): boolean;\n""" 
     279    msg += """var\n""" 
    279280    msg += """  oldpath: string;\n""" 
    280     msg += """  newpath: string;\n"""  
    281     msg += """  pathArr:    TArrayOfString;\n"""  
    282     msg += """  i:        Integer;\n"""  
    283     msg += """begin\n"""  
     281    msg += """  newpath: string;\n""" 
     282    msg += """  pathArr:    TArrayOfString;\n""" 
     283    msg += """  i:        Integer;\n""" 
     284    msg += """begin\n""" 
    284285    msg += """  RegQueryStringValue(HKEY_CURRENT_USER,'Environment',""" 
    285286    msg += """'PATH', oldpath)\n""" 
     
    324325    msg += """; installation.\n""" 
    325326    msg += """Type: dirifempty; Name: "{app}"\n""" 
    326     msg += """\n"""   
     327    msg += """\n""" 
    327328    return msg 
    328329 
     
    333334    TEMPLATE += "\n; and local_config.py located in this directory.\n " 
    334335    TEMPLATE += "; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!" 
    335     TEMPLATE += "\n[Setup]\n\n"  
     336    TEMPLATE += "\n[Setup]\n\n" 
    336337    TEMPLATE += "ChangesAssociations=%s\n" %str('yes') 
    337338    TEMPLATE += "AppName=%s\n" % str(AppName) 
     
    352353    TEMPLATE += "PrivilegesRequired=%s\n" % str(PrivilegesRequired) 
    353354    TEMPLATE += "UsePreviousAppDir=no\n" 
    354     
     355 
    355356    TEMPLATE += write_registry(data_extension=DATA_EXTENSION, 
    356357                                app_extension=APP_EXTENSION) 
    357     TEMPLATE += write_language() 
     358    TEMPLATE += write_languages() 
    358359    TEMPLATE += write_tasks() 
    359360    TEMPLATE += write_file() 
     
    364365    TEMPLATE += write_uninstalldelete() 
    365366    path = '%s.iss' % str(INSTALLER_FILE) 
    366     f = open(path,'w')  
     367    f = open(path,'w') 
    367368    f.write(TEMPLATE) 
    368369    f.close() 
    369370    print("Generate Inno setup installer script complete") 
    370371    print("A new file %s.iss should be created.Please refresh your directory" % str(INSTALLER_FILE)) 
    371      
     372 
    372373if __name__ == "__main__": 
    373374    generate_installer() 
  • installers/setup_exe.py

    r5a8cdbb r25a42f99  
    33# 
    44# 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. 
    77# 
    88# Setuptools clashes with py2exe 0.6.8 (and probably later too). 
    99# 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. 
    1111# 
    1212# Attention should be paid to dynamic imports. Data files can 
     
    3434root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 
    3535platform = '%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') 
     36doc_path = os.path.join(root, 'build', 'lib.'+platform, 'doc') 
     37build_path = os.path.join(root, 'sasview-install', 'Lib', 'site-packages') 
    3838sys.path.insert(0, build_path) 
    3939 
    40 import local_config 
     40from sas.sasview import local_config 
    4141from installer_generator import generate_installer 
    4242 
     
    6262        del sys.argv[path_flag_idx+1] 
    6363        sys.argv.remove('--extrapath') 
    64 except: 
     64except Exception: 
    6565    print("Error processing extra python path needed to build SasView\n  %s" % 
    6666          sys.exc_value) 
     
    174174path = os.getcwd() 
    175175 
    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  
    184176matplotlibdatadir = matplotlib.get_data_path() 
    185177matplotlibdata = findall(matplotlibdatadir) 
    186178 
    187 site_loc = get_python_lib() 
    188 opencl_include_dir = os.path.join(site_loc, "pyopencl", "cl") 
    189  
    190 data_files = [] 
     179DATA_FILES = [] 
    191180 
    192181if tinycc: 
    193     data_files += tinycc.data_files() 
     182    DATA_FILES += tinycc.data_files() 
    194183 
    195184# Copying SLD data 
    196185import 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() 
     186DATA_FILES += periodictable.data_files() 
     187 
     188from sas.sasgui.perspectives import fitting 
     189DATA_FILES += fitting.data_files() 
     190 
     191from sas.sasgui.perspectives import calculator 
     192DATA_FILES += calculator.data_files() 
     193 
     194from sas.sasgui.perspectives import invariant 
     195DATA_FILES += invariant.data_files() 
     196 
     197from sas.sasgui import guiframe 
     198DATA_FILES += guiframe.data_files() 
    210199 
    211200# precompile sas models into the sasview build path; doesn't matter too much 
     
    217206# include the compiled models as data; coordinate the target path for the 
    218207# data with installer_generator.py 
    219 data_files.append(('compiled_models', compiled_dlls)) 
     208DATA_FILES.append(('compiled_models', compiled_dlls)) 
    220209 
    221210import sasmodels 
    222 data_files += sasmodels.data_files() 
     211DATA_FILES += sasmodels.data_files() 
    223212 
    224213for f in matplotlibdata: 
    225214    dirname = os.path.join('mpl-data', f[len(matplotlibdatadir)+1:]) 
    226     data_files.append((os.path.split(dirname)[0], [f])) 
     215    DATA_FILES.append((os.path.split(dirname)[0], [f])) 
    227216 
    228217# 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()) 
    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 # numerical libraries 
     218from sas.sascalc.dataloader import readers 
     219reader_config = os.path.join(readers.get_data_path(), 'defaults.json') 
     220if os.path.isfile(reader_config): 
     221    DATA_FILES.append(('.', [reader_config])) 
     222 
     223# Copy the config files 
     224sas_path = os.path.join('..', 'src', 'sas') 
     225DATA_FILES.append(('.', [os.path.join(sas_path, 'logging.ini')])) 
     226sasview_path = os.path.join(sas_path, 'sasview') 
     227config_files = [ 
     228    'custom_config.py', 
     229    'local_config.py', 
     230    #'default_categories.json', 
     231    ] 
     232DATA_FILES.append(('.', [os.path.join(sasview_path, v) for v in config_files])) 
     233DATA_FILES.append(('config', [os.path.join(sasview_path, 'custom_config.py')])) 
     234 
     235# default_categories.json is beside the config files 
     236category_config = os.path.join(os.path.dirname(local_config_file), 
     237                               'default_categories.json') 
     238if os.path.isfile(category_config): 
     239    DATA_FILES.append(('.', [category_config])) 
     240 
     241if os.path.isfile("BUILD_NUMBER"): 
     242    DATA_FILES.append(('.', ["BUILD_NUMBER"])) 
     243 
     244images_dir = local_config.icon_path 
     245media_dir = local_config.media_path 
     246test_dir = local_config.test_path 
     247test_1d_dir = os.path.join(test_dir, "1d_data") 
     248test_2d_dir = os.path.join(test_dir, "2d_data") 
     249test_save_dir = os.path.join(test_dir, "save_states") 
     250test_upcoming_dir = os.path.join(test_dir, "upcoming_formats") 
     251 
     252# Copying the images directory to the distribution directory. 
     253for f in findall(images_dir): 
     254    DATA_FILES.append(("images", [f])) 
     255 
     256# Copying the HTML help docs 
     257for f in findall(media_dir): 
     258    DATA_FILES.append(("media", [f])) 
     259 
     260# Copying the sample data user data 
     261for f in findall(test_1d_dir): 
     262    DATA_FILES.append((os.path.join("test", "1d_data"), [f])) 
     263 
     264# Copying the sample data user data 
     265for f in findall(test_2d_dir): 
     266    DATA_FILES.append((os.path.join("test", "2d_data"), [f])) 
     267 
     268# Copying the sample data user data 
     269for f in findall(test_save_dir): 
     270    DATA_FILES.append((os.path.join("test", "save_states"), [f])) 
     271 
     272# Copying the sample data user data 
     273for f in findall(test_upcoming_dir): 
     274    DATA_FILES.append((os.path.join("test", "upcoming_formats"), [f])) 
     275 
     276# Copying opencl include files 
     277site_loc = get_python_lib() 
     278opencl_include_dir = os.path.join(site_loc, "pyopencl", "cl") 
     279for f in findall(opencl_include_dir): 
     280    DATA_FILES.append((os.path.join("includes", "pyopencl"), [f])) 
     281 
     282# Numerical libraries 
     283python_root = os.path.dirname(os.path.abspath(sys.executable)) 
    246284def dll_check(dll_path, dlls): 
    247285    dll_includes = [os.path.join(dll_path, dll+'.dll') for dll in dlls] 
    248286    return [dll for dll in dll_includes if os.path.exists(dll)] 
    249287 
    250 python_root = os.path.dirname(os.path.abspath(sys.executable)) 
    251288# Check for ATLAS 
    252 dll_path = os.path.join(python_root, 'lib', 'site-packages', 'numpy', 'core') 
    253 dlls = ['numpy-atlas'] 
    254 atlas_dlls = dll_check(dll_path, dlls) 
     289numpy_path = os.path.join(python_root, 'lib', 'site-packages', 'numpy', 'core') 
     290atlas_dlls = dll_check(numpy_path, ['numpy-atlas']) 
    255291 
    256292# Check for MKL 
    257 dll_path = os.path.join(python_root, 'Library', 'bin') 
    258 dlls = ['mkl_core', 'mkl_def', 'libiomp5md'] 
    259 mkl_dlls = dll_check(dll_path, dlls) 
     293mkl_path = os.path.join(python_root, 'Library', 'bin') 
     294mkl_dlls = dll_check(mkl_path, ['mkl_core', 'mkl_def', 'libiomp5md']) 
    260295 
    261296if atlas_dlls: 
    262     data_files.append(('.', atlas_dlls)) 
     297    DATA_FILES.append(('.', atlas_dlls)) 
    263298elif mkl_dlls: 
    264     data_files.append(('.', mkl_dlls)) 
    265  
    266 if os.path.isfile("BUILD_NUMBER"): 
    267     data_files.append(('.', ["BUILD_NUMBER"])) 
    268  
    269 # Copying the images directory to the distribution directory. 
    270 for f in findall(images_dir): 
    271     if not ".svn" in f: 
    272         data_files.append(("images", [f])) 
    273  
    274 # Copying the HTML help docs 
    275 for f in findall(media_dir): 
    276     if not ".svn" in f: 
    277         data_files.append(("media", [f])) 
    278  
    279 # Copying the sample data user data 
    280 for f in findall(test_1d_dir): 
    281     if not ".svn" in f: 
    282         data_files.append(("test\\1d_data", [f])) 
    283  
    284 # Copying the sample data user data 
    285 for f in findall(test_2d_dir): 
    286     if not ".svn" in f: 
    287         data_files.append(("test\\2d_data", [f])) 
    288  
    289 # Copying the sample data user data 
    290 for f in findall(test_save_dir): 
    291     if not ".svn" in f: 
    292         data_files.append(("test\\save_states", [f])) 
    293  
    294 # Copying the sample data user data 
    295 for f in findall(test_upcoming_dir): 
    296     if not ".svn" in f: 
    297         data_files.append(("test\\upcoming_formats", [f])) 
    298  
    299 # Copying opencl include files 
    300 for f in findall(opencl_include_dir): 
    301     data_files.append(("includes\\pyopencl",[f])) 
     299    DATA_FILES.append(('.', mkl_dlls)) 
    302300 
    303301# See if the documentation has been built, and if so include it. 
    304 doc_path = os.path.join(build_path, "doc") 
    305302if os.path.exists(doc_path): 
    306303    for dirpath, dirnames, filenames in os.walk(doc_path): 
    307304        for filename in filenames: 
    308305            sub_dir = os.path.join("doc", os.path.relpath(dirpath, doc_path)) 
    309             data_files.append((sub_dir, [os.path.join(dirpath, filename)])) 
     306            DATA_FILES.append((sub_dir, [os.path.join(dirpath, filename)])) 
    310307else: 
    311308    raise Exception("You must first build the documentation before creating an installer.") 
     
    313310if msvcrtdll_data_files is not None: 
    314311    # install the MSVC 9 runtime dll's into the application folder 
    315     data_files.append(msvcrtdll_data_files) 
     312    DATA_FILES.append(msvcrtdll_data_files) 
    316313 
    317314# NOTE: 
     
    322319packages = [ 
    323320    'matplotlib', 'scipy', 'encodings', 'comtypes', 'h5py', 
    324     'win32com', 'xhtml2pdf', 'bumps','sasmodels', 'sas', 
     321    'win32com', 'xhtml2pdf', 'bumps', 'sasmodels', 'sas', 
    325322    ] 
    326323packages.extend([ 
     
    337334    ]) 
    338335packages.append('periodictable.core') # not found automatically 
    339 # packages.append('IPython') 
     336 
     337# For an interactive interpreter, SasViewCom 
     338packages.extend(['IPython', 'pyreadline', 'pyreadline.unicode_helper']) 
     339 
     340# individual models 
    340341includes = ['site', 'lxml._elementpath', 'lxml.etree'] 
    341342 
     
    344345 
    345346# Exclude packages that are not needed but are often found on build systems 
    346 excludes = ['Tkinter', 'PyQt4', '_tkagg', 'sip', 'pytz', 'sympy'] 
    347  
    348  
    349 dll_excludes = [ 
     347excludes = [ 
     348    'Tkinter', 'PyQt4', '_tkagg', 'sip', 'pytz', 'sympy', 
    350349    # Various matplotlib backends we are not using 
    351350    'libgdk_pixbuf-2.0-0.dll', 'libgobject-2.0-0.dll', 'libgdk-win32-2.0-0.dll', 
    352351    'tcl84.dll', 'tk84.dll', 'QtGui4.dll', 'QtCore4.dll', 
    353352    # numpy 1.8 openmp bindings (still seems to use all the cores without them) 
     353    # ... but we seem to need them when building from anaconda, so don't exclude ... 
    354354    #'libiomp5md.dll', 'libifcoremd.dll', 'libmmd.dll', 'svml_dispmd.dll','libifportMD.dll', 
    355355    'numpy-atlas.dll', 
     
    365365 
    366366target_wx_client = Target( 
    367     description = 'SasView', 
    368     script = 'sasview.py', 
    369     icon_resources = [(1, os.path.join(images_dir, "ball.ico"))], 
    370     other_resources = [(24, 1, manifest)], 
    371     dest_base = "SasView" 
     367    description='SasView', 
     368    script='sasview_gui.py', 
     369    icon_resources=[(1, local_config.SetupIconFile_win)], 
     370    other_resources=[(24, 1, manifest)], 
     371    dest_base="SasView" 
    372372) 
    373373 
    374 # bundle_option = 2 
    375 bundle_option = 3 
    376 if is_64bits: 
    377     bundle_option = 3 
     374target_console_client = Target( 
     375    description='SasView console', 
     376    script='sasview_console.py', 
     377    icon_resources=[(1, local_config.SetupIconFile_win)], 
     378    other_resources=[(24, 1, manifest)], 
     379    dest_base="SasViewCom" 
     380) 
     381 
     382bundle_option = 3 if is_64bits else 2 
    378383generate_installer() 
    379384#initialize category stuff 
     
    383388setup( 
    384389    windows=[target_wx_client], 
    385     console=[], 
     390    console=[target_console_client], 
    386391    options={ 
    387392        'py2exe': { 
     
    395400            }, 
    396401    }, 
    397     data_files=data_files, 
     402    data_files=DATA_FILES, 
    398403) 
Note: See TracChangeset for help on using the changeset viewer.