Index: calculatorview/perspectives/calculator/__init__.py
===================================================================
--- calculatorview/perspectives/calculator/__init__.py	(revision 427fa8795b2c3a12926b4066306ddd51e8c6b18b)
+++ calculatorview/perspectives/calculator/__init__.py	(revision 698a734cf258cfc86037d29ed7ba9e6fb23ba68d)
@@ -1,2 +1,45 @@
 PLUGIN_ID = "Calculator plug-in 1.0"
 from calculator import *
+
+import os
+from distutils.filelist import findall
+
+def get_data_path(media):
+    """
+    """
+    # Check for data path in the package
+    path = os.path.join(os.path.dirname(__file__), media)
+    if os.path.isdir(path):
+        return path
+
+    # Check for data path next to exe/zip file.
+    # If we are inside a py2exe zip file, we need to go up
+    # two levels to get to the directory containing the exe
+    # We will check if the exe and the xsf are in the same
+    # directory.
+    path= os.path.dirname(__file__)
+    n_dir = 4
+    for i in range(n_dir):
+        path,_ = os.path.split(path)
+
+    path = os.path.join(path, '', media,'calculator_media' )
+    if os.path.isdir(path):
+        return path
+    path = os.path.join(path, '', media)
+    if os.path.isdir(path):
+        return path
+    raise RuntimeError('Could not find calculator media files')
+
+def data_files():
+    """
+    Return the data files associated with media calculator.
+    
+    The format is a list of (directory, [files...]) pairs which can be
+    used directly in setup(...,data_files=...) for setup.py.
+
+    """
+    data_files =[]
+    path = get_data_path(media="media")
+    for f in findall(path):
+        data_files.append(('media/calculator_media', [f]))
+    return data_files
Index: calculatorview/perspectives/calculator/help_panel.py
===================================================================
--- calculatorview/perspectives/calculator/help_panel.py	(revision 2f1c849ce82188f094f2a4d21e5fd2c3f1a39271)
+++ calculatorview/perspectives/calculator/help_panel.py	(revision 698a734cf258cfc86037d29ed7ba9e6fb23ba68d)
@@ -99,7 +99,7 @@
         self.rhelp = html.HtmlWindow(rpanel, -1, style=wx.NO_BORDER, 
                                      size=(500,-1))
-        path = os.getcwd()
-        self.path= os.path.join(os.path.split(path)[0],"calculatorview",
-                            "media","sld_calculator_help.html")
+        import sans.perspectives.calculator as calculator
+        path = calculator.get_data_path(media='media')
+        self.path= os.path.join(path,"sld_calculator_help.html")
        
         self.rhelp.LoadPage(self.path)
Index: invariantview/perspectives/invariant/__init__.py
===================================================================
--- invariantview/perspectives/invariant/__init__.py	(revision 272d91e2fbdcfd97440ab338b45a8684146a0483)
+++ invariantview/perspectives/invariant/__init__.py	(revision 698a734cf258cfc86037d29ed7ba9e6fb23ba68d)
@@ -1,2 +1,45 @@
 PLUGIN_ID = "Invariant plug-in 1.0"
 from invariant import *
+
+import os
+from distutils.filelist import findall
+
+def get_data_path(media):
+    """
+    """
+    # Check for data path in the package
+    path = os.path.join(os.path.dirname(__file__), media)
+    if os.path.isdir(path):
+        return path
+
+    # Check for data path next to exe/zip file.
+    # If we are inside a py2exe zip file, we need to go up
+    # two levels to get to the directory containing the exe
+    # We will check if the exe and the xsf are in the same
+    # directory.
+    path= os.path.dirname(__file__)
+    n_dir = 4
+    for i in range(n_dir):
+        path,_ = os.path.split(path)
+
+    path = os.path.join(path, '', media,'invariant_media' )
+    if os.path.isdir(path):
+        return path
+    path = os.path.join(path, '', media)
+    if os.path.isdir(path):
+        return path
+    raise RuntimeError('Could not find invariant media files')
+
+def data_files():
+    """
+    Return the data files associated with media invariant.
+    
+    The format is a list of (directory, [files...]) pairs which can be
+    used directly in setup(...,data_files=...) for setup.py.
+
+    """
+    data_files =[]
+    path = get_data_path(media="media")
+    for f in findall(path):
+        data_files.append(('media/invariant_media', [f]))
+    return data_files
Index: invariantview/perspectives/invariant/help_panel.py
===================================================================
--- invariantview/perspectives/invariant/help_panel.py	(revision f29a43370e88c77ffd9d856c6f9bde720f25ed4e)
+++ invariantview/perspectives/invariant/help_panel.py	(revision 698a734cf258cfc86037d29ed7ba9e6fb23ba68d)
@@ -78,8 +78,8 @@
         self.rhelp = html.HtmlWindow(rpanel, -1, style=wx.NO_BORDER, 
                                      size=(500,-1))
-        path = os.getcwd()
-        self.path= os.path.join(os.path.split(path)[0],"invariantview",
-                            "media","invariant_help.html")
-       
+        import sans.perspectives.invariant as invariant
+        path = invariant.get_data_path(media='media')
+        self.path= os.path.join(path,"invariant_help.html")
+     
         self.rhelp.LoadPage(self.path)
         page="""<html>
Index: nsview/media/sld_calculator_help.html
===================================================================
--- sansview/media/sld_calculator_help.html	(revision 3e0d308f3697fc9d6810e19d4fb550c5075d7270)
+++ 	(revision )
@@ -1,42 +1,0 @@
-<html>
-<body>
-<h4>Scattering Length Density (SLD) Calculator</h4>
-<ul>
-<li><a href="#SLD_calculator">Description</a></li>
-<li><a href="#How to use">How to format the compound name?</a></li>
-</ul>
-<h5><a name="SLD_calculator">Description</a></h5>
-<p>
-The neutron scattering length density is defined as: <br> 
-SLD = (b_c1 +b_c2+...+b_cn )/Vm  <br> where b_ci is the bound coherent scattering length of ith of 
-n atoms in a molecule with the molecular volume Vm
-</p>
-
-
-<h5><a name="How to use">How to format the compound name?</a></h5>
-<p>
-To calculate scattering length densities enter a compound and
-a mass density and click "Calculate". Enter a wavelength value is optional and its default 
-value will be 6.0A.
-</p> 
-<p>
-<ul>
-<li>Formula strings consist of counts and atoms such as "CaCO3+6H2O".</li>
-<li>Groups can be separated by <b>'+'</b> or <b>space</b>, so "CaCO3 6H2O" works as well.</li>
-<li>Groups and be defined using parentheses, such as "CaCO3(H2O)6".</li>
-<li>Parentheses can nest: "(CaCO3(H2O)6)1".</li>
-<li>Isotopes are represented by index, e.g., "CaCO[18]3+6H2O".</li>
-More examples: H[1], H[2].
-<li>Counts can be integer or decimal, e.g. "CaCO3+(3HO0.5)2".</li>
-Other compositions can be calculated as well,<br>
-for example a 70-30 mixture of H2O/D2O can be written as <b>H14O7+ D6O3</b><br>
-or more simply <b>H7D3O5 <\b>(i.e. 7 hydrogens, 3 deuteriums, and 5 oxygens)<br>
-and the mass density calculated based on the percentages of H and D. 
-Type for example "C[13]6 H[2]12 O[18]6" for C(13)6H(2)12O(18)6 (6 Carbon-13 atoms, 12 deuterium atoms, and 6 Oxygen-18 atoms) 
-
-</ul>
-</p>
-
-</body>
-
-<\html>
Index: sansview/setup_exe.py
===================================================================
--- sansview/setup_exe.py	(revision e5d76ce600b9b3d4d2f54a5d5e22c21c9169ffd6)
+++ sansview/setup_exe.py	(revision 698a734cf258cfc86037d29ed7ba9e6fb23ba68d)
@@ -15,5 +15,5 @@
 
 import os, sys
-    
+
 from distutils.core import setup
 from distutils.filelist import findall
@@ -67,7 +67,11 @@
 import periodictable
 import logging
-
 data_files += periodictable.data_files()
 
+import sans.perspectives.calculator as calculator
+data_files += calculator.data_files()
+
+import sans.perspectives.invariant as invariant
+data_files += invariant.data_files()
 
 for f in matplotlibdata:
