private void Load(string filename) { _configFilename = filename; string tempFilename = string.Empty; try { tempFilename = Path.GetTempFileName(); File.WriteAllText(tempFilename, EvaluateFileContents(filename), Encoding.UTF8); _config = GetConfiguration(tempFilename); if (_config == null) { throw new InvalidConfigurationException(string.Format("Error loading configuration file: {0}", filename), new FileLoadException("Missing RemoteInstallConfig section.", filename)); } // insert a noop installer when it's missing from the configuration _config.Installers.EnsureOne(); } finally { if (!string.IsNullOrEmpty(tempFilename) && File.Exists(tempFilename)) { File.Delete(tempFilename); } } }
public Instance( string logpath, bool simulationOnly, RemoteInstallConfig config, VMWareMappedVirtualMachine vm, VirtualMachineConfig vmConfig, InstallerConfig installerConfig, SnapshotConfig snapshotConfig) { _logpath = logpath; _simulationOnly = simulationOnly; _config = config; _vm = vm; _vmConfig = vmConfig; _installerConfig = installerConfig; _snapshotConfig = snapshotConfig; }
public Instance( string logpath, bool simulationOnly, RemoteInstallConfig config, VMWareMappedVirtualMachine vm, VirtualMachineConfig vmConfig, InstallerConfig installerConfig, SnapshotConfig snapshotConfig) { _logpath = logpath; _simulationOnly = simulationOnly; _config = config; _vm = vm; _vmConfig = vmConfig; _installerConfig = installerConfig; _snapshotConfig = snapshotConfig; }
/// <summary> /// Create a new remote installer driver, logging to logpath with configuration stored in /// RemoteInstallConfig class object and additional command-line variables. /// </summary> public Driver(string logpath, bool simulationOnly, RemoteInstallConfig configuration, NameValueCollection variables, int pipelineCount) { this._configuration = configuration; Init(simulationOnly, logpath, pipelineCount); }
/// <summary> /// Create a new remote installer driver, logging to logpath with configuration stored in /// filename and additional command-line variables. /// </summary> public Driver(string logpath, bool simulationOnly, string filename, NameValueCollection variables, int pipelineCount) { _configuration = new ConfigManager(filename, variables).Configuration; Init(simulationOnly, logpath, pipelineCount); }
/// <summary> /// Create a new remote installer driver, logging to logpath with configuration stored in /// RemoteInstallConfig class object and additional command-line variables. /// </summary> public Driver(string logpath, bool simulationOnly, RemoteInstallConfig configuration, NameValueCollection variables, int pipelineCount) { this._configuration = configuration; Init(simulationOnly, logpath, pipelineCount); }
/// <summary> /// Create a new remote installer driver, logging to logpath with configuration stored in /// filename and additional command-line variables. /// </summary> public Driver(string logpath, bool simulationOnly, string filename, NameValueCollection variables, int pipelineCount) { _configuration = new ConfigManager(filename, variables).Configuration; Init(simulationOnly, logpath, pipelineCount); }
public void TimeoutsConfigurationTest() { Configuration exeConfig = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); RemoteInstallConfig remoteInstallConfig = new RemoteInstallConfig(); remoteInstallConfig.Timeouts.ResetToDefaultValues(); exeConfig.Sections.Add("RemoteInstallConfig", remoteInstallConfig); string configFileName = Path.GetTempFileName(); exeConfig.SaveAs(configFileName); Console.WriteLine(File.ReadAllText(configFileName)); File.Delete(configFileName); }