コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
ファイル: Instance.cs プロジェクト: blinds52/remoteinstall
 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;
 }
コード例 #3
0
 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;
 }
コード例 #4
0
ファイル: Driver.cs プロジェクト: blinds52/remoteinstall
 /// <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);
 }
コード例 #5
0
ファイル: Driver.cs プロジェクト: blinds52/remoteinstall
 /// <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);
 }
コード例 #6
0
 /// <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);
 }
コード例 #7
0
 /// <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);
 }
コード例 #8
0
 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);
 }