protected void CleanupHostSpecificSetupFiles(string setupDir, InstallConfigurationProperties props) { if (props != null && props.RemoveSetupFilesAfterInstall) { if (string.IsNullOrEmpty(setupDir)) { setupDir = this.GetAppRootDir(); } if (!string.IsNullOrEmpty(setupDir)) { this.WriteToTrace("Cleaning host config files from " + setupDir); if (Directory.Exists(setupDir)) { DirectoryInfo di = new DirectoryInfo(setupDir); try { foreach (FileInfo fi in di.GetFiles()) { if (fi.Name.EndsWith(".setup.config")) { this.WriteToTrace("removing file " + fi.Name); fi.Delete(); } } } catch (Exception exc) { this.WriteToTrace("Failed to remove some setup config files", exc); } } } } }
protected string GetHostSpecificInstallProperty(string propertyName) { InstallConfigurationProperties props = this.ReadHostnameSetupFile(); if (props != null) { return(props.GetPropertyValue(propertyName)); } return(null); }
protected InstallConfigurationProperties GetHostInstallConfigurationPropertiesAndCleanUp(string setupDir) { InstallConfigurationProperties props = this.ReadHostnameSetupFile(setupDir); if (props != null) { this.CleanupHostSpecificSetupFiles(setupDir, props); return(props); } this.WriteToTrace("No properties file found for host, returning null."); return(null); }
protected void CleanupHostSpecificSetupFiles(string setupDir) { InstallConfigurationProperties props = this.ReadHostnameSetupFile(setupDir); this.CleanupHostSpecificSetupFiles(setupDir, props); }