@@ -89,7 +89,6 @@ public static void SetupConfiguration(IList<string> args, ChocolateyConfiguratio
89
89
SetGlobalOptions ( args , config , container ) ;
90
90
SetEnvironmentOptions ( config ) ;
91
91
EnvironmentSettings . SetEnvironmentVariables ( config ) ;
92
- SetProxyOptions ( config , container ) ;
93
92
// must be done last for overrides
94
93
SetLicensedOptions ( config , license , configFileSettings ) ;
95
94
// save all changes if there are any
@@ -464,53 +463,6 @@ private static void SetGlobalOptions(IList<string> args, ChocolateyConfiguration
464
463
} ) ;
465
464
}
466
465
467
- private static void SetProxyOptions ( ChocolateyConfiguration config , Container container )
468
- {
469
- // Evaluation order of Proxy settings: System Set -> Environment Variable Set -> Chocolatey Configuration File Set -> CLI Passed in Argument
470
- var proxyAlreadySet = ! string . IsNullOrWhiteSpace ( config . Proxy . Location ) ;
471
- var onWindows = Platform . GetPlatform ( ) == PlatformType . Windows ;
472
-
473
- // Only Windows has a registry provider, if it's already set, or we're not on Windows we don't need to continue.
474
- if ( proxyAlreadySet || ! onWindows )
475
- {
476
- return ;
477
- }
478
-
479
- // We don't yet have a Proxy Location, check if the system has one configured in the registry
480
- var registryService = container . GetInstance < IRegistryService > ( ) ;
481
- var internetSettingsRegKey = registryService . GetKey ( RegistryHive . CurrentUser , "SOFTWARE\\ Microsoft\\ Windows\\ CurrentVersion\\ Internet Settings" ) ;
482
-
483
- if ( ! internetSettingsRegKey . GetValue ( "ProxyEnable" ) . ToStringSafe ( ) . IsEqualTo ( "1" ) )
484
- {
485
- return ;
486
- }
487
-
488
- var proxySetting = internetSettingsRegKey . GetValue ( "ProxyServer" ) . ToStringSafe ( ) ;
489
-
490
- if ( string . IsNullOrWhiteSpace ( proxySetting ) )
491
- {
492
- return ;
493
- }
494
-
495
- if ( proxySetting . IndexOf ( ';' ) != - 1 )
496
- {
497
- var allProxies = proxySetting . Split ( ';' ) ;
498
- proxySetting = allProxies . FirstOrDefault ( s => s . TrimSafe ( ) . StartsWith ( "https=" ) ) ;
499
-
500
- if ( string . IsNullOrWhiteSpace ( proxySetting ) )
501
- {
502
- proxySetting = allProxies . FirstOrDefault ( s => s . TrimSafe ( ) . StartsWith ( "http=" ) ) ;
503
- }
504
- }
505
-
506
- if ( proxySetting ? . IndexOf ( '=' ) != - 1 && ! proxySetting . StartsWith ( "http" ) )
507
- {
508
- return ;
509
- }
510
-
511
- config . Proxy . Location = proxySetting . Split ( '=' ) . LastOrDefault ( ) ;
512
- }
513
-
514
466
private static void SetEnvironmentOptions ( ChocolateyConfiguration config )
515
467
{
516
468
config . Information . PlatformType = Platform . GetPlatform ( ) ;
0 commit comments