Пример #1
0
        private static void ConfigureDotNetForFirstTimeUse(
            INuGetCacheSentinel nugetCacheSentinel,
            IFirstTimeUseNoticeSentinel firstTimeUseNoticeSentinel,
            IAspNetCertificateSentinel aspNetCertificateSentinel,
            IFileSentinel toolPathSentinel,
            bool hasSuperUserAccess,
            DotnetFirstRunConfiguration dotnetFirstRunConfiguration,
            IEnvironmentProvider environmentProvider)
        {
            using (PerfTrace.Current.CaptureTiming())
            {
                var nugetPackagesArchiver = new NuGetPackagesArchiver();
                var environmentPath       = EnvironmentPathFactory.CreateEnvironmentPath(hasSuperUserAccess, environmentProvider);
                var commandFactory        = new DotNetCommandFactory(alwaysRunOutOfProc: true);
                var nugetCachePrimer      = new NuGetCachePrimer(
                    nugetPackagesArchiver,
                    nugetCacheSentinel);
                var aspnetCertificateGenerator = new AspNetCoreCertificateGenerator();
                var dotnetConfigurer           = new DotnetFirstTimeUseConfigurer(
                    nugetCachePrimer,
                    nugetCacheSentinel,
                    firstTimeUseNoticeSentinel,
                    aspNetCertificateSentinel,
                    aspnetCertificateGenerator,
                    toolPathSentinel,
                    dotnetFirstRunConfiguration,
                    Reporter.Output,
                    CliFolderPathCalculator.CliFallbackFolderPath,
                    environmentPath);

                dotnetConfigurer.Configure();
            }
        }
Пример #2
0
        private static void ConfigureDotNetForFirstTimeUse(
            INuGetCacheSentinel nugetCacheSentinel,
            IFirstTimeUseNoticeSentinel firstTimeUseNoticeSentinel,
            CliFallbackFolderPathCalculator cliFallbackFolderPathCalculator)
        {
            using (PerfTrace.Current.CaptureTiming())
            {
                var nugetPackagesArchiver = new NuGetPackagesArchiver();
                var environmentProvider   = new EnvironmentProvider();
                var commandFactory        = new DotNetCommandFactory(alwaysRunOutOfProc: true);
                var nugetCachePrimer      = new NuGetCachePrimer(
                    nugetPackagesArchiver,
                    nugetCacheSentinel,
                    cliFallbackFolderPathCalculator);
                var dotnetConfigurer = new DotnetFirstTimeUseConfigurer(
                    nugetCachePrimer,
                    nugetCacheSentinel,
                    firstTimeUseNoticeSentinel,
                    environmentProvider,
                    Reporter.Output,
                    cliFallbackFolderPathCalculator.CliFallbackFolderPath);

                dotnetConfigurer.Configure();
            }
        }
Пример #3
0
        private bool PermissionExists(INuGetCacheSentinel sentinel)
        {
            if (sentinel == null)
            {
                return false;
            }

            return sentinel.Exists();
        }
 public DotnetFirstTimeUseConfigurer(
     INuGetCachePrimer nugetCachePrimer,
     INuGetCacheSentinel nugetCacheSentinel,
     IEnvironmentProvider environmentProvider)
 {
     _nugetCachePrimer    = nugetCachePrimer;
     _nugetCacheSentinel  = nugetCacheSentinel;
     _environmentProvider = environmentProvider;
 }
Пример #5
0
        private bool PermissionExists(INuGetCacheSentinel sentinel)
        {
            if (sentinel == null)
            {
                return(false);
            }

            return(sentinel.Exists());
        }
 public DotnetFirstTimeUseConfigurer(
     INuGetCachePrimer nugetCachePrimer,
     INuGetCacheSentinel nugetCacheSentinel,
     IEnvironmentProvider environmentProvider)
 {
     _nugetCachePrimer = nugetCachePrimer;
     _nugetCacheSentinel = nugetCacheSentinel;
     _environmentProvider = environmentProvider;
 }
Пример #7
0
 public NuGetCachePrimer(
     INuGetPackagesArchiver nugetPackagesArchiver,
     INuGetCacheSentinel nuGetCacheSentinel,
     CliFallbackFolderPathCalculator cliFallbackFolderPathCalculator)
     : this(nugetPackagesArchiver,
            nuGetCacheSentinel,
            cliFallbackFolderPathCalculator,
            FileSystemWrapper.Default.File)
 {
 }
Пример #8
0
 public NuGetCachePrimer(
     ICommandFactory commandFactory,
     INuGetPackagesArchiver nugetPackagesArchiver,
     INuGetCacheSentinel nuGetCacheSentinel)
     : this(commandFactory,
         nugetPackagesArchiver,
         nuGetCacheSentinel,
         FileSystemWrapper.Default.Directory,
         FileSystemWrapper.Default.File)
 {
 }
Пример #9
0
 public NuGetCachePrimer(
     ICommandFactory commandFactory,
     INuGetPackagesArchiver nugetPackagesArchiver,
     INuGetCacheSentinel nuGetCacheSentinel)
     : this(commandFactory,
            nugetPackagesArchiver,
            nuGetCacheSentinel,
            FileSystemWrapper.Default.Directory,
            FileSystemWrapper.Default.File)
 {
 }
Пример #10
0
        internal NuGetCachePrimer(
            INuGetPackagesArchiver nugetPackagesArchiver,
            INuGetCacheSentinel nuGetCacheSentinel,
            IFile file)
        {
            _nugetPackagesArchiver = nugetPackagesArchiver;

            _nuGetCacheSentinel = nuGetCacheSentinel;

            _file = file;
        }
Пример #11
0
        public Telemetry(INuGetCacheSentinel sentinel)
        {
            Enabled = !Env.GetEnvironmentVariableAsBool(TelemetryOptout) && PermissionExists(sentinel);

            if (!Enabled)
            {
                return;
            }

            //initialize in task to offload to parallel thread
            _trackEventTask = Task.Factory.StartNew(() => InitializeTelemetry());
        }
Пример #12
0
        public Telemetry(INuGetCacheSentinel sentinel)
        {
            Enabled = !Env.GetEnvironmentVariableAsBool(TelemetryOptout) && PermissionExists(sentinel);

            if (!Enabled)
            {
                return;
            }

            //initialize in task to offload to parallel thread
            _trackEventTask = Task.Factory.StartNew(() => InitializeTelemetry());
        }
Пример #13
0
 internal NuGetCachePrimer(
     ICommandFactory commandFactory,
     INuGetPackagesArchiver nugetPackagesArchiver,
     INuGetCacheSentinel nuGetCacheSentinel,
     IDirectory directory,
     IFile file)
 {
     _commandFactory        = commandFactory;
     _directory             = directory;
     _nugetPackagesArchiver = nugetPackagesArchiver;
     _nuGetCacheSentinel    = nuGetCacheSentinel;
     _file = file;
 }
Пример #14
0
 internal NuGetCachePrimer(
     ICommandFactory commandFactory,
     INuGetPackagesArchiver nugetPackagesArchiver,
     INuGetCacheSentinel nuGetCacheSentinel,
     IDirectory directory,
     IFile file)
 {
     _commandFactory = commandFactory;
     _directory = directory;
     _nugetPackagesArchiver = nugetPackagesArchiver;
     _nuGetCacheSentinel = nuGetCacheSentinel;
     _file = file;
 }
Пример #15
0
        internal NuGetCachePrimer(
            INuGetPackagesArchiver nugetPackagesArchiver,
            INuGetCacheSentinel nuGetCacheSentinel,
            CliFallbackFolderPathCalculator cliFallbackFolderPathCalculator,
            IFile file)
        {
            _nugetPackagesArchiver = nugetPackagesArchiver;

            _nuGetCacheSentinel = nuGetCacheSentinel;

            _cliFallbackFolderPathCalculator = cliFallbackFolderPathCalculator;

            _file = file;
        }
Пример #16
0
        public Telemetry(INuGetCacheSentinel sentinel, string sessionId)
        {
            Enabled = !Env.GetEnvironmentVariableAsBool(TelemetryOptout) && PermissionExists(sentinel);

            if (!Enabled)
            {
                return;
            }

            // Store the session ID in a static field so that it can be reused
            CurrentSessionId = sessionId ?? Guid.NewGuid().ToString();

            //initialize in task to offload to parallel thread
            _trackEventTask = Task.Factory.StartNew(() => InitializeTelemetry());
        }
 public DotnetFirstTimeUseConfigurer(
     INuGetCachePrimer nugetCachePrimer,
     INuGetCacheSentinel nugetCacheSentinel,
     IFirstTimeUseNoticeSentinel firstTimeUseNoticeSentinel,
     IEnvironmentProvider environmentProvider,
     IReporter reporter,
     string cliFallbackFolderPath)
 {
     _nugetCachePrimer           = nugetCachePrimer;
     _nugetCacheSentinel         = nugetCacheSentinel;
     _firstTimeUseNoticeSentinel = firstTimeUseNoticeSentinel;
     _environmentProvider        = environmentProvider;
     _reporter = reporter;
     _cliFallbackFolderPath = cliFallbackFolderPath;
 }
Пример #18
0
 public DotnetFirstTimeUseConfigurer(
     INuGetCachePrimer nugetCachePrimer,
     INuGetCacheSentinel nugetCacheSentinel,
     IFirstTimeUseNoticeSentinel firstTimeUseNoticeSentinel,
     IEnvironmentProvider environmentProvider,
     IReporter reporter,
     string cliFallbackFolderPath,
     IEnvironmentPath pathAdder)
 {
     _nugetCachePrimer           = nugetCachePrimer;
     _nugetCacheSentinel         = nugetCacheSentinel;
     _firstTimeUseNoticeSentinel = firstTimeUseNoticeSentinel;
     _environmentProvider        = environmentProvider;
     _reporter = reporter;
     _cliFallbackFolderPath = cliFallbackFolderPath;
     _pathAdder             = pathAdder ?? throw new ArgumentNullException(nameof(pathAdder));
 }
Пример #19
0
        private static void ConfigureDotNetForFirstTimeUse(INuGetCacheSentinel nugetCacheSentinel)
        {
            using (PerfTrace.Current.CaptureTiming())
            {
                using (var nugetPackagesArchiver = new NuGetPackagesArchiver())
                {
                    var environmentProvider = new EnvironmentProvider();
                    var commandFactory      = new DotNetCommandFactory();
                    var nugetCachePrimer    =
                        new NuGetCachePrimer(commandFactory, nugetPackagesArchiver, nugetCacheSentinel);
                    var dotnetConfigurer = new DotnetFirstTimeUseConfigurer(
                        nugetCachePrimer,
                        nugetCacheSentinel,
                        environmentProvider);

                    dotnetConfigurer.Configure();
                }
            }
        }
Пример #20
0
 public DotnetFirstTimeUseConfigurer(
     INuGetCachePrimer nugetCachePrimer,
     INuGetCacheSentinel nugetCacheSentinel,
     IFirstTimeUseNoticeSentinel firstTimeUseNoticeSentinel,
     IAspNetCertificateSentinel aspNetCertificateSentinel,
     IAspNetCoreCertificateGenerator aspNetCoreCertificateGenerator,
     IFileSentinel toolPathSentinel,
     IEnvironmentProvider environmentProvider,
     IReporter reporter,
     string cliFallbackFolderPath,
     IEnvironmentPath pathAdder)
 {
     _nugetCachePrimer               = nugetCachePrimer;
     _nugetCacheSentinel             = nugetCacheSentinel;
     _firstTimeUseNoticeSentinel     = firstTimeUseNoticeSentinel;
     _aspNetCertificateSentinel      = aspNetCertificateSentinel;
     _aspNetCoreCertificateGenerator = aspNetCoreCertificateGenerator;
     _toolPathSentinel               = toolPathSentinel;
     _environmentProvider            = environmentProvider;
     _reporter = reporter;
     _cliFallbackFolderPath = cliFallbackFolderPath;
     _pathAdder             = pathAdder ?? throw new ArgumentNullException(nameof(pathAdder));
 }
Пример #21
0
 public Telemetry(INuGetCacheSentinel sentinel) : this(sentinel, null)
 {
 }
Пример #22
0
        private static void ConfigureDotNetForFirstTimeUse(INuGetCacheSentinel nugetCacheSentinel)
        {
            using (PerfTrace.Current.CaptureTiming())
            {
                using (var nugetPackagesArchiver = new NuGetPackagesArchiver())
                {
                    var environmentProvider = new EnvironmentProvider();
                    var commandFactory = new DotNetCommandFactory();
                    var nugetCachePrimer = 
                        new NuGetCachePrimer(commandFactory, nugetPackagesArchiver, nugetCacheSentinel);
                    var dotnetConfigurer = new DotnetFirstTimeUseConfigurer(
                        nugetCachePrimer,
                        nugetCacheSentinel,
                        environmentProvider);

                    dotnetConfigurer.Configure();
                }
            }
        }
Пример #23
0
 public NuGetCachePrimer(INuGetPackagesArchiver nugetPackagesArchiver, INuGetCacheSentinel nuGetCacheSentinel)
     : this(nugetPackagesArchiver, nuGetCacheSentinel, FileSystemWrapper.Default.File)
 {
 }