Index: installers/setup_exe.py
===================================================================
--- installers/setup_exe.py	(revision 156203a1e149e0ce9222727a29f426a2fcef83f3)
+++ installers/setup_exe.py	(revision 0046c6a5da7606ee0482b71a5a339984a0700f46)
@@ -17,6 +17,6 @@
 import os
 import sys
+from glob import glob
 import warnings
-from glob import glob
 import shutil
 
@@ -29,7 +29,8 @@
 #from idlelib.PyShell import warning_stream
 
+if os.path.abspath(os.path.dirname(__file__)) != os.path.abspath(os.getcwd()):
+    raise RuntimeError("Must run setup_exe from the installers directory")
+
 # put the build directory at the front of the path
-if os.path.abspath(os.path.dirname(__file__)) != os.path.abspath(os.getcwd()):
-    raise RuntimeError("Must run setup_exe from the sasview directory")
 root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
 platform = '%s-%s'%(get_platform(), sys.version[:3])
@@ -153,9 +154,5 @@
 else:
     msvcrtdll = glob(r"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*.*")
-if msvcrtdll:
-    msvcrtdll_data_files = ("Microsoft.VC90.CRT", msvcrtdll)
-else:
-    msvcrtdll_data_files = None
-
+msvcrtdll_data_files = ("Microsoft.VC90.CRT", msvcrtdll) if msvcrtdll else None
 
 class Target:
@@ -172,29 +169,22 @@
 # to use the MatPlotLib.
 #
-path = os.getcwd()
-
 matplotlibdatadir = matplotlib.get_data_path()
 matplotlibdata = findall(matplotlibdatadir)
 
-DATA_FILES = []
+data_files = []
 
 if tinycc:
-    DATA_FILES += tinycc.data_files()
-
-# Copying SLD data
+    data_files += tinycc.data_files()
+
+# Include data for supporting packages
 import periodictable
-DATA_FILES += periodictable.data_files()
-
-from sas.sasgui.perspectives import fitting
-DATA_FILES += fitting.data_files()
-
-from sas.sasgui.perspectives import calculator
-DATA_FILES += calculator.data_files()
-
-from sas.sasgui.perspectives import invariant
-DATA_FILES += invariant.data_files()
-
-from sas.sasgui import guiframe
-DATA_FILES += guiframe.data_files()
+data_files += periodictable.data_files()
+
+for f in matplotlibdata:
+    dirname = os.path.join('mpl-data', f[len(matplotlibdatadir)+1:])
+    data_files.append((os.path.split(dirname)[0], [f]))
+
+import sasmodels
+data_files += sasmodels.data_files()
 
 # precompile sas models into the sasview build path; doesn't matter too much
@@ -206,64 +196,61 @@
 # include the compiled models as data; coordinate the target path for the
 # data with installer_generator.py
-DATA_FILES.append(('compiled_models', compiled_dlls))
-
-import sasmodels
-DATA_FILES += sasmodels.data_files()
-
-for f in matplotlibdata:
-    dirname = os.path.join('mpl-data', f[len(matplotlibdatadir)+1:])
-    DATA_FILES.append((os.path.split(dirname)[0], [f]))
-
-# Copy the settings file for the sas.dataloader file extension associations
-from sas.sascalc.dataloader import readers
-reader_config = os.path.join(readers.get_data_path(), 'defaults.json')
-if os.path.isfile(reader_config):
-    DATA_FILES.append(('.', [reader_config]))
+data_files.append(('compiled_models', compiled_dlls))
+
+# Data files for the different perspectives
+from sas.sasgui.perspectives import fitting
+data_files += fitting.data_files()
+
+from sas.sasgui.perspectives import calculator
+data_files += calculator.data_files()
+
+from sas.sasgui.perspectives import invariant
+data_files += invariant.data_files()
+
+from sas.sasgui import guiframe
+data_files += guiframe.data_files()
 
 # Copy the config files
+sasview_path = os.path.join('..', 'src', 'sas', 'sasview')
+data_files.append(('.', [os.path.join(sasview_path, 'custom_config.py')]))
+data_files.append(('config', [os.path.join(sasview_path, 'custom_config.py')]))
+data_files.append(('.', [os.path.join(sasview_path, 'local_config.py')]))
+
+# Copy the logging config
 sas_path = os.path.join('..', 'src', 'sas')
-DATA_FILES.append(('.', [os.path.join(sas_path, 'logging.ini')]))
-sasview_path = os.path.join(sas_path, 'sasview')
-config_files = [
-    'custom_config.py',
-    'local_config.py',
-    ]
-DATA_FILES.append(('.', [os.path.join(sasview_path, v) for v in config_files]))
-DATA_FILES.append(('config', [os.path.join(sasview_path, 'custom_config.py')]))
+data_files.append(('.', [os.path.join(sas_path, 'logging.ini')]))
 
 if os.path.isfile("BUILD_NUMBER"):
-    DATA_FILES.append(('.', ["BUILD_NUMBER"]))
-
+    data_files.append(('.', ["BUILD_NUMBER"]))
+
+# Copying the images directory to the distribution directory.
 images_dir = local_config.icon_path
+for f in findall(images_dir):
+    data_files.append(("images", [f]))
+
+# Copying the HTML help docs
 media_dir = local_config.media_path
+for f in findall(media_dir):
+    data_files.append(("media", [f]))
+
+# Copying the sample data user data
 test_dir = local_config.test_path
-test_1d_dir = os.path.join(test_dir, "1d_data")
-test_2d_dir = os.path.join(test_dir, "2d_data")
-test_save_dir = os.path.join(test_dir, "save_states")
-test_upcoming_dir = os.path.join(test_dir, "upcoming_formats")
-
-# Copying the images directory to the distribution directory.
-for f in findall(images_dir):
-    DATA_FILES.append(("images", [f]))
-
-# Copying the HTML help docs
-for f in findall(media_dir):
-    DATA_FILES.append(("media", [f]))
-
-# Copying the sample data user data
-for f in findall(test_1d_dir):
-    DATA_FILES.append((os.path.join("test", "1d_data"), [f]))
-
-# Copying the sample data user data
-for f in findall(test_2d_dir):
-    DATA_FILES.append((os.path.join("test", "2d_data"), [f]))
-
-# Copying the sample data user data
-for f in findall(test_save_dir):
-    DATA_FILES.append((os.path.join("test", "save_states"), [f]))
-
-# Copying the sample data user data
-for f in findall(test_upcoming_dir):
-    DATA_FILES.append((os.path.join("test", "upcoming_formats"), [f]))
+for f in findall(os.path.join(test_dir, "1d_data")):
+    data_files.append((os.path.join("test", "1d_data"), [f]))
+for f in findall(os.path.join(test_dir, "2d_data")):
+    data_files.append((os.path.join("test", "2d_data"), [f]))
+for f in findall(os.path.join(test_dir, "save_states")):
+    data_files.append((os.path.join("test", "save_states"), [f]))
+for f in findall(os.path.join(test_dir, "upcoming_formats")):
+    data_files.append((os.path.join("test", "upcoming_formats"), [f]))
+
+# See if the documentation has been built, and if so include it.
+if os.path.exists(doc_path):
+    for dirpath, dirnames, filenames in os.walk(doc_path):
+        for filename in filenames:
+            sub_dir = os.path.join("doc", os.path.relpath(dirpath, doc_path))
+            data_files.append((sub_dir, [os.path.join(dirpath, filename)]))
+else:
+    raise Exception("You must first build the documentation before creating an installer.")
 
 # Copying opencl include files
@@ -271,5 +258,5 @@
 opencl_include_dir = os.path.join(site_loc, "pyopencl", "cl")
 for f in findall(opencl_include_dir):
-    DATA_FILES.append((os.path.join("includes", "pyopencl"), [f]))
+    data_files.append((os.path.join("includes", "pyopencl"), [f]))
 
 # Numerical libraries
@@ -288,20 +275,11 @@
 
 if atlas_dlls:
-    DATA_FILES.append(('.', atlas_dlls))
+    data_files.append(('.', atlas_dlls))
 elif mkl_dlls:
-    DATA_FILES.append(('.', mkl_dlls))
-
-# See if the documentation has been built, and if so include it.
-if os.path.exists(doc_path):
-    for dirpath, dirnames, filenames in os.walk(doc_path):
-        for filename in filenames:
-            sub_dir = os.path.join("doc", os.path.relpath(dirpath, doc_path))
-            DATA_FILES.append((sub_dir, [os.path.join(dirpath, filename)]))
-else:
-    raise Exception("You must first build the documentation before creating an installer.")
+    data_files.append(('.', mkl_dlls))
 
 if msvcrtdll_data_files is not None:
     # install the MSVC 9 runtime dll's into the application folder
-    DATA_FILES.append(msvcrtdll_data_files)
+    data_files.append(msvcrtdll_data_files)
 
 # NOTE:
@@ -328,5 +306,5 @@
 packages.append('periodictable.core') # not found automatically
 
-# For an interactive interpreter, SasViewCom
+# For the interactive interpreter SasViewCom make sure ipython is available
 packages.extend(['IPython', 'pyreadline', 'pyreadline.unicode_helper'])
 
@@ -338,6 +316,7 @@
 
 # Exclude packages that are not needed but are often found on build systems
-excludes = [
-    'Tkinter', 'PyQt4', '_tkagg', 'sip', 'pytz', 'sympy',
+excludes = ['Tkinter', 'PyQt4', '_tkagg', 'sip', 'pytz', 'sympy']
+
+dll_excludes = [
     # Various matplotlib backends we are not using
     'libgdk_pixbuf-2.0-0.dll', 'libgobject-2.0-0.dll', 'libgdk-win32-2.0-0.dll',
@@ -393,4 +372,4 @@
             },
     },
-    data_files=DATA_FILES,
+    data_files=data_files,
 )
Index: installers/setup_mac.py
===================================================================
--- installers/setup_mac.py	(revision 156203a1e149e0ce9222727a29f426a2fcef83f3)
+++ installers/setup_mac.py	(revision 0046c6a5da7606ee0482b71a5a339984a0700f46)
@@ -15,6 +15,6 @@
 
 import os
+import sys
 import string
-import sys
 
 from distutils.util import get_platform
@@ -26,86 +26,85 @@
 import macholib_patch
 
+if os.path.abspath(os.path.dirname(__file__)) != os.path.abspath(os.getcwd()):
+    raise RuntimeError("Must run setup_exe from the installers directory")
+
+# put the build directory at the front of the path
 root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
 platform = '%s-%s'%(get_platform(), sys.version[:3])
 doc_path = os.path.join(root, 'build', 'lib.'+platform, 'doc')
-env = os.path.join(root, 'sasview-install', 'lib', 'python2.7', 'site-packages')
-#sys.path.insert(0, env)
+build_path = os.path.join(root, 'sasview-install', 'lib', 'python2.7', 'site-packages')
+#sys.path.insert(0, build_path)
+print("build path", build_path)
 
 #Extending recursion limit
 sys.setrecursionlimit(10000)
 
-print("BUILDING PATH INSIDE", env)
-
 from sas.sasview import local_config
 
 ICON = local_config.SetupIconFile_mac
-RESOURCES_FILES = []
-DATA_FILES = []
-
-#Periodictable data file
+data_files = []
+
+# Include data for supporting packages
 import periodictable
-DATA_FILES += periodictable.data_files()
-#invariant and calculator help doc
+data_files += periodictable.data_files()
+
+import sasmodels
+data_files += sasmodels.data_files()
+
+# Data files for the different perspectives
 from sas.sasgui.perspectives import fitting
-DATA_FILES += fitting.data_files()
+data_files += fitting.data_files()
+
 from sas.sasgui.perspectives import calculator
-DATA_FILES += calculator.data_files()
+data_files += calculator.data_files()
+
 from sas.sasgui.perspectives import invariant
-DATA_FILES += invariant.data_files()
-import sasmodels
-DATA_FILES += sasmodels.data_files()
+data_files += invariant.data_files()
+
 from sas.sasgui import guiframe
-DATA_FILES += guiframe.data_files()
-
-#CANSAxml reader data files
-from sas.sascalc.dataloader import readers
-RESOURCES_FILES.append(os.path.join(readers.get_data_path(), 'defaults.json'))
+data_files += guiframe.data_files()
 
 # Copy the config files
+sasview_path = os.path.join(sas_path, 'sasview')
+data_files.append(('.', [os.path.join(sasview_path, 'custom_config.py')]))
+data_files.append(('config', [os.path.join(sasview_path, 'custom_config.py')]))
+data_files.append(('.', [os.path.join(sasview_path, 'local_config.py')]))
+
+# Copy the logging config
 sas_path = os.path.join('..', 'src', 'sas')
-DATA_FILES.append(('.', [os.path.join(sas_path, 'logging.ini')]))
-sasview_path = os.path.join(sas_path, 'sasview')
-custom_config_file = os.path.join(sasview_path, 'custom_config.py')
-local_config_file = os.path.join(sasview_path, 'local_config.py')
-logging_ini = os.path.join(sas_path, 'logging.ini')
-DATA_FILES.append(('.', [custom_config_file]))
-DATA_FILES.append(('config', [custom_config_file]))
-DATA_FILES.append(('.', [local_config_file]))
-DATA_FILES.append(('.', [logging_ini]))
+data_files.append(('.', [os.path.join(sas_path, 'logging.ini')]))
 
 if os.path.isfile("BUILD_NUMBER"):
-    DATA_FILES.append(('.', ["BUILD_NUMBER"]))
-
+    data_files.append(('.', ["BUILD_NUMBER"]))
+
+# Copying the images directory to the distribution directory.
 images_dir = local_config.icon_path
+for f in findall(images_dir):
+    data_files.append(("images", [f]))
+
+# Copying the HTML help docs
 media_dir = local_config.media_path
+for f in findall(media_dir):
+    data_files.append(("media", [f]))
+
+# Copying the sample data user data
 test_dir = local_config.test_path
-test_1d_dir = os.path.join(test_dir, "1d_data")
-test_2d_dir = os.path.join(test_dir, "2d_data")
-test_save_dir = os.path.join(test_dir, "save_states")
-test_upcoming_dir = os.path.join(test_dir, "upcoming_formats")
-
-# Copying the images directory to the distribution directory.
-for f in findall(images_dir):
-    DATA_FILES.append(("images", [f]))
-
-# Copying the HTML help docs
-for f in findall(media_dir):
-    DATA_FILES.append(("media", [f]))
-
-# Copying the sample data user data
-for f in findall(test_1d_dir):
-    DATA_FILES.append((os.path.join("test", "1d_data"), [f]))
-
-# Copying the sample data user data
-for f in findall(test_2d_dir):
-    DATA_FILES.append((os.path.join("test", "2d_data"), [f]))
-
-# Copying the sample data user data
-for f in findall(test_save_dir):
-    DATA_FILES.append((os.path.join("test", "save_states"), [f]))
-
-# Copying the sample data user data
-for f in findall(test_upcoming_dir):
-    DATA_FILES.append((os.path.join("test", "upcoming_formats"), [f]))
+for f in findall(os.path.join(test_dir, "1d_data")):
+    data_files.append((os.path.join("test", "1d_data"), [f]))
+for f in findall(os.path.join(test_dir, "2d_data")):
+    data_files.append((os.path.join("test", "2d_data"), [f]))
+for f in findall(os.path.join(test_dir, "save_states")):
+    data_files.append((os.path.join("test", "save_states"), [f]))
+for f in findall(os.path.join(test_dir, "upcoming_formats")):
+    data_files.append((os.path.join("test", "upcoming_formats"), [f]))
+
+# See if the documentation has been built, and if so include it.
+if os.path.exists(doc_path):
+    for dirpath, dirnames, filenames in os.walk(doc_path):
+        for filename in filenames:
+            sub_dir = os.path.join("doc", os.path.relpath(dirpath, doc_path))
+            data_files.append((sub_dir, [os.path.join(dirpath, filename)]))
+else:
+    raise Exception("You must first build the documentation before creating an installer.")
 
 # Copying opencl include files
@@ -113,15 +112,15 @@
 opencl_include_dir = os.path.join(site_loc, "pyopencl", "cl")
 for f in findall(opencl_include_dir):
-    DATA_FILES.append((os.path.join("includes", "pyopencl"), [f]))
-
-# See if the documentation has been built, and if so include it.
-print(doc_path)
-if os.path.exists(doc_path):
-    for dirpath, dirnames, filenames in os.walk(doc_path):
-        for filename in filenames:
-            sub_dir = os.path.join("doc", os.path.relpath(dirpath, doc_path))
-            DATA_FILES.append((sub_dir, [os.path.join(dirpath, filename)]))
-else:
-    raise Exception("You must first build the documentation before creating an installer.")
+    data_files.append((os.path.join("includes", "pyopencl"), [f]))
+
+# Locate libxml2 library
+lib_locs = ['/usr/local/lib', '/usr/lib']
+libxml_path = None
+for item in lib_locs:
+    libxml_path_test = '%s/libxml2.2.dylib' % item
+    if os.path.isfile(libxml_path_test):
+        libxml_path = libxml_path_test
+if libxml_path is None:
+    raise RuntimeError("Could not find libxml2 on the system")
 
 # locate file extensions
@@ -160,19 +159,8 @@
 EXTENSIONS_LIST = find_extension()
 
-
 plist = dict(CFBundleDocumentTypes=[dict(CFBundleTypeExtensions=EXTENSIONS_LIST,
                                          CFBundleTypeIconFile=ICON,
                                          CFBundleTypeName="sasview file",
                                          CFBundleTypeRole="Shell")],)
-
-# Locate libxml2 library
-lib_locs = ['/usr/local/lib', '/usr/lib']
-libxml_path = None
-for item in lib_locs:
-    libxml_path_test = '%s/libxml2.2.dylib' % item
-    if os.path.isfile(libxml_path_test):
-        libxml_path = libxml_path_test
-if libxml_path is None:
-    raise RuntimeError, "Could not find libxml2 on the system"
 
 #Get version - NB nasty hack. Need to find correct way to give path to installed sasview (AJJ)
@@ -194,5 +182,5 @@
            'iconfile': ICON,
            'frameworks': [libxml_path],
-           'resources': RESOURCES_FILES,
+           'resources': [],
            'plist': plist,
            'excludes' : EXCLUDES,
@@ -201,5 +189,5 @@
     name=APPNAME,
     app=APP,
-    data_files=DATA_FILES,
+    data_files=data_files,
     include_package_data=True,
     options={'py2app': OPTIONS},
