Index: sansview/installer_new.iss
===================================================================
--- sansview/installer_new.iss	(revision 2d74016efb613011ad42bab4c08f12cfc115c99d)
+++ sansview/installer_new.iss	(revision 59c6c1ed42ef0166cdce335f84752472fc7dd9ac)
@@ -62,4 +62,5 @@
 [Tasks]
 Name: "desktopicon";	Description: "{cm:CreateDesktopIcon}";	GroupDescription: "{cm:AdditionalIcons}";	Flags: unchecked
+Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
 
 
@@ -67,17 +68,23 @@
 Source: "dist\SansView.exe";	DestDir: "{app}";	Flags: ignoreversion
 Source: "dist\*";	DestDir: "{app}";	Flags: ignoreversion recursesubdirs createallsubdirs
-Source: "images\*";	DestDir: "{app}\images";	Flags: ignoreversion recursesubdirs createallsubdirs
-Source: "test\*";	DestDir: "{app}\test";	Flags: ignoreversion recursesubdirs createallsubdirs
-Source: "media\*";	DestDir: "{app}\media";	Flags: ignoreversion recursesubdirs createallsubdirs
 ;	NOTE: Don't use "Flags: ignoreversion" on any shared system files
 
 [Icons]
-Name: "{group}\SansView";	Filename: "{app}\SansView.exe";	WorkingDir: "{app}" 
+Name: "{group}\SansView";	Filename: "{app}\SansView.exe";	WorkingDir: "{app}"; IconFilename: "{app}\images\ball.ico"
 Name: "{group}\{cm:UninstallProgram, SansView}";	 Filename: "{uninstallexe}" 
-Name: "{commondesktop}\SansView-2.0.1";	Filename: "{app}\SansView.exe";	Tasks: desktopicon; WorkingDir: "{app}" 
+Name: "{commondesktop}\SansView-2.0.1";	Filename: "{app}\SansView.exe";	Tasks: desktopicon; WorkingDir: "{app}" ; IconFilename: "{app}\images\ball.ico"
+Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\SansView-2.0.1"; Filename: "{app}\SansView"; Tasks: quicklaunchicon; WorkingDir: "{app}"; IconFilename: "{app}\images\ball.ico"
 
 
 [Run]
 Filename: "{app}\SansView.exe";	Description: "{cm:LaunchProgram, SansView}";	Flags: nowait postinstall skipifsilent
+; Install the Microsoft C++ DLL redistributable package if it is provided and the DLLs are not present on the target system.
+; Note that the redistributable package is included if the app was built using Python 2.6 or 2.7, but not with 2.5.
+; Parameter options:
+; - for silent install use: "/q"
+; - for silent install with progress bar use: "/qb"
+; - for silent install with progress bar but disallow cancellation of operation use: "/qb!"
+; Note that we do not use the postinstall flag as this would display a checkbox and thus require the user to decide what to do.
+;Filename: "{app}\vcredist_x86.exe"; Parameters: "/qb!"; WorkingDir: "{tmp}"; StatusMsg: "Installing Microsoft Visual C++ 2008 Redistributable Package ..."; Check: InstallVC90CRT(); Flags: skipifdoesntexist waituntilterminated
 
 
@@ -87,4 +94,9 @@
 
 [Code]
+function InstallVC90CRT(): Boolean;
+begin
+    Result := not DirExists('C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_d08d0375');
+end;
+
 function NeedsAddPath(): boolean;
 var
@@ -113,2 +125,12 @@
 end;
 
+[UninstallDelete]
+; Delete directories and files that are dynamically created by the application (i.e. at runtime).
+Type: filesandordirs; Name: "{app}\.matplotlib"
+Type: files; Name: "{app}\*.*"
+; The following is a workaround for the case where the application is installed and uninstalled but the
+;{app} directory is not deleted because it has user files.  Then the application is installed into the
+; existing directory, user files are deleted, and the application is un-installed again.  Without the
+; directive below, {app} will not be deleted because Inno Setup did not create it during the previous
+; installation.
+Type: dirifempty; Name: "{app}"
Index: sansview/setup_exe.py
===================================================================
--- sansview/setup_exe.py	(revision feadd6f13b05200df986141e63085cc1c7d7e554)
+++ sansview/setup_exe.py	(revision 59c6c1ed42ef0166cdce335f84752472fc7dd9ac)
@@ -37,14 +37,19 @@
 import matplotlib
 import py2exe
-
-
-origIsSystemDLL = py2exe.build_exe.isSystemDLL
-def isSystemDLL(pathname):
-        if os.path.basename(pathname).lower() in ("msvcp71.dll", "comctl32.dll", "msvcr90.dll", "dwmapi.dll"):
-                return 0
-        return origIsSystemDLL(pathname)
-py2exe.build_exe.isSystemDLL = isSystemDLL
-
-if platform.architecture()[0] == '64bit':
+import shutil
+# Remove the build folder
+shutil.rmtree("build", ignore_errors=True)
+# do the same for dist folder
+shutil.rmtree("dist", ignore_errors=True)
+
+if sys.version_info < (2, 6):
+    origIsSystemDLL = py2exe.build_exe.isSystemDLL
+    def isSystemDLL(pathname):
+            if os.path.basename(pathname).lower() in ("msvcp71.dll", "comctl32.dll"):
+                    return 0
+            return origIsSystemDLL(pathname)
+    py2exe.build_exe.isSystemDLL = isSystemDLL
+
+if platform.architecture()[0] == '64bit' and sys.version_info >= (2, 6):
     manifest = """
        <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
@@ -73,5 +78,50 @@
       """
 else:
-    manifest = """
+    manifest_for_python26 = """
+        <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+        <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+          <assemblyIdentity
+            version="5.0.0.0"
+            processorArchitecture="x86"
+            name="SansView"
+            type="win32">
+          </assemblyIdentity>
+          <description>SansView</description>
+          <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+            <security>
+              <requestedPrivileges>
+                <requestedExecutionLevel
+                  level="asInvoker"
+                  uiAccess="false">
+                </requestedExecutionLevel>
+              </requestedPrivileges>
+            </security>
+          </trustInfo>
+          <dependency>
+            <dependentAssembly>
+              <assemblyIdentity
+                type="win32"
+                name="Microsoft.VC90.CRT"
+                version="9.0.21022.8"
+                processorArchitecture="x86"
+                publicKeyToken="1fc8b3b9a1e18e3b">
+              </assemblyIdentity>
+            </dependentAssembly>
+          </dependency>
+          <dependency>
+            <dependentAssembly>
+              <assemblyIdentity
+                type="win32"
+                name="Microsoft.Windows.Common-Controls"
+                version="6.0.0.0"
+                processorArchitecture="x86"
+                publicKeyToken="6595b64144ccf1df"
+                language="*">
+              </assemblyIdentity>
+            </dependentAssembly>
+          </dependency>
+        </assembly>
+        """
+    manifest_for_python25 = """
        <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
        <assembly xmlns="urn:schemas-microsoft-com:asm.v1"
@@ -99,4 +149,15 @@
       """
 
+# Select the appropriate manifest to use.
+if sys.version_info >= (3, 0) or sys.version_info < (2, 5):
+    print "*** This script only works with Python 2.5, 2.6, or 2.7."
+    sys.exit()
+elif sys.version_info >= (2, 6):
+    manifest = manifest_for_python26
+    from glob import glob
+    py26MSdll = glob(r"C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*.*")
+elif sys.version_info >= (2, 5):
+    manifest = manifest_for_python25
+    py26MSdll = None
     
 class Target:
@@ -177,21 +238,26 @@
     if os.path.split(f)[0].count('.svn')==0:
         data_files.append(('plugins', [f]))
-
-    
-#
+        
+if py26MSdll != None:
+    # install the MSVC 9 runtime dll's into the application folder
+    data_files.append(("Microsoft.VC90.CRT", py26MSdll))
+
 # packages
 #
-
 packages = ['matplotlib', 'scipy', 'pytz', 'encodings']
 includes = ['site']
 
 # Exclude packages that are not needed but are often found on build systems
-excludes = ['PyQt4','sip'] 
-
-dll_excludes = [
-    'libgdk_pixbuf-2.0-0.dll', 
-    'libgobject-2.0-0.dll',
-    'libgdk-win32-2.0-0.dll',
-    ]
+excludes = ['Tkinter', 'PyQt4', '_ssl', '_tkagg', 'sip']
+
+dll_excludes = ['libgdk_pixbuf-2.0-0.dll',
+                'libgobject-2.0-0.dll',
+                'libgdk-win32-2.0-0.dll',
+                'tcl84.dll',
+                'tk84.dll',
+                'QtGui4.dll',
+                'QtCore4.dll',
+                'w9xpopen.exe',
+                'cygwin1.dll']
 
 target_wx_client = Target(
