Changeset 7f291a3 in sasview
- Timestamp:
- Jul 14, 2011 4:26:17 PM (13 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 19b5c5c9
- Parents:
- e5df560
- Location:
- sansview
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/installer_generator.py
rf5f257b r7f291a3 1 1 """ 2 this module generate.ss file according to the local config of2 This module generates .ss file according to the local config of 3 3 the current application. Please make sure a file named "local_config.py" 4 4 exists in the current directory. Edit local_config.py according to your needs. … … 10 10 REG_PROGRAM = """{app}\MYPROG.EXE"" ""%1""" 11 11 APPLICATION = str(local_config.__appname__ )+ '.exe' 12 AppName = str(local_config.__appname__ ) + '-'+ str(local_config.__version__)12 AppName = str(local_config.__appname__ ) # + '-'+ str(local_config.__version__) 13 13 AppVerName = str(local_config.__appname__ ) + '-'+ str(local_config.__version__) 14 Dev = '' 15 if AppVerName.lower().count('dev') > 0: 16 Dev = '-Dev' 14 17 AppPublisher = local_config._copyright 15 18 AppPublisherURL = local_config._homepage 16 19 AppSupportURL = local_config._homepage 17 20 AppUpdatesURL = local_config._homepage 18 DefaultDirName = os.path.join("{pf}" , AppVerName) 21 ChangesEnvironment = 'true' 22 DefaultDirName = os.path.join("{pf}" , AppName+Dev) 19 23 DefaultGroupName = os.path.join(local_config.DefaultGroupName, AppVerName) 20 24 … … 87 91 msg += """ValueName: "%s";\t""" % str('') 88 92 msg += """ValueData: "{app}\%s,0"\n""" % str(APPLICATION) 93 89 94 #execute the file on double-click 90 95 msg += """Root: HKCR; Subkey: "{app}\%s\shell\open\command";\t""" % str(APPLICATION) … … 93 98 msg += """ValueData: \"""{app}\%s"" ""%s1\"""\n"""% (str(APPLICATION), 94 99 str('%')) 95 100 101 #SANSVIEWPATH 102 msg += """Root: HKCU; Subkey: "%s";\t""" % str('Environment') 103 msg += """ValueType: %s; """ % str('expandsz') 104 msg += """ValueName: "%s";\t""" % str('SANSVIEWPATH') 105 msg += """ValueData: "{app}";\t""" 106 msg += """ Flags: %s""" % str('uninsdeletevalue') 107 msg += "\n" 108 109 #PATH 110 msg += """; Write to PATH (below) is disabled; need more work\n""" 111 msg += """;Root: HKCU; Subkey: "%s";\t""" % str('Environment') 112 msg += """ValueType: %s; """ % str('expandsz') 113 msg += """ValueName: "%s";\t""" % str('PATH') 114 msg += """ValueData: "%s;{olddata}";\t""" % str('%SANSVIEWPATH%') 115 msg += """ Check: %s""" % str('NeedsAddPath()') 116 msg += "\n" 117 96 118 return msg 97 119 … … 156 178 msg += """Description: "{cm:LaunchProgram, %s}";\t""" %str(AppName) 157 179 msg += """Flags: nowait postinstall skipifsilent\n""" 180 return msg 181 182 def write_code(): 183 """ 184 Code that checks the existing path and snaviewpath 185 in the environmental viriables/PATH 186 """ 187 msg = """\n\n[Code]\n""" 188 msg += """function NeedsAddPath(): boolean;\n""" 189 msg += """var\n""" 190 msg += """ oldpath: string;\n""" 191 msg += """ newpath: string;\n""" 192 msg += """ pathArr: TArrayOfString;\n""" 193 msg += """ i: Integer;\n""" 194 msg += """begin\n""" 195 msg += """ RegQueryStringValue(HKEY_CURRENT_USER,'Environment',""" 196 msg += """'PATH', oldpath)\n""" 197 msg += """ oldpath := oldpath + ';';\n""" 198 msg += """ newpath := '%SANSVIEWPATH%';\n""" 199 msg += """ i := 0;\n""" 200 msg += """ while (Pos(';', oldpath) > 0) do begin\n""" 201 msg += """ SetArrayLength(pathArr, i+1);\n""" 202 msg += """ pathArr[i] := Copy(oldpath, 0, Pos(';', oldpath)-1);\n""" 203 msg += """ oldpath := Copy(oldpath, Pos(';', oldpath)+1,""" 204 msg += """ Length(oldpath));\n""" 205 msg += """ i := i + 1;\n""" 206 msg += """ // Check if current directory matches app dir\n""" 207 msg += """ if newpath = pathArr[i-1] \n""" 208 msg += """ then begin\n""" 209 msg += """ Result := False;\n""" 210 msg += """ exit;\n""" 211 msg += """ end;\n""" 212 msg += """ end;\n""" 213 msg += """ Result := True;\n""" 214 msg += """end;\n""" 215 msg += """\n""" 216 217 218 219 158 220 return msg 159 221 … … 171 233 TEMPLATE += "AppSupportURL=%s\n" % str(AppSupportURL) 172 234 TEMPLATE += "AppUpdatesURL=%s \n" % str(AppUpdatesURL) 235 TEMPLATE += "ChangesEnvironment=%s \n" % str(ChangesEnvironment) 173 236 TEMPLATE += "DefaultDirName=%s\n" % str(DefaultDirName) 174 237 TEMPLATE += "DefaultGroupName=%s\n" % str(DefaultGroupName) … … 187 250 TEMPLATE += write_icon() 188 251 TEMPLATE += write_run() 252 TEMPLATE += write_code() 189 253 path = '%s.iss' % str(INSTALLER_FILE) 190 254 f = open(path,'w') -
sansview/installer_new.iss
r4356634 r7f291a3 7 7 8 8 ChangesAssociations=yes 9 AppName=SansView -1.9.110 AppVerName=SansView-1.9. 19 AppName=SansView 10 AppVerName=SansView-1.9.2dev_JUN 11 11 AppPublisher=(c) 2009, University of Tennessee 12 12 AppPublisherURL=http://danse.chem.utk.edu 13 13 AppSupportURL=http://danse.chem.utk.edu 14 14 AppUpdatesURL=http://danse.chem.utk.edu 15 DefaultDirName={pf}\SansView-1.9.1 16 DefaultGroupName=DANSE\SansView-1.9.1 15 ChangesEnvironment=true 16 DefaultDirName={pf}\SansView-Dev 17 DefaultGroupName=DANSE\SansView-1.9.2dev_JUN 17 18 DisableProgramGroupPage=yes 18 19 LicenseFile=license.txt … … 37 38 Root: HKCR; Subkey: "{app}\images\ball.ico"; ValueType: string; ValueName: ""; ValueData: "{app}\SansView.exe,0" 38 39 Root: HKCR; Subkey: "{app}\SansView.exe\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\SansView.exe"" ""%1""" 40 Root: HKCU; Subkey: "Environment"; ValueType: expandsz; ValueName: "SANSVIEWPATH"; ValueData: "{app}"; Flags: uninsdeletevalue 41 ; Write to PATH (below) is disabled; need more work 42 ;Root: HKCU; Subkey: "Environment"; ValueType: expandsz; ValueName: "PATH"; ValueData: "%SANSVIEWPATH%;{olddata}"; Check: NeedsAddPath() 39 43 40 44 … … 55 59 56 60 [Icons] 57 Name: "{group}\SansView -1.9.1"; Filename: "{app}\SansView.exe"; WorkingDir: "{app}"58 Name: "{group}\{cm:UninstallProgram, SansView -1.9.1}"; Filename: "{uninstallexe}"59 Name: "{commondesktop}\SansView-1.9. 1"; Filename: "{app}\SansView.exe"; Tasks: desktopicon; WorkingDir: "{app}"61 Name: "{group}\SansView"; Filename: "{app}\SansView.exe"; WorkingDir: "{app}" 62 Name: "{group}\{cm:UninstallProgram, SansView}"; Filename: "{uninstallexe}" 63 Name: "{commondesktop}\SansView-1.9.2dev_JUN"; Filename: "{app}\SansView.exe"; Tasks: desktopicon; WorkingDir: "{app}" 60 64 61 65 62 66 [Run] 63 Filename: "{app}\SansView.exe"; Description: "{cm:LaunchProgram, SansView-1.9.1}"; Flags: nowait postinstall skipifsilent 67 Filename: "{app}\SansView.exe"; Description: "{cm:LaunchProgram, SansView}"; Flags: nowait postinstall skipifsilent 68 69 70 [Code] 71 function NeedsAddPath(): boolean; 72 var 73 oldpath: string; 74 newpath: string; 75 pathArr: TArrayOfString; 76 i: Integer; 77 begin 78 RegQueryStringValue(HKEY_CURRENT_USER,'Environment','PATH', oldpath) 79 oldpath := oldpath + ';'; 80 newpath := '%SANSVIEWPATH%'; 81 i := 0; 82 while (Pos(';', oldpath) > 0) do begin 83 SetArrayLength(pathArr, i+1); 84 pathArr[i] := Copy(oldpath, 0, Pos(';', oldpath)-1); 85 oldpath := Copy(oldpath, Pos(';', oldpath)+1, Length(oldpath)); 86 i := i + 1; 87 // Check if current directory matches app dir 88 if newpath = pathArr[i-1] 89 then begin 90 Result := False; 91 exit; 92 end; 93 end; 94 Result := True; 95 end; 96 -
sansview/local_config.py
r4356634 r7f291a3 7 7 # Version of the application 8 8 __appname__ = "SansView" 9 __version__ = '1.9. 1'9 __version__ = '1.9.2dev_JUN' 10 10 __download_page__ = 'http://danse.chem.utk.edu' 11 11 __update_URL__ = 'http://danse.chem.utk.edu/sansview_version.php' … … 65 65 SPLASH_SCREEN_WIDTH = 512 66 66 SPLASH_SCREEN_HEIGHT = 366 67 SS_MAX_DISPLAY_TIME = 5000 #5sec67 SS_MAX_DISPLAY_TIME = 6000 #6 sec 68 68 WELCOME_PANEL_SHOW = False 69 69 CLEANUP_PLOT = False
Note: See TracChangeset
for help on using the changeset viewer.