@@ -24,7 +24,7 @@ public class DotNetInstallation : VirtualClientComponent
2424 private const string WindowsInstallScriptName = "dotnet-install.ps1" ;
2525
2626 private string installDirectory ;
27- private ISystemManagement systemManager ;
27+ private ISystemManagement systemManagement ;
2828 private IFileSystem fileSystem ;
2929
3030 /// <summary>
@@ -37,7 +37,7 @@ public class DotNetInstallation : VirtualClientComponent
3737 public DotNetInstallation ( IServiceCollection dependencies , IDictionary < string , IConvertible > parameters = null )
3838 : base ( dependencies , parameters )
3939 {
40- this . systemManager = this . Dependencies . GetService < ISystemManagement > ( ) ;
40+ this . systemManagement = this . Dependencies . GetService < ISystemManagement > ( ) ;
4141 this . fileSystem = this . Dependencies . GetService < IFileSystem > ( ) ;
4242
4343 this . installDirectory = this . PlatformSpecifics . Combine ( this . PlatformSpecifics . PackagesDirectory , "dotnet" ) ;
@@ -62,6 +62,8 @@ public string DotNetVersion
6262 /// </summary>
6363 protected override async Task ExecuteAsync ( EventContext telemetryContext , CancellationToken cancellationToken )
6464 {
65+ this . systemManagement . EnableLongPathInWindows ( ) ;
66+
6567 if ( ! this . fileSystem . Directory . Exists ( this . installDirectory ) )
6668 {
6769 this . fileSystem . Directory . CreateDirectory ( this . installDirectory ) ;
@@ -74,7 +76,7 @@ protected override async Task ExecuteAsync(EventContext telemetryContext, Cancel
7476
7577 if ( this . Platform == PlatformID . Unix )
7678 {
77- await this . systemManager . MakeFileExecutableAsync ( destinyFile , this . Platform , cancellationToken ) . ConfigureAwait ( false ) ;
79+ await this . systemManagement . MakeFileExecutableAsync ( destinyFile , this . Platform , cancellationToken ) . ConfigureAwait ( false ) ;
7880 await this . ExecuteCommandAsync ( destinyFile , this . GetInstallArgument ( ) , this . installDirectory , telemetryContext , cancellationToken ) . ConfigureAwait ( false ) ;
7981 }
8082 else
@@ -83,7 +85,7 @@ protected override async Task ExecuteAsync(EventContext telemetryContext, Cancel
8385 }
8486
8587 DependencyPath dotnetPackage = new DependencyPath ( this . PackageName , this . installDirectory , "DotNet SDK" , this . DotNetVersion ) ;
86- await this . systemManager . PackageManager . RegisterPackageAsync ( dotnetPackage , cancellationToken ) . ConfigureAwait ( false ) ;
88+ await this . systemManagement . PackageManager . RegisterPackageAsync ( dotnetPackage , cancellationToken ) . ConfigureAwait ( false ) ;
8789 }
8890
8991 private string GetInstallArgument ( )
@@ -107,7 +109,7 @@ private string GetInstallArgument()
107109 private async Task ExecuteCommandAsync ( string pathToExe , string commandLineArguments , string workingDirectory , EventContext telemetryContext , CancellationToken cancellationToken )
108110 {
109111 EventContext relatedContext = telemetryContext . Clone ( ) ;
110- using ( IProcessProxy process = this . systemManager . ProcessManager . CreateElevatedProcess ( this . Platform , pathToExe , commandLineArguments , workingDirectory ) )
112+ using ( IProcessProxy process = this . systemManagement . ProcessManager . CreateElevatedProcess ( this . Platform , pathToExe , commandLineArguments , workingDirectory ) )
111113 {
112114 this . CleanupTasks . Add ( ( ) => process . SafeKill ( ) ) ;
113115 this . Logger . LogTraceMessage ( $ "Executing process '{ pathToExe } ' '{ commandLineArguments } ' at directory '{ workingDirectory } '.", EventContext . Persisted ( ) ) ;
0 commit comments