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(); } }
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(); } }
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; }
private bool PermissionExists(INuGetCacheSentinel sentinel) { if (sentinel == null) { return(false); } return(sentinel.Exists()); }
public NuGetCachePrimer( INuGetPackagesArchiver nugetPackagesArchiver, INuGetCacheSentinel nuGetCacheSentinel, CliFallbackFolderPathCalculator cliFallbackFolderPathCalculator) : this(nugetPackagesArchiver, nuGetCacheSentinel, cliFallbackFolderPathCalculator, FileSystemWrapper.Default.File) { }
public NuGetCachePrimer( ICommandFactory commandFactory, INuGetPackagesArchiver nugetPackagesArchiver, INuGetCacheSentinel nuGetCacheSentinel) : this(commandFactory, nugetPackagesArchiver, nuGetCacheSentinel, FileSystemWrapper.Default.Directory, FileSystemWrapper.Default.File) { }
internal NuGetCachePrimer( INuGetPackagesArchiver nugetPackagesArchiver, INuGetCacheSentinel nuGetCacheSentinel, IFile file) { _nugetPackagesArchiver = nugetPackagesArchiver; _nuGetCacheSentinel = nuGetCacheSentinel; _file = file; }
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()); }
internal NuGetCachePrimer( ICommandFactory commandFactory, INuGetPackagesArchiver nugetPackagesArchiver, INuGetCacheSentinel nuGetCacheSentinel, IDirectory directory, IFile file) { _commandFactory = commandFactory; _directory = directory; _nugetPackagesArchiver = nugetPackagesArchiver; _nuGetCacheSentinel = nuGetCacheSentinel; _file = file; }
internal NuGetCachePrimer( INuGetPackagesArchiver nugetPackagesArchiver, INuGetCacheSentinel nuGetCacheSentinel, CliFallbackFolderPathCalculator cliFallbackFolderPathCalculator, IFile file) { _nugetPackagesArchiver = nugetPackagesArchiver; _nuGetCacheSentinel = nuGetCacheSentinel; _cliFallbackFolderPathCalculator = cliFallbackFolderPathCalculator; _file = file; }
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; }
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)); }
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(); } } }
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)); }
public Telemetry(INuGetCacheSentinel sentinel) : this(sentinel, null) { }
public NuGetCachePrimer(INuGetPackagesArchiver nugetPackagesArchiver, INuGetCacheSentinel nuGetCacheSentinel) : this(nugetPackagesArchiver, nuGetCacheSentinel, FileSystemWrapper.Default.File) { }