Index: sansview/installer_generator.py
===================================================================
--- sansview/installer_generator.py	(revision f5f257be71551b07204f6b3672aeab581c3b4e2e)
+++ sansview/installer_generator.py	(revision 7f291a36c1925403c69ff84faa522d59c928a230)
@@ -1,4 +1,4 @@
 """
-this module generate .ss file according to the local config of
+This module generates .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.
@@ -10,11 +10,15 @@
 REG_PROGRAM = """{app}\MYPROG.EXE"" ""%1"""
 APPLICATION = str(local_config.__appname__ )+ '.exe'
-AppName  = str(local_config.__appname__ ) + '-'+ str(local_config.__version__)
+AppName  = str(local_config.__appname__ ) # + '-'+ str(local_config.__version__)
 AppVerName = str(local_config.__appname__ ) + '-'+ str(local_config.__version__)
+Dev = ''
+if AppVerName.lower().count('dev') > 0:
+    Dev = '-Dev'
 AppPublisher = local_config._copyright
 AppPublisherURL = local_config._homepage
 AppSupportURL = local_config._homepage
 AppUpdatesURL = local_config._homepage
-DefaultDirName = os.path.join("{pf}" , AppVerName) 
+ChangesEnvironment = 'true'
+DefaultDirName = os.path.join("{pf}" , AppName+Dev) 
 DefaultGroupName = os.path.join(local_config.DefaultGroupName, AppVerName)
                                 
@@ -87,4 +91,5 @@
         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)
@@ -93,5 +98,22 @@
         msg += """ValueData: \"""{app}\%s""  ""%s1\"""\n"""% (str(APPLICATION),
                                                               str('%'))
-
+        
+        #SANSVIEWPATH
+        msg += """Root: HKCU; Subkey: "%s";\t"""  %  str('Environment')
+        msg += """ValueType: %s; """ % str('expandsz')
+        msg += """ValueName: "%s";\t""" % str('SANSVIEWPATH') 
+        msg += """ValueData: "{app}";\t"""
+        msg += """ Flags: %s""" % str('uninsdeletevalue')
+        msg += "\n"
+        
+        #PATH
+        msg += """; Write to PATH (below) is disabled; need more work\n"""
+        msg += """;Root: HKCU; Subkey: "%s";\t"""  %  str('Environment')
+        msg += """ValueType: %s; """ % str('expandsz')
+        msg += """ValueName: "%s";\t""" % str('PATH') 
+        msg += """ValueData: "%s;{olddata}";\t""" % str('%SANSVIEWPATH%')
+        msg += """ Check: %s""" % str('NeedsAddPath()')
+        msg += "\n"
+        
     return msg
 
@@ -156,4 +178,44 @@
     msg += """Description: "{cm:LaunchProgram, %s}";\t""" %str(AppName) 
     msg += """Flags: nowait postinstall skipifsilent\n"""
+    return msg
+
+def write_code():
+    """
+    Code that checks the existing path and snaviewpath 
+    in the environmental viriables/PATH
+    """
+    msg = """\n\n[Code]\n"""
+    msg += """function NeedsAddPath(): boolean;\n""" 
+    msg += """var\n""" 
+    msg += """  oldpath: string;\n"""
+    msg += """  newpath: string;\n""" 
+    msg += """  pathArr:    TArrayOfString;\n""" 
+    msg += """  i:        Integer;\n""" 
+    msg += """begin\n""" 
+    msg += """  RegQueryStringValue(HKEY_CURRENT_USER,'Environment',"""
+    msg += """'PATH', oldpath)\n"""
+    msg += """  oldpath := oldpath + ';';\n"""
+    msg += """  newpath := '%SANSVIEWPATH%';\n"""
+    msg += """  i := 0;\n"""
+    msg += """  while (Pos(';', oldpath) > 0) do begin\n"""
+    msg += """    SetArrayLength(pathArr, i+1);\n"""
+    msg += """    pathArr[i] := Copy(oldpath, 0, Pos(';', oldpath)-1);\n"""
+    msg += """    oldpath := Copy(oldpath, Pos(';', oldpath)+1,"""
+    msg += """ Length(oldpath));\n"""
+    msg += """    i := i + 1;\n"""
+    msg += """    // Check if current directory matches app dir\n"""
+    msg += """    if newpath = pathArr[i-1] \n"""
+    msg += """    then begin\n"""
+    msg += """      Result := False;\n"""
+    msg += """      exit;\n"""
+    msg += """    end;\n"""
+    msg += """  end;\n"""
+    msg += """  Result := True;\n"""
+    msg += """end;\n"""
+    msg += """\n"""
+    
+    
+    
+    
     return msg
 
@@ -171,4 +233,5 @@
     TEMPLATE += "AppSupportURL=%s\n" % str(AppSupportURL)
     TEMPLATE += "AppUpdatesURL=%s \n" % str(AppUpdatesURL)
+    TEMPLATE += "ChangesEnvironment=%s \n" % str(ChangesEnvironment)
     TEMPLATE += "DefaultDirName=%s\n" % str(DefaultDirName)
     TEMPLATE += "DefaultGroupName=%s\n" % str(DefaultGroupName)
@@ -187,4 +250,5 @@
     TEMPLATE += write_icon()
     TEMPLATE += write_run()
+    TEMPLATE += write_code()
     path = '%s.iss' % str(INSTALLER_FILE)
     f = open(path,'w') 
Index: sansview/installer_new.iss
===================================================================
--- sansview/installer_new.iss	(revision 4356634009d105a3467530d559f8fb4948a215b3)
+++ sansview/installer_new.iss	(revision 7f291a36c1925403c69ff84faa522d59c928a230)
@@ -7,12 +7,13 @@
 
 ChangesAssociations=yes
-AppName=SansView-1.9.1
-AppVerName=SansView-1.9.1
+AppName=SansView
+AppVerName=SansView-1.9.2dev_JUN
 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-1.9.1
-DefaultGroupName=DANSE\SansView-1.9.1
+ChangesEnvironment=true 
+DefaultDirName={pf}\SansView-Dev
+DefaultGroupName=DANSE\SansView-1.9.2dev_JUN
 DisableProgramGroupPage=yes
 LicenseFile=license.txt
@@ -37,4 +38,7 @@
 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"""
+Root: HKCU; Subkey: "Environment";	ValueType: expandsz; ValueName: "SANSVIEWPATH";	ValueData: "{app}";	 Flags: uninsdeletevalue
+; Write to PATH (below) is disabled; need more work
+;Root: HKCU; Subkey: "Environment";	ValueType: expandsz; ValueName: "PATH";	ValueData: "%SANSVIEWPATH%;{olddata}";	 Check: NeedsAddPath()
 
 
@@ -55,9 +59,38 @@
 
 [Icons]
-Name: "{group}\SansView-1.9.1";	Filename: "{app}\SansView.exe";	WorkingDir: "{app}" 
-Name: "{group}\{cm:UninstallProgram, SansView-1.9.1}";	 Filename: "{uninstallexe}" 
-Name: "{commondesktop}\SansView-1.9.1";	Filename: "{app}\SansView.exe";	Tasks: desktopicon; WorkingDir: "{app}" 
+Name: "{group}\SansView";	Filename: "{app}\SansView.exe";	WorkingDir: "{app}" 
+Name: "{group}\{cm:UninstallProgram, SansView}";	 Filename: "{uninstallexe}" 
+Name: "{commondesktop}\SansView-1.9.2dev_JUN";	Filename: "{app}\SansView.exe";	Tasks: desktopicon; WorkingDir: "{app}" 
 
 
 [Run]
-Filename: "{app}\SansView.exe";	Description: "{cm:LaunchProgram, SansView-1.9.1}";	Flags: nowait postinstall skipifsilent
+Filename: "{app}\SansView.exe";	Description: "{cm:LaunchProgram, SansView}";	Flags: nowait postinstall skipifsilent
+
+
+[Code]
+function NeedsAddPath(): boolean;
+var
+  oldpath: string;
+  newpath: string;
+  pathArr:    TArrayOfString;
+  i:        Integer;
+begin
+  RegQueryStringValue(HKEY_CURRENT_USER,'Environment','PATH', oldpath)
+  oldpath := oldpath + ';';
+  newpath := '%SANSVIEWPATH%';
+  i := 0;
+  while (Pos(';', oldpath) > 0) do begin
+    SetArrayLength(pathArr, i+1);
+    pathArr[i] := Copy(oldpath, 0, Pos(';', oldpath)-1);
+    oldpath := Copy(oldpath, Pos(';', oldpath)+1, Length(oldpath));
+    i := i + 1;
+    // Check if current directory matches app dir
+    if newpath = pathArr[i-1] 
+    then begin
+      Result := False;
+      exit;
+    end;
+  end;
+  Result := True;
+end;
+
Index: sansview/local_config.py
===================================================================
--- sansview/local_config.py	(revision 4356634009d105a3467530d559f8fb4948a215b3)
+++ sansview/local_config.py	(revision 7f291a36c1925403c69ff84faa522d59c928a230)
@@ -7,5 +7,5 @@
 # Version of the application
 __appname__ = "SansView"
-__version__ = '1.9.1'
+__version__ = '1.9.2dev_JUN'
 __download_page__ = 'http://danse.chem.utk.edu'
 __update_URL__ = 'http://danse.chem.utk.edu/sansview_version.php'
@@ -65,5 +65,5 @@
 SPLASH_SCREEN_WIDTH = 512
 SPLASH_SCREEN_HEIGHT = 366
-SS_MAX_DISPLAY_TIME = 5000 #5 sec
+SS_MAX_DISPLAY_TIME = 6000 #6 sec
 WELCOME_PANEL_SHOW = False
 CLEANUP_PLOT = False
