/* * --------- * Overrides * --------- */ /* For maintaining consistency. */ public void CleanupConfig(string thisPath) { if (String.IsNullOrEmpty(AppName)) { AppName = "Reloaded Application Name"; } if (String.IsNullOrEmpty(AppId)) { AppId = AppName.Replace(" ", "."); } if (!String.IsNullOrEmpty(thisPath)) { string imagePath = Path.Combine(Path.GetDirectoryName(thisPath), AppIcon); if (!File.Exists(imagePath)) { AppIcon = ""; } } if (!File.Exists(AppLocation)) { AppLocation = ""; AppArguments = ""; } EnabledMods = ConfigCleanupUtility.FilterNonexistingModIds(EnabledMods).ToArray(); }
public override void Run(List <Variable> variableList) { var fileMaker = new NgFileMaker(); var app = AppName.Replace(@"\", @"").Replace(@".app", @""); Console.Write($@"Install app {app} ... "); foreach (var variable in variableList) { AppName = AppName.Replace("@(" + variable.Name + ")", variable.Value); FileName = FileName.Replace("@(" + variable.Name + ")", variable.Value); WorkingDirectory = WorkingDirectory.Replace("@(" + variable.Name + ")", variable.Value); } FileName = Environment.ExpandEnvironmentVariables(FileName); WorkingDirectory = Environment.ExpandEnvironmentVariables(WorkingDirectory); var appUninstallLoc = new System.IO.DirectoryInfo($@"/Applications/{AppName}"); fileMaker.DeleteFolder(appUninstallLoc); var process = new Process(); process.StartInfo.WorkingDirectory = WorkingDirectory; process.StartInfo.FileName = @$ "/bin/bash"; process.StartInfo.Arguments = $@"-c ""mv {FileName} /Applications/{AppName.Replace(@" ", @"\ ")}"""; process.StartInfo.Verb = "runas"; process.Start(); process.WaitForExit(); process = new Process(); process.StartInfo.WorkingDirectory = WorkingDirectory; process.StartInfo.FileName = @$ "/bin/bash"; process.StartInfo.Arguments = $@"-c ""xattr -cr /Applications/{AppName.Replace(@" ", @"\ ")}"""; process.StartInfo.Verb = "runas"; process.Start(); process.WaitForExit(); Console.WriteLine("Done"); }
public override void ActivateOptions() { _routingKey = string.Join(".", Tenent.Replace(".", "%2E"), Environment.Replace(".", "%2E"), AppName.Replace(".", "%2E")); _connectionFactory = new ConnectionFactory() { HostName = HostName, VirtualHost = VirtualHost, UserName = UserName, Password = Password, RequestedHeartbeat = RequestedHeartbeat, Port = Port }; _worker = new WorkerThread <LoggingEvent>($"Worker for log4net appender '{Name}'", TimeSpan.FromSeconds((double)FlushInterval), Process); }
/// <summary> /// Override connection string if specified as an environment variable. /// </summary> private void OverrideConnectionString() { var cs = Environment.GetEnvironmentVariable($"{Company.Replace(".", "_", StringComparison.InvariantCulture)}_{AppName.Replace(".", "_", StringComparison.InvariantCulture)}_ConnectionString"); if (cs != null) { ConnectionString = cs; } }