Index: sansview/installer.iss
===================================================================
--- sansview/installer.iss	(revision 0d8c8d71eaa5ec1343ffc5b49a468e0092838970)
+++ sansview/installer.iss	(revision b0e8beb0a63e9937fe7353b255d92259630bc76b)
@@ -18,4 +18,5 @@
 SolidCompression=yes
 PrivilegesRequired=none
+
 
 [Languages]
Index: sansview/installer_03_31_2011.iss
===================================================================
--- sansview/installer_03_31_2011.iss	(revision b0e8beb0a63e9937fe7353b255d92259630bc76b)
+++ sansview/installer_03_31_2011.iss	(revision b0e8beb0a63e9937fe7353b255d92259630bc76b)
@@ -0,0 +1,63 @@
+
+; Script generated by the Inno Setup Script Wizard
+
+; and local_config.py located in this directory.
+ ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
+[Setup]
+
+ChangesAssociations = yes
+AppName = SansView-Dev01042011
+AppVerName = SansView-Dev01042011
+AppPublisher = (c) 2009, University of Tennessee
+AppPublisherURL = http://danse.chem.utk.edu
+AppSupportURL = http://danse.chem.utk.edu
+AppUpdatesURL = http://danse.chem.utk.edu 
+DefaultDirName = {pf}\SansView-Dev01042011
+DefaultGroupName = DANSE\SansView-Dev01042011
+DisableProgramGroupPage = yes
+LicenseFile = license.txt
+OutputBaseFilename = setupSansView
+SetupIconFile = images\ball.ico
+Compression = lzma
+SolidCompression = yes
+PrivilegesRequired = none
+
+
+[Registry]
+Root: HKCR;	Subkey: ".xml";	ValueType: string;	ValueName: "";	ValueData: "{app}\SansView.exe";	 Flags: uninsdeletevalue
+Root: HKCR;	Subkey: ".asc";	ValueType: string;	ValueName: "";	ValueData: "{app}\SansView.exe";	 Flags: uninsdeletevalue
+Root: HKCR;	Subkey: ".dat";	ValueType: string;	ValueName: "";	ValueData: "{app}\SansView.exe";	 Flags: uninsdeletevalue
+Root: HKCR;	Subkey: ".tif";	ValueType: string;	ValueName: "";	ValueData: "{app}\SansView.exe";	 Flags: uninsdeletevalue
+Root: HKCR;	Subkey: ".tiff";	ValueType: string;	ValueName: "";	ValueData: "{app}\SansView.exe";	 Flags: uninsdeletevalue
+Root: HKCR;	Subkey: ".sans";	ValueType: string;	ValueName: "";	ValueData: "{app}\SansView.exe";	 Flags: uninsdeletevalue
+Root: HKCR;	Subkey: ".svs";	ValueType: string;	ValueName: "";	ValueData: "{app}\SansView.exe";	 Flags: uninsdeletevalue
+Root: HKCR;	Subkey: ".prv";	ValueType: string;	ValueName: "";	ValueData: "{app}\SansView.exe";	 Flags: uninsdeletevalue
+Root: HKCR;	Subkey: ".fitv";	ValueType: string;	ValueName: "";	ValueData: "{app}\SansView.exe";	 Flags: uninsdeletevalue
+Root: HKCR;	Subkey: ".inv";	ValueType: string;	ValueName: "";	ValueData: "{app}\SansView.exe";	 Flags: uninsdeletevalue
+Root: HKCR; Subkey: "{app}\images\ball.ico";	ValueType: string; ValueName: "";	ValueData: "{app}\SansView.exe,0"
+Root: HKCR; Subkey: "{app}\SansView.exe\shell\open\command";	ValueType: string; ValueName: "";	ValueData: """{app}\SansView.exe""  ""%1"""
+
+
+[Languages]
+Name: "english";	MessagesFile: "compiler:Default.isl"
+
+
+[Tasks]
+Name: "desktopicon";	Description: "{cm:CreateDesktopIcon}";	GroupDescription: "{cm:AdditionalIcons}";	Flags: unchecked
+
+
+[Files]
+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
+;	NOTE: Don't use "Flags: ignoreversion" on any shared system files
+
+[Icons]
+Name: "{group}\SansView-Dev01042011";	Filename: "{app}\SansView.exe";	WorkingDir: "{app}" 
+Name: "{group}\{cm:UninstallProgram, SansView-Dev01042011}";	 Filename: "{uninstallexe}" 
+Name: "{commondesktop}\SansView-Dev01042011";	Filename: "{app}\SansView.exe";	Tasks: desktopicon; WorkingDir: "{app}" 
+
+
+[Run]
+Filename: "{app}\SansView.exe";	Description: "{cm:LaunchProgram, SansView-Dev01042011}";	Flags: nowait postinstall skipifsilent
Index: sansview/installer_generator.py
===================================================================
--- sansview/installer_generator.py	(revision b0e8beb0a63e9937fe7353b255d92259630bc76b)
+++ sansview/installer_generator.py	(revision b0e8beb0a63e9937fe7353b255d92259630bc76b)
@@ -0,0 +1,194 @@
+"""
+this module generate .ss file according to the local config of
+the current application. Please make sure a file named "local_config.py"
+exists in the current directory. Edit local_config.py according to your needs.
+"""
+import local_config
+import os 
+import string
+
+REG_PROGRAM = """{app}\MYPROG.EXE"" ""%1"""
+APPLICATION = str(local_config.__appname__ )+ '.exe'
+AppName  = str(local_config.__appname__ ) + '-'+ str(local_config.__version__)
+AppVerName = str(local_config.__appname__ ) + '-'+ str(local_config.__version__)
+AppPublisher = local_config._copyright
+AppPublisherURL = local_config._homepage
+AppSupportURL = local_config._homepage
+AppUpdatesURL = local_config._homepage
+DefaultDirName = os.path.join("{pf}" , AppVerName) 
+DefaultGroupName = os.path.join(local_config.DefaultGroupName, AppVerName)
+                                
+OutputBaseFilename = local_config.OutputBaseFilename
+SetupIconFile = local_config.SetupIconFile
+LicenseFile = 'license.txt'
+DisableProgramGroupPage = 'yes'
+Compression = 'lzma'
+SolidCompression = 'yes'
+PrivilegesRequired = 'none'
+INSTALLER_FILE = 'installer_03_31_2011'
+#find extension for windows file assocation
+#extension list need to be modified for each application
+
+def find_extension():
+    """
+    Describe the extensions that can be read by the current application
+    """
+    try:
+        list = []
+        #(ext, type, name, flags)
+        from DataLoader.loader import Loader
+        wild_cards = Loader().get_wildcards()
+        for item in wild_cards:
+            #['All (*.*)|*.*']
+            file_type, ext = string.split(item, "|*", 1)
+            if ext.strip() not in ['.*', ''] and ext.strip() not in list:
+                list.append((ext, 'string', file_type))
+    except:
+        pass
+    try:
+        file_type, ext = string.split(local_config.APPLICATION_WLIST, "|*", 1)
+        if ext.strip() not in ['.', ''] and ext.strip() not in list:
+            list.append((ext, 'string', file_type))
+    except:
+        pass
+    try:
+        for item in local_config.PLUGINS_WLIST:
+            file_type, ext = string.split(item, "|*", 1)
+            if ext.strip() not in ['.', ''] and ext.strip() not in list:
+                list.append((ext, 'string', file_type)) 
+    except:
+        pass
+    return list
+EXTENSION = find_extension()
+    
+def write_registry(extension=None):
+    """
+    create file association for windows.
+    Allow open file on double click
+    """
+    msg = ""
+    if extension is not None and extension:
+        msg = "\n\n[Registry]\n"
+        for (ext, type, _) in extension:
+            msg +=  """Root: HKCR;\tSubkey: "%s";\t""" % str(ext)
+            msg += """ValueType: %s;\t""" % str(type)
+            #file type empty set the current application as the default 
+            #reader for this file. change the value of file_type to another
+            #string modify the default reader
+            file_type = ''
+            msg += """ValueName: "%s";\t""" % str('')
+            msg += """ValueData: "{app}\%s";\t""" % str(APPLICATION)
+            msg += """ Flags: %s""" % str('uninsdeletevalue')
+            msg += "\n"
+     
+        #create default icon
+        msg += """Root: HKCR; Subkey: "{app}\%s";\t""" % str(SetupIconFile)
+        msg += """ValueType: %s; """ % str('string')
+        msg += """ValueName: "%s";\t""" % str('') 
+        msg += """ValueData: "{app}\%s,0"\n""" % str(APPLICATION)
+        #execute the file on double-click
+        msg += """Root: HKCR; Subkey: "{app}\%s\shell\open\command";\t"""  %  str(APPLICATION)
+        msg += """ValueType: %s; """ % str('string')
+        msg += """ValueName: "%s";\t""" %str('') 
+        msg += """ValueData: \"""{app}\%s""  ""%s1\"""\n"""% (str(APPLICATION),
+                                                              str('%'))
+
+    return msg
+
+def write_language(language=['english'], msfile="compiler:Default.isl"):  
+    """
+    define the language of the application
+    """ 
+    msg = ''
+    if language:
+        msg = "\n\n[Languages]\n"
+        for lang in language:
+            msg += """Name: "%s";\tMessagesFile: "%s"\n""" % (str(lang), 
+                                                           str(msfile))
+    return msg 
+
+def write_tasks():
+    """
+    create desktop icon
+    """
+    msg = """\n\n[Tasks]\n"""
+    msg += """Name: "desktopicon";\tDescription: "{cm:CreateDesktopIcon}";\t"""
+    msg += """GroupDescription: "{cm:AdditionalIcons}";\tFlags: unchecked\n"""
+    return msg
+
+def write_file():
+    """
+    copy some data files
+    """
+    msg = "\n\n[Files]\n"
+    msg += """Source: "dist\%s";\t""" % str(APPLICATION)
+    msg += """DestDir: "{app}";\tFlags: ignoreversion\n"""
+    msg += """Source: "dist\*";\tDestDir: "{app}";\t"""
+    msg += """Flags: ignoreversion recursesubdirs createallsubdirs\n"""
+    msg += """Source: "images\*";\tDestDir: "{app}\%s";\t""" % str("images")
+    msg += """Flags: ignoreversion recursesubdirs createallsubdirs\n"""
+    msg += """Source: "test\*";\tDestDir: "{app}\%s";\t""" % str("test")
+    msg += """Flags: ignoreversion recursesubdirs createallsubdirs\n"""
+    msg += """;\tNOTE: Don't use "Flags: ignoreversion" on any shared system files"""
+    return msg
+
+def write_icon():
+    """
+    Create application icon
+    """
+    msg = """\n\n[Icons]\n"""
+    msg += """Name: "{group}\%s";\t""" % str(AppName)
+    msg += """Filename: "{app}\%s";\t"""  % str(APPLICATION)
+    msg += """WorkingDir: "{app}" \n"""
+    msg += """Name: "{group}\{cm:UninstallProgram, %s}";\t""" % str(AppName)
+    msg += """ Filename: "{uninstallexe}" \n"""
+    msg += """Name: "{commondesktop}\%s";\t""" % str(AppVerName)
+    msg += """Filename: "{app}\%s";\t""" % str(APPLICATION)
+    msg += """Tasks: desktopicon; WorkingDir: "{app}" \n"""
+    return msg
+
+def write_run():
+    """
+    execute some file
+    """
+    msg = """\n\n[Run]\n"""
+    msg += """Filename: "{app}\%s";\t""" % str(APPLICATION)
+    msg += """Description: "{cm:LaunchProgram, %s}";\t""" %str(AppName) 
+    msg += """Flags: nowait postinstall skipifsilent\n"""
+    return msg
+
+
+if __name__ == "__main__":
+    TEMPLATE = "\n; Script generated by the Inno Setup Script Wizard\n"
+    TEMPLATE += "\n; and local_config.py located in this directory.\n "
+    TEMPLATE += "; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!"
+    TEMPLATE += "\n[Setup]\n\n" 
+    TEMPLATE += "ChangesAssociations = %s\n" %str('yes')
+    TEMPLATE += "AppName = %s\n" % str(AppName)
+    TEMPLATE += "AppVerName = %s\n" % str(AppVerName)
+    TEMPLATE += "AppPublisher = %s\n" % str(AppPublisher)
+    TEMPLATE += "AppPublisherURL = %s\n" % str(AppPublisherURL)
+    TEMPLATE += "AppSupportURL = %s\n" % str(AppSupportURL)
+    TEMPLATE += "AppUpdatesURL = %s \n" % str(AppUpdatesURL)
+    TEMPLATE += "DefaultDirName = %s\n" % str(DefaultDirName)
+    TEMPLATE += "DefaultGroupName = %s\n" % str(DefaultGroupName)
+    TEMPLATE += "DisableProgramGroupPage = %s\n" % str(DisableProgramGroupPage)
+    TEMPLATE += "LicenseFile = %s\n" % str(LicenseFile)
+    TEMPLATE += "OutputBaseFilename = %s\n" % str(OutputBaseFilename)
+    TEMPLATE += "SetupIconFile = %s\n" % str(SetupIconFile)
+    TEMPLATE += "Compression = %s\n" % str(Compression)
+    TEMPLATE += "SolidCompression = %s\n" % str(SolidCompression)
+    TEMPLATE += "PrivilegesRequired = %s\n" % str(PrivilegesRequired)
+   
+    TEMPLATE += write_registry(extension=EXTENSION)
+    TEMPLATE += write_language()
+    TEMPLATE += write_tasks()
+    TEMPLATE += write_file()
+    TEMPLATE += write_icon()
+    TEMPLATE += write_run()
+    path = '%s.iss' % str(INSTALLER_FILE)
+    f = open(path,'w') 
+    f.write(TEMPLATE)
+    f.close()
+    print "Generate Inno setup installer script complete"
+    print "A new file %s.iss should be created.Please refresh your directory" % str(INSTALLER_FILE)
Index: sansview/local_config.py
===================================================================
--- sansview/local_config.py	(revision e0e2c44ffd77f5ac00a7b3ea55c7d11a7e7417cf)
+++ sansview/local_config.py	(revision b0e8beb0a63e9937fe7353b255d92259630bc76b)
@@ -63,4 +63,7 @@
 SPLASH_SCREEN_HEIGHT = 366
 SS_MAX_DISPLAY_TIME = 3000 #3 sec
+SetupIconFile = os.path.join("images", "ball.ico")
+DefaultGroupName = "DANSE"
+OutputBaseFilename = "setupSansView"
 
 
