コード例 #1
0
        public override Result Execute(IOfferRemoteOperations remote, ServerConfig server, ConDepSettings settings, CancellationToken token)
        {
            token.ThrowIfCancellationRequested();

            Logger.WithLogSection("Pre-Operations", () =>
            {
                server.GetServerInfo().TempFolderDos = string.Format(TMP_FOLDER, "%windir%");
                Logger.Info(string.Format("Dos temp folder is {0}", server.GetServerInfo().TempFolderDos));

                server.GetServerInfo().TempFolderPowerShell = string.Format(TMP_FOLDER, "$env:windir");
                Logger.Info(string.Format("PowerShell temp folder is {0}", server.GetServerInfo().TempFolderPowerShell));

                PublishConDepNode(server, settings);

                var scriptPublisher = new PowerShellScriptPublisher(settings, server);
                Logger.WithLogSection("Copying external scripts", () => scriptPublisher.PublishScripts());
                Logger.WithLogSection("Copying remote helper assembly", () => scriptPublisher.PublishRemoteHelperAssembly());

                InstallChocolatey(server, settings);
            });
            return(Result.SuccessUnChanged());
        }
コード例 #2
0
        public override Result Execute(IOfferRemoteOperations remote, ServerConfig server, ConDepSettings settings, CancellationToken token)
        {
            token.ThrowIfCancellationRequested();

            Logger.WithLogSection("Pre-Operations", () =>
            {
                server.GetServerInfo().TempFolderDos = string.Format(TMP_FOLDER, "%windir%");
                Logger.Info(string.Format("Dos temp folder is {0}", server.GetServerInfo().TempFolderDos));

                server.GetServerInfo().TempFolderPowerShell = string.Format(TMP_FOLDER, "$env:windir");
                Logger.Info(string.Format("PowerShell temp folder is {0}", server.GetServerInfo().TempFolderPowerShell));

                PublishConDepNode(server, settings);

                var scriptPublisher = new PowerShellScriptPublisher(settings, server);
                Logger.WithLogSection("Copying external scripts", () => scriptPublisher.PublishScripts());
                Logger.WithLogSection("Copying remote helper assembly", () => scriptPublisher.PublishRemoteHelperAssembly());

                InstallChocolatey(server, settings);
            });
            return Result.SuccessUnChanged();
        }