Changeset 8340
- Timestamp:
- 07/27/12 10:19:22 (12 years ago)
- Location:
- trunk/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Clients.Hive.Slave.App/3.3/HiveSlaveApplication.cs
r7259 r8340 20 20 #endregion 21 21 22 using System.IO;23 22 using System.Threading; 24 23 using System.Windows.Forms; 25 using HeuristicLab.Clients.Hive.SlaveCore.Properties;26 24 using HeuristicLab.Clients.Hive.SlaveCore.Views; 27 25 using HeuristicLab.PluginInfrastructure; … … 32 30 private HeuristicLab.Clients.Hive.SlaveCore.Core core; 33 31 public override void Run() { 34 CheckWorkingDirectories();35 32 36 33 core = new HeuristicLab.Clients.Hive.SlaveCore.Core(); … … 48 45 core.Shutdown(); 49 46 } 50 51 /// <summary>52 /// Normally the configuration file just contains the folder names of the PluginCache and the AppDomain working directory.53 /// This means that these folders are created in the current directory which is ok for the console client and the windows service.54 /// For the HL client we can't do that because the plugin infrastructure gets confused when starting HeuristicLab.55 /// Therefore if there is only a relative path in the config, we change that to the temp path.56 /// </summary>57 void CheckWorkingDirectories() {58 if (!Path.IsPathRooted(Settings.Default.PluginCacheDir)) {59 Settings.Default.PluginCacheDir = Path.Combine(Path.GetTempPath(), Settings.Default.PluginCacheDir);60 Settings.Default.Save();61 }62 63 if (!Path.IsPathRooted(Settings.Default.PluginTempBaseDir)) {64 Settings.Default.PluginTempBaseDir = Path.Combine(Path.GetTempPath(), Settings.Default.PluginTempBaseDir);65 Settings.Default.Save();66 }67 }68 47 } 69 48 } -
trunk/sources/HeuristicLab.Clients.Hive.Slave.WindowsService/3.3/ProjectInstaller.Designer.cs
r6983 r8340 29 29 // serviceProcessInstaller1 30 30 // 31 this.serviceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount. LocalSystem;31 this.serviceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.NetworkService; 32 32 this.serviceProcessInstaller1.Installers.AddRange(new System.Configuration.Install.Installer[] { 33 33 this.serviceInstaller1}); -
trunk/sources/HeuristicLab.Clients.Hive.Slave/3.3/Manager/PluginManager.cs
r7259 r8340 27 27 using System.Runtime.Serialization.Formatters.Binary; 28 28 using System.Threading; 29 using HeuristicLab.Clients.Hive.SlaveCore.Properties;30 29 using HeuristicLab.Core; 30 using CoreProperties = HeuristicLab.Clients.Hive.SlaveCore.Properties; 31 31 32 32 namespace HeuristicLab.Clients.Hive.SlaveCore { 33 33 public class PluginManager { 34 34 private static object locker = new object(); 35 private string lastUsedFileName = Settings.Default.LastUsedFileName;35 private string lastUsedFileName = CoreProperties.Settings.Default.LastUsedFileName; 36 36 //maximum number of days after which a plugin gets deleted if not used 37 private int pluginLifetime = Settings.Default.PluginLifetime;37 private int pluginLifetime = CoreProperties.Settings.Default.PluginLifetime; 38 38 39 39 private string PluginCacheDir { get; set; } … … 46 46 this.pluginService = pluginService; 47 47 this.log = log; 48 PluginCacheDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Settings.Default.PluginCacheDir); 49 PluginTempBaseDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Settings.Default.PluginTempBaseDir); 48 CheckWorkingDirectories(); 49 PluginCacheDir = CoreProperties.Settings.Default.PluginCacheDir; 50 PluginTempBaseDir = CoreProperties.Settings.Default.PluginTempBaseDir; 50 51 DoUpdateRun(); 52 } 53 54 /// <summary> 55 /// Normally the configuration file just contains the folder names of the PluginCache and the AppDomain working directory. 56 /// This means that these folders are created in the current directory which is ok for the console client and the windows service. 57 /// For the HL client we can't do that because the plugin infrastructure gets confused when starting HeuristicLab. 58 /// Therefore if there is only a relative path in the config, we change that to the temp path. 59 /// </summary> 60 private void CheckWorkingDirectories() { 61 if (!Path.IsPathRooted(CoreProperties.Settings.Default.PluginCacheDir)) { 62 CoreProperties.Settings.Default.PluginCacheDir = Path.Combine(Path.GetTempPath(), CoreProperties.Settings.Default.PluginCacheDir); 63 CoreProperties.Settings.Default.Save(); 64 } 65 66 if (!Path.IsPathRooted(CoreProperties.Settings.Default.PluginTempBaseDir)) { 67 CoreProperties.Settings.Default.PluginTempBaseDir = Path.Combine(Path.GetTempPath(), CoreProperties.Settings.Default.PluginTempBaseDir); 68 CoreProperties.Settings.Default.Save(); 69 } 51 70 } 52 71 … … 85 104 } 86 105 87 if (requestedPlugin.Name == Settings.Default.ConfigurationName) {106 if (requestedPlugin.Name == CoreProperties.Settings.Default.ConfigurationName) { 88 107 // configuration plugin consists only of 1 file (usually the "HeuristicLab X.X.exe.config") 89 108 configFileName = Path.Combine(targetDir, Path.GetFileName(filePaths.SingleOrDefault())); … … 93 112 // copy files from PluginInfrastructure (which are not declared in any plugins) 94 113 string baseDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 95 CopyFile(baseDir, targetDir, Settings.Default.PluginInfrastructureDll);96 CopyFile(baseDir, targetDir, Settings.Default.SharpZipLibDll);97 CopyFile(baseDir, targetDir, Settings.Default.SharpZipLibLicense);114 CopyFile(baseDir, targetDir, CoreProperties.Settings.Default.PluginInfrastructureDll); 115 CopyFile(baseDir, targetDir, CoreProperties.Settings.Default.SharpZipLibDll); 116 CopyFile(baseDir, targetDir, CoreProperties.Settings.Default.SharpZipLibLicense); 98 117 99 118 // copy slave plugins, otherwise its not possible to register the UnhandledException handler to the appdomain 100 CopyFile(baseDir, targetDir, Settings.Default.ClientsHiveSlaveCoreDll);101 CopyFile(baseDir, targetDir, Settings.Default.ClientsHiveDll);102 CopyFile(baseDir, targetDir, Settings.Default.HiveDll);103 CopyFile(baseDir, targetDir, Settings.Default.ClientsCommonDll);119 CopyFile(baseDir, targetDir, CoreProperties.Settings.Default.ClientsHiveSlaveCoreDll); 120 CopyFile(baseDir, targetDir, CoreProperties.Settings.Default.ClientsHiveDll); 121 CopyFile(baseDir, targetDir, CoreProperties.Settings.Default.HiveDll); 122 CopyFile(baseDir, targetDir, CoreProperties.Settings.Default.ClientsCommonDll); 104 123 } 105 124 … … 109 128 di.Refresh(); 110 129 while (di.Exists) { 111 Thread.Sleep( Settings.Default.DirOpSleepTime);130 Thread.Sleep(CoreProperties.Settings.Default.DirOpSleepTime); 112 131 di.Refresh(); 113 132 } … … 120 139 di = Directory.CreateDirectory(targetDir); 121 140 while (!di.Exists) { 122 Thread.Sleep( Settings.Default.DirOpSleepTime);141 Thread.Sleep(CoreProperties.Settings.Default.DirOpSleepTime); 123 142 di.Refresh(); 124 143 } … … 279 298 try { 280 299 log.LogMessage("Deleting plugins..."); 281 int tries = Settings.Default.PluginDeletionRetries;300 int tries = CoreProperties.Settings.Default.PluginDeletionRetries; 282 301 string path = Path.Combine(PluginTempBaseDir, id.ToString()); 283 302 while (tries > 0) { … … 287 306 } 288 307 catch (Exception) { 289 Thread.Sleep( Settings.Default.PluginDeletionTimeout);308 Thread.Sleep(CoreProperties.Settings.Default.PluginDeletionTimeout); 290 309 tries--; 291 310 if (tries == 0) throw;
Note: See TracChangeset
for help on using the changeset viewer.