示例#1
0
        private static void ConfigureDotNetForFirstTimeUse(
            IFirstTimeUseNoticeSentinel firstTimeUseNoticeSentinel,
            IAspNetCertificateSentinel aspNetCertificateSentinel,
            IFileSentinel toolPathSentinel,
            bool hasSuperUserAccess,
            DotnetFirstRunConfiguration dotnetFirstRunConfiguration,
            IEnvironmentProvider environmentProvider)
        {
            using (PerfTrace.Current.CaptureTiming())
            {
                var environmentPath            = EnvironmentPathFactory.CreateEnvironmentPath(hasSuperUserAccess, environmentProvider);
                var commandFactory             = new DotNetCommandFactory(alwaysRunOutOfProc: true);
                var aspnetCertificateGenerator = new AspNetCoreCertificateGenerator();
                var dotnetConfigurer           = new DotnetFirstTimeUseConfigurer(
                    firstTimeUseNoticeSentinel,
                    aspNetCertificateSentinel,
                    aspnetCertificateGenerator,
                    toolPathSentinel,
                    dotnetFirstRunConfiguration,
                    Reporter.Output,
                    CliFolderPathCalculator.CliFallbackFolderPath,
                    environmentPath);

                dotnetConfigurer.Configure();
            }
        }
示例#2
0
文件: Program.cs 项目: baronfel/sdk
        private static void ConfigureDotNetForFirstTimeUse(
            IFirstTimeUseNoticeSentinel firstTimeUseNoticeSentinel,
            IAspNetCertificateSentinel aspNetCertificateSentinel,
            IFileSentinel toolPathSentinel,
            bool isDotnetBeingInvokedFromNativeInstaller,
            DotnetFirstRunConfiguration dotnetFirstRunConfiguration,
            IEnvironmentProvider environmentProvider,
            Dictionary <string, double> performanceMeasurements)
        {
            var environmentPath            = EnvironmentPathFactory.CreateEnvironmentPath(isDotnetBeingInvokedFromNativeInstaller, environmentProvider);
            var commandFactory             = new DotNetCommandFactory(alwaysRunOutOfProc: true);
            var aspnetCertificateGenerator = new AspNetCoreCertificateGenerator();
            var dotnetConfigurer           = new DotnetFirstTimeUseConfigurer(
                firstTimeUseNoticeSentinel,
                aspNetCertificateSentinel,
                aspnetCertificateGenerator,
                toolPathSentinel,
                dotnetFirstRunConfiguration,
                Reporter.Output,
                CliFolderPathCalculator.CliFallbackFolderPath,
                environmentPath,
                performanceMeasurements);

            dotnetConfigurer.Configure();

            if (isDotnetBeingInvokedFromNativeInstaller && OperatingSystem.IsWindows())
            {
                DotDefaultPathCorrector.Correct();
            }
        }
示例#3
0
        private static void ConfigureDotNetForFirstTimeUse(
            IFirstTimeUseNoticeSentinel firstTimeUseNoticeSentinel,
            IAspNetCertificateSentinel aspNetCertificateSentinel,
            IFileSentinel toolPathSentinel,
            bool isDotnetBeingInvokedFromNativeInstaller,
            DotnetFirstRunConfiguration dotnetFirstRunConfiguration,
            IEnvironmentProvider environmentProvider)
        {
            using (PerfTrace.Current.CaptureTiming())
            {
                var environmentPath            = EnvironmentPathFactory.CreateEnvironmentPath(isDotnetBeingInvokedFromNativeInstaller, environmentProvider);
                var commandFactory             = new DotNetCommandFactory(alwaysRunOutOfProc: true);
                var aspnetCertificateGenerator = new AspNetCoreCertificateGenerator();
                var dotnetConfigurer           = new DotnetFirstTimeUseConfigurer(
                    firstTimeUseNoticeSentinel,
                    aspNetCertificateSentinel,
                    aspnetCertificateGenerator,
                    toolPathSentinel,
                    dotnetFirstRunConfiguration,
                    Reporter.Output,
                    CliFolderPathCalculator.CliFallbackFolderPath,
                    environmentPath);

                dotnetConfigurer.Configure();

                if (isDotnetBeingInvokedFromNativeInstaller && RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
                {
                    DotDefaultPathCorrector.Correct();
                }
            }
        }
示例#4
0
 public DotnetFirstTimeUseConfigurer(
     IFirstTimeUseNoticeSentinel firstTimeUseNoticeSentinel,
     IAspNetCertificateSentinel aspNetCertificateSentinel,
     IAspNetCoreCertificateGenerator aspNetCoreCertificateGenerator,
     IFileSentinel toolPathSentinel,
     DotnetFirstRunConfiguration dotnetFirstRunConfiguration,
     IReporter reporter,
     string cliFallbackFolderPath,
     IEnvironmentPath pathAdder)
 {
     _firstTimeUseNoticeSentinel     = firstTimeUseNoticeSentinel;
     _aspNetCertificateSentinel      = aspNetCertificateSentinel;
     _aspNetCoreCertificateGenerator = aspNetCoreCertificateGenerator;
     _toolPathSentinel            = toolPathSentinel;
     _dotnetFirstRunConfiguration = dotnetFirstRunConfiguration;
     _reporter = reporter;
     _cliFallbackFolderPath = cliFallbackFolderPath;
     _pathAdder             = pathAdder ?? throw new ArgumentNullException(nameof(pathAdder));
 }
示例#5
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));
 }
示例#6
0
文件: Program.cs 项目: yb123speed/cli
        private static void ConfigureDotNetForFirstTimeUse(
            INuGetCacheSentinel nugetCacheSentinel,
            IFirstTimeUseNoticeSentinel firstTimeUseNoticeSentinel,
            IAspNetCertificateSentinel aspNetCertificateSentinel,
            IFileSentinel toolPathSentinel,
            CliFolderPathCalculator cliFolderPathCalculator,
            bool hasSuperUserAccess)
        {
            var environmentProvider = new EnvironmentProvider();

            using (PerfTrace.Current.CaptureTiming())
            {
                var nugetPackagesArchiver = new NuGetPackagesArchiver();
                var environmentPath       =
                    EnvironmentPathFactory.CreateEnvironmentPath(cliFolderPathCalculator, hasSuperUserAccess, environmentProvider);
                var commandFactory   = new DotNetCommandFactory(alwaysRunOutOfProc: true);
                var nugetCachePrimer = new NuGetCachePrimer(
                    nugetPackagesArchiver,
                    nugetCacheSentinel,
                    cliFolderPathCalculator);
                var aspnetCertificateGenerator = new AspNetCoreCertificateGenerator();
                var dotnetConfigurer           = new DotnetFirstTimeUseConfigurer(
                    nugetCachePrimer,
                    nugetCacheSentinel,
                    firstTimeUseNoticeSentinel,
                    aspNetCertificateSentinel,
                    aspnetCertificateGenerator,
                    toolPathSentinel,
                    environmentProvider,
                    Reporter.Output,
                    cliFolderPathCalculator.CliFallbackFolderPath,
                    environmentPath);

                dotnetConfigurer.Configure();
            }
        }