- Timestamp:
- Aug 16, 2011 5:41:03 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:
- 7625f49
- Parents:
- 05e5a5d
- Location:
- sansview
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/installer_generator.py
rfa597990 r50282f8 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__ ) 13 13 AppVerName = str(local_config.__appname__ )+'-'+ str(local_config.__version__) 14 14 Dev = '' … … 31 31 PrivilegesRequired = 'none' 32 32 INSTALLER_FILE = 'installer_new' 33 #find extension for windows file assocation34 #extension list need to be modified for each application35 33 36 34 icon_path = local_config.icon_path … … 42 40 Describe the extensions that can be read by the current application 43 41 """ 42 list_data = [] 43 list_app =[] 44 44 try: 45 list = []45 46 46 #(ext, type, name, flags) 47 47 from sans.dataloader.loader import Loader … … 50 50 #['All (*.*)|*.*'] 51 51 file_type, ext = string.split(item, "|*", 1) 52 if ext.strip() not in ['.*', ''] and ext.strip() not in list :53 list .append((ext, 'string', file_type))52 if ext.strip() not in ['.*', ''] and ext.strip() not in list_data: 53 list_data.append((ext, 'string', file_type)) 54 54 except: 55 55 pass 56 56 try: 57 57 file_type, ext = string.split(local_config.APPLICATION_WLIST, "|*", 1) 58 if ext.strip() not in ['.', ''] and ext.strip() not in list :59 list .append((ext, 'string', file_type))58 if ext.strip() not in ['.', ''] and ext.strip() not in list_app: 59 list_app.append((ext, 'string', file_type)) 60 60 except: 61 61 pass … … 63 63 for item in local_config.PLUGINS_WLIST: 64 64 file_type, ext = string.split(item, "|*", 1) 65 if ext.strip() not in ['.', ''] and ext.strip() not in list :66 list .append((ext, 'string', file_type))65 if ext.strip() not in ['.', ''] and ext.strip() not in list_app: 66 list_app.append((ext, 'string', file_type)) 67 67 except: 68 68 pass 69 return list 70 EXTENSION = find_extension()71 72 def write_registry( extension=None):69 return list_data, list_app 70 DATA_EXTENSION, APP_EXTENSION = find_extension() 71 72 def write_registry(data_extension=None, app_extension=None): 73 73 """ 74 74 create file association for windows. … … 76 76 """ 77 77 msg = "" 78 if extension is not None and extension: 78 if data_extension is not None and data_extension: 79 openwithlist = "OpenWithList\%s" % str(APPLICATION) 79 80 msg = "\n\n[Registry]\n" 80 for (ext, type, _) in extension: 81 for (ext, type, _) in data_extension: 82 list = os.path.join(ext, openwithlist) 83 msg += """Root: HKCR;\tSubkey: "%s";\t""" % str(list) 84 msg += """ Flags: %s""" % str('uninsdeletekey noerror') 85 msg += "\n" 86 #list the file on right-click 87 msg += """Root: HKCR; Subkey: "applications\%s\shell\open\command";\t"""\ 88 % str(APPLICATION) 89 msg += """ValueType: %s; """ % str('string') 90 msg += """ValueName: "%s";\t""" %str('') 91 msg += """ValueData: \"""{app}\%s"" ""%s1\"""; \t"""% (str(APPLICATION), 92 str('%')) 93 msg += """ Flags: %s""" % str('uninsdeletevalue noerror') 94 msg += "\n" 95 user_list = "Software\Classes" 96 for (ext, type, _) in data_extension: 97 list = os.path.join(user_list, ext, openwithlist) 98 msg += """Root: HKCU;\tSubkey: "%s";\t""" % str(list) 99 msg += """ Flags: %s""" % str('uninsdeletekey noerror') 100 msg += "\n" 101 #list the file on right-click 102 user_list = os.path.join("Software", "Classes", "applications") 103 msg += """Root: HKCR; Subkey: "%s\%s\shell\open\command";\t"""\ 104 % (str(user_list), str(APPLICATION)) 105 msg += """ValueType: %s; """ % str('string') 106 msg += """ValueName: "%s";\t""" %str('') 107 msg += """ValueData: \"""{app}\%s"" ""%s1\"""; \t"""% (str(APPLICATION), 108 str('%')) 109 msg += """ Flags: %s""" % str('uninsdeletevalue noerror') 110 msg += "\n" 111 if app_extension is not None and app_extension: 112 for (ext, type, _) in app_extension: 81 113 msg += """Root: HKCR;\tSubkey: "%s";\t""" % str(ext) 82 114 msg += """ValueType: %s;\t""" % str(type) … … 89 121 msg += """ Flags: %s""" % str('uninsdeletevalue') 90 122 msg += "\n" 91 92 #create default icon93 msg += """Root: HKCR; Subkey: "{app}\%s";\t""" % str(SetupIconFile)94 msg += """ValueType: %s; """ % str('string')95 msg += """ValueName: "%s";\t""" % str('')96 msg += """ValueData: "{app}\%s,0"\n""" % str(APPLICATION)123 msg += """Root: HKCR; Subkey: "{app}\%s";\t""" % str(APPLICATION) 124 msg += """ValueType: %s; """ % str('string') 125 msg += """ValueName: "%s";\t""" % str('') 126 msg += """ValueData: "{app}\%s";\t""" % str("SansView File") 127 msg += """ Flags: %s \t""" % str("uninsdeletekey") 128 msg += "\n" 97 129 98 #execute the file on double-click 99 msg += """Root: HKCR; Subkey: "{app}\%s\shell\open\command";\t""" % str(APPLICATION) 100 msg += """ValueType: %s; """ % str('string') 101 msg += """ValueName: "%s";\t""" %str('') 102 msg += """ValueData: \"""{app}\%s"" ""%s1\"""\n"""% (str(APPLICATION), 103 str('%')) 104 105 #SANSVIEWPATH 106 msg += """Root: HKLM; Subkey: "%s";\t""" % str('SYSTEM\CurrentControlSet\Control\Session Manager\Environment') 107 msg += """ValueType: %s; """ % str('expandsz') 108 msg += """ValueName: "%s";\t""" % str('SANSVIEWPATH') 109 msg += """ValueData: "{app}";\t""" 110 msg += """ Flags: %s""" % str('uninsdeletevalue') 111 msg += "\n" 112 113 #PATH 114 msg += """; Write to PATH (below) is disabled; need more work\n""" 115 msg += """;Root: HKCU; Subkey: "%s";\t""" % str('Environment') 116 msg += """ValueType: %s; """ % str('expandsz') 117 msg += """ValueName: "%s";\t""" % str('PATH') 118 msg += """ValueData: "%s;{olddata}";\t""" % str('%SANSVIEWPATH%') 119 msg += """ Check: %s""" % str('NeedsAddPath()') 120 msg += "\n" 130 #execute the file on double-click 131 msg += """Root: HKCR; Subkey: "{app}\%s\shell\open\command";\t""" % str(APPLICATION) 132 msg += """ValueType: %s; """ % str('string') 133 msg += """ValueName: "%s";\t""" %str('') 134 msg += """ValueData: \"""{app}\%s"" ""%s1\""";\t"""% (str(APPLICATION), 135 str('%')) 136 msg += """ Flags: %s \t""" % str("uninsdeletevalue noerror") 137 msg += "\n" 138 #create default icon 139 msg += """Root: HKCR; Subkey: "{app}\%s";\t""" % str(SetupIconFile) 140 msg += """ValueType: %s; """ % str('string') 141 msg += """ValueName: "%s";\t""" % str('') 142 msg += """ValueData: "{app}\%s,0"\n""" % str(APPLICATION) 143 144 145 #SANSVIEWPATH 146 msg += """Root: HKLM; Subkey: "%s";\t""" % str('SYSTEM\CurrentControlSet\Control\Session Manager\Environment') 147 msg += """ValueType: %s; """ % str('expandsz') 148 msg += """ValueName: "%s";\t""" % str('SANSVIEWPATH') 149 msg += """ValueData: "{app}";\t""" 150 msg += """ Flags: %s""" % str('uninsdeletevalue') 151 msg += "\n" 152 153 #PATH 154 msg += """; Write to PATH (below) is disabled; need more tests\n""" 155 msg += """;Root: HKCU; Subkey: "%s";\t""" % str('Environment') 156 msg += """ValueType: %s; """ % str('expandsz') 157 msg += """ValueName: "%s";\t""" % str('PATH') 158 msg += """ValueData: "%s;{olddata}";\t""" % str('%SANSVIEWPATH%') 159 msg += """ Check: %s""" % str('NeedsAddPath()') 160 msg += "\n" 121 161 122 162 return msg … … 143 183 return msg 144 184 145 path, _ = os.path.split(os.getcwd()) 146 dist_path = os.path.join(path, "scripts", "dist") 185 dist_path = "dist" 147 186 def write_file(): 148 187 """ … … 154 193 msg += """Source: "dist\*";\tDestDir: "{app}";\t""" 155 194 msg += """Flags: ignoreversion recursesubdirs createallsubdirs\n""" 156 msg += """Source: "%s\*";\tDestDir: "{app}\%s";\t""" % ( icon_path, str("images"))195 msg += """Source: "%s\*";\tDestDir: "{app}\%s";\t""" % (str(icon_path), str("images")) 157 196 msg += """Flags: ignoreversion recursesubdirs createallsubdirs\n""" 158 msg += """Source: "%s\*";\tDestDir: "{app}\%s";\t""" % (test_path, str("test")) 197 msg += """Source: "%s\*";\tDestDir: "{app}\%s";\t""" % (str(test_path), str("test")) 198 msg += """Flags: ignoreversion recursesubdirs createallsubdirs\n""" 199 msg += """Source: "%s\*";\tDestDir: "{app}\%s";\t""" % (str(media_path), str("media")) 159 200 msg += """Flags: ignoreversion recursesubdirs createallsubdirs\n""" 160 201 msg += """;\tNOTE: Don't use "Flags: ignoreversion" on any shared system files""" … … 250 291 TEMPLATE += "PrivilegesRequired=%s\n" % str(PrivilegesRequired) 251 292 252 TEMPLATE += write_registry(extension=EXTENSION) 293 TEMPLATE += write_registry(data_extension=DATA_EXTENSION, 294 app_extension=APP_EXTENSION) 253 295 TEMPLATE += write_language() 254 296 TEMPLATE += write_tasks() -
sansview/installer_new.iss
rd4c19e5 r50282f8 26 26 27 27 [Registry] 28 Root: HKCR; Subkey: ".txt\openwithlist\SansView.exe"; Flags: uninsdeletekey noerror 29 Root: HKCR; Subkey: ".xml\openwithlist\SansView.exe"; Flags: uninsdeletekey noerror 30 Root: HKCR; Subkey: ".tif\openwithlist\SansView.exe"; Flags: uninsdeletekey noerror 31 Root: HKCR; Subkey: ".tiff\openwithlist\SansView.exe"; Flags: uninsdeletekey noerror 32 Root: HKCR; Subkey: ".asc\openwithlist\SansView.exe"; Flags: uninsdeletekey noerror 33 Root: HKCR; Subkey: ".dat\openwithlist\SansView.exe"; Flags: uninsdeletekey noerror 34 Root: HKCR; Subkey: ".sans\openwithlist\SansView.exe"; Flags: uninsdeletekey noerror 35 Root: HKCR; Subkey: "applications\SansView.exe\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\SansView.exe"" ""%1""" ; Flags: uninsdeletevalue noerror 36 Root: HKCU; Subkey: "Software\Classes\.txt\OpenWithList\SansView.exe"; Flags: uninsdeletekey noerror 37 Root: HKCU; Subkey: "Software\Classes\.xml\openwithlist\SansView.exe"; Flags: uninsdeletekey noerror 38 Root: HKCU; Subkey: "Software\Classes\.asc\openwithlist\SansView.exe"; Flags: uninsdeletekey noerror 39 Root: HKCU; Subkey: "Software\Classes\.dat\openwithlist\SansView.exe"; Flags: uninsdeletekey noerror 40 Root: HKCU; Subkey: "Software\Classes\.tif\openwithlist\SansView.exe"; Flags: uninsdeletekey noerror 41 Root: HKCU; Subkey: "Software\Classes\.tiff\openwithlist\SansView.exe"; Flags: uninsdeletekey noerror 42 Root: HKCU; Subkey: "Software\Classes\.sans\openwithlist\SansView.exe"; Flags: uninsdeletekey noerror 43 Root: HKCU; Subkey: "Software\Classes\applications\SansView.exe\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\SansView.exe"" ""%1""" ; Flags: uninsdeletevalue noerror 28 Root: HKCR; Subkey: ".xml\OpenWithList\SansView.exe"; Flags: uninsdeletekey noerror 29 Root: HKCR; Subkey: ".txt\OpenWithList\SansView.exe"; Flags: uninsdeletekey noerror 30 Root: HKCR; Subkey: ".asc\OpenWithList\SansView.exe"; Flags: uninsdeletekey noerror 31 Root: HKCR; Subkey: ".dat\OpenWithList\SansView.exe"; Flags: uninsdeletekey noerror 32 Root: HKCR; Subkey: ".tif\OpenWithList\SansView.exe"; Flags: uninsdeletekey noerror 33 Root: HKCR; Subkey: ".abs\OpenWithList\SansView.exe"; Flags: uninsdeletekey noerror 34 Root: HKCR; Subkey: ".d1d\OpenWithList\SansView.exe"; Flags: uninsdeletekey noerror 35 Root: HKCR; Subkey: ".sans\OpenWithList\SansView.exe"; Flags: uninsdeletekey noerror 36 Root: HKCR; Subkey: "applications\SansView.exe\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\SansView.exe"" ""%1"""; Flags: uninsdeletevalue noerror 37 Root: HKCU; Subkey: "Software\Classes\.xml\OpenWithList\SansView.exe"; Flags: uninsdeletekey noerror 38 Root: HKCU; Subkey: "Software\Classes\.txt\OpenWithList\SansView.exe"; Flags: uninsdeletekey noerror 39 Root: HKCU; Subkey: "Software\Classes\.asc\OpenWithList\SansView.exe"; Flags: uninsdeletekey noerror 40 Root: HKCU; Subkey: "Software\Classes\.dat\OpenWithList\SansView.exe"; Flags: uninsdeletekey noerror 41 Root: HKCU; Subkey: "Software\Classes\.tif\OpenWithList\SansView.exe"; Flags: uninsdeletekey noerror 42 Root: HKCU; Subkey: "Software\Classes\.abs\OpenWithList\SansView.exe"; Flags: uninsdeletekey noerror 43 Root: HKCU; Subkey: "Software\Classes\.d1d\OpenWithList\SansView.exe"; Flags: uninsdeletekey noerror 44 Root: HKCU; Subkey: "Software\Classes\.sans\OpenWithList\SansView.exe"; Flags: uninsdeletekey noerror 45 Root: HKCR; Subkey: "Software\Classes\applications\SansView.exe\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\SansView.exe"" ""%1"""; Flags: uninsdeletevalue noerror 44 46 Root: HKCR; Subkey: ".svs"; ValueType: string; ValueName: ""; ValueData: "{app}\SansView.exe"; Flags: uninsdeletevalue 45 Root: HKCR; Subkey: ".fitv"; 47 Root: HKCR; Subkey: ".fitv"; ValueType: string; ValueName: ""; ValueData: "{app}\SansView.exe"; Flags: uninsdeletevalue 46 48 Root: HKCR; Subkey: ".inv"; ValueType: string; ValueName: ""; ValueData: "{app}\SansView.exe"; Flags: uninsdeletevalue 47 49 Root: HKCR; Subkey: ".prv"; ValueType: string; ValueName: ""; ValueData: "{app}\SansView.exe"; Flags: uninsdeletevalue 48 Root: HKCR; Subkey: "{app}\SansView.exe"; ValueType: string; ValueName: ""; ValueData: "SansView File"; Flags: uninsdeletekey49 Root: HKCR; Subkey: "{app}\SansView.exe\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\SansView.exe"" ""%1""" ; Flags: uninsdeletevalue noerror50 Root: HKCR; Subkey: "{app}\SansView.exe"; ValueType: string; ValueName: ""; ValueData: "{app}\SansView File"; Flags: uninsdeletekey 51 Root: HKCR; Subkey: "{app}\SansView.exe\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\SansView.exe"" ""%1"""; Flags: uninsdeletevalue noerror 50 52 Root: HKCR; Subkey: "{app}\images\ball.ico"; ValueType: string; ValueName: ""; ValueData: "{app}\SansView.exe,0" 51 53 Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: expandsz; ValueName: "SANSVIEWPATH"; ValueData: "{app}"; Flags: uninsdeletevalue 52 ; Write to PATH (below) is disabled; need more work54 ; Write to PATH (below) is disabled; need more tests 53 55 ;Root: HKCU; Subkey: "Environment"; ValueType: expandsz; ValueName: "PATH"; ValueData: "%SANSVIEWPATH%;{olddata}"; Check: NeedsAddPath() 54 56 … … 62 64 63 65 64 65 66 [Files] 66 67 Source: "dist\SansView.exe"; DestDir: "{app}"; Flags: ignoreversion 67 68 Source: "dist\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs 68 69 Source: "images\*"; DestDir: "{app}\images"; Flags: ignoreversion recursesubdirs createallsubdirs 70 Source: "test\*"; DestDir: "{app}\test"; Flags: ignoreversion recursesubdirs createallsubdirs 69 71 Source: "media\*"; DestDir: "{app}\media"; Flags: ignoreversion recursesubdirs createallsubdirs 70 Source: "test\*"; DestDir: "{app}\test"; Flags: ignoreversion recursesubdirs createallsubdirs71 72 ; NOTE: Don't use "Flags: ignoreversion" on any shared system files 72 73 -
sansview/local_config.py
r8e3dc19 r50282f8 37 37 _license = "mailto:sansdanse@gmail.com" 38 38 39 path = os.getcwd() 40 icon_path = os.path.join(path, "images")41 media_path = os.path.join(path, "media")42 test_path = os.path.join(path, "test")39 40 icon_path = "images" 41 media_path = "media" 42 test_path = "test" 43 43 44 44 _nsf_logo = os.path.join(icon_path, "nsf_logo.png")
Note: See TracChangeset
for help on using the changeset viewer.