public bool Execute(DeleteArgs args)
        {
            try
            {
                System.Console.WriteLine("SIM: Starting Delete");

                InstanceManager.Initialize(args.InstanceDirectory);
                var instance = InstanceManager.GetInstance(args.InstanceName);

                if (instance == null)
                {
                    System.Console.WriteLine("SIM: Warning! Can't detect installed instance {0}", args.InstanceName);
                    return true;
                }

                SIM.Pipelines.Delete.DeleteArgs deleteArgs = new SIM.Pipelines.Delete.DeleteArgs(instance, new SqlConnectionStringBuilder(args.ConnectionString));
                IPipelineController controller = new ConsoleController();

                PipelineManager.Initialize();

                PipelineManager.StartPipeline(
                    "delete",
                    deleteArgs,
                    controller,
                    false);

                System.Console.WriteLine("SIM: Finished Delete");

                return true;
            }
            catch (Exception ex)
            {
                System.Console.WriteLine("Sitecore SIM install failed", ex);
                return false;
            }
        }
        public bool Execute(InstallArgs args)
        {
            try
            {
                System.Console.WriteLine("SIM: Starting Install");

                string instanceRootDirectoryPath = args.InstanceDirectory + "\\" + args.InstanceName;

                Instance instance = InstanceManager.GetInstance(args.InstanceName);
                if (instance != null)
                {
                    System.Console.WriteLine("SIM: Warning! The instance with the same ({0}) name already exists",
                        args.InstanceName);
                }

                // Next lets check the rootDirectoryPath folder for uniqueness
                if (Directory.Exists(instanceRootDirectoryPath))
                {
                    System.Console.WriteLine("SIM: Warning! The folder {0} already exists", instanceRootDirectoryPath);
                }

                Product product;
                string repoFullPath = args.RepoDirectory + "\\" + args.RepoFile;

                var result = Product.TryParse(repoFullPath, out product);
                if (result == false)
                {
                    System.Console.WriteLine("SIM: Warning! Can't detect Sitecore-based product in {0} file", args.RepoFile);
                }

                var modules = new List<Product>();

                if (!string.IsNullOrEmpty(args.Modules))
                {
                    var modulesNames = args.Modules.Split('|');
                    foreach (var moduleName in modulesNames)
                    {
                        string modulePath = args.RepoDirectory + "\\" + moduleName;
                        Product module;
                        Product.TryParse(modulePath, out module);

                        if (module != null)
                        {
                            modules.Add(module);
                        }
                    }

                }

                SIM.Pipelines.Install.InstallArgs installArgs = new SIM.Pipelines.Install.InstallArgs(args.InstanceName,
                    args.InstanceName,
                    product,
                    instanceRootDirectoryPath,
                    new SqlConnectionStringBuilder(args.ConnectionString),
                    args.AppPoolIdentity,
                    args.AppPoolIdentity,
                    new FileInfo(args.LicencePath),
                    true,
                    false,
                    false,
                    modules);

                IPipelineController controller = new ConsoleController();

                // Lets start installation
                PipelineManager.Initialize();
                PipelineManager.StartPipeline(
                    "install",
                    installArgs,
                    controller,
                    false);

                System.Console.WriteLine("SIM: Finished Install");

                return true;
            }
            catch (Exception ex)
            {
                System.Console.WriteLine("Sitecore SIM install failed {0}", ex);
                return false;
            }
        }