Exemplo n.º 1
0
        /// <summary>
        ///     Processes the record.
        /// </summary>
        /// <exception cref="System.Exception">The RABBITMQ_BASE environmental variable is not set correctly</exception>
        /// <exception cref="System.IO.FileNotFoundException">No installer found</exception>
        protected override void ProcessRecord()
        {
            var rabbitMqBase = Environment.GetEnvironmentVariable("RABBITMQ_BASE");

            if (rabbitMqBase != InstallationConstants.RabbitMq.ConfigurationPath)
            {
                WriteWarning(string.Format("RABBITMQ_BASE is set to {0}", rabbitMqBase));
                throw new Exception("The RABBITMQ_BASE environmental variable is not set correctly");
            }

            var executablePath = GetRabbitMqInstallerCommand.RabbitMqInstallerPath;

            if (!File.Exists(executablePath))
            {
                throw new FileNotFoundException("No installer found");
            }

            var externalProcessRunner = new ExternalProcessRunner
            {
                EstimatedProcessDuration = TimeSpan.FromMinutes(10)
            };


            var assemblyEntryPointProvider = new AssemblyEntryPointProvider();

            var workingPath = assemblyEntryPointProvider.GetAssemblyDirectory(GetType());

            const string silent = "/S";

            WriteVerbose("Installing RabbitMq...");

            externalProcessRunner.Run(executablePath, workingPath, silent);

            WriteVerbose("Installation process completed");
        }
        /// <summary>
        ///     Processes the record.
        /// </summary>
        /// <exception cref="System.IO.FileNotFoundException">No installer found</exception>
        protected override void ProcessRecord()
        {
            var executablePath = GetErlangInstallerCommand.ErlangInstallerPath;

            if (!File.Exists(executablePath))
            {
                throw new FileNotFoundException("No installer found");
            }

            var externalProcessRunner = new ExternalProcessRunner
            {
                EstimatedProcessDuration = TimeSpan.FromMinutes(10)
            };


            var assemblyEntryPointProvider = new AssemblyEntryPointProvider();

            var workingPath = assemblyEntryPointProvider.GetAssemblyDirectory(GetType());

            const string silent = "/S";

            WriteVerbose("Installing Erlang...");

            externalProcessRunner.Run(executablePath, workingPath, silent);

            WriteVerbose("Installation process completed");
        }