@@ -313,7 +313,7 @@ static MSVC_AUTO_INSTALL_MESSAGE: &str = r#"# Rust Visual C++ prerequisites
313313
314314Rust requires a linker and Windows API libraries but they don't seem to be available.
315315
316- These components can be acquired by installing Visual Studio.
316+ These components can be acquired through a Visual Studio installer .
317317
318318"# ;
319319
@@ -376,37 +376,38 @@ pub(crate) fn install(
376376 warn ! ( "installing msvc toolchain without its prerequisites" ) ;
377377 } else if !quiet && plan == VsInstallPlan :: Automatic {
378378 md ( & mut term, MSVC_AUTO_INSTALL_MESSAGE ) ;
379- if common:: confirm (
380- "\n Automatically download and install Visual Studio 2022 Community edition? (Y/n)" ,
381- true ,
382- ) ? {
383- match try_install_msvc ( & opts) {
384- Err ( e) => {
385- // Make sure the console doesn't exit before the user can
386- // see the error and give the option to continue anyway.
387- report_error ( & e) ;
388- if !common:: confirm ( "\n Continue installing rustup? (y/N)" , false ) ? {
389- info ! ( "aborting installation" ) ;
379+ match windows:: choose_vs_install ( ) ? {
380+ Some ( VsInstallPlan :: Automatic ) => {
381+ match try_install_msvc ( & opts) {
382+ Err ( e) => {
383+ // Make sure the console doesn't exit before the user can
384+ // see the error and give the option to continue anyway.
385+ report_error ( & e) ;
386+ if !common:: question_bool ( "\n Continue?" , false ) ? {
387+ info ! ( "aborting installation" ) ;
388+ return Ok ( utils:: ExitCode ( 0 ) ) ;
389+ }
390+ }
391+ Ok ( ContinueInstall :: No ) => {
392+ ensure_prompt ( ) ?;
390393 return Ok ( utils:: ExitCode ( 0 ) ) ;
391394 }
395+ _ => { }
392396 }
393- Ok ( ContinueInstall :: No ) => {
394- ensure_prompt ( ) ?;
397+ }
398+ Some ( VsInstallPlan :: Manual ) => {
399+ md ( & mut term, MSVC_MANUAL_INSTALL_MESSAGE ) ;
400+ if !common:: question_bool ( "\n Continue?" , false ) ? {
401+ info ! ( "aborting installation" ) ;
395402 return Ok ( utils:: ExitCode ( 0 ) ) ;
396403 }
397- _ => { }
398- }
399- } else {
400- md ( & mut term, MSVC_MANUAL_INSTALL_MESSAGE ) ;
401- if !common:: confirm ( "\n Continue? (y/N)" , false ) ? {
402- info ! ( "aborting installation" ) ;
403- return Ok ( utils:: ExitCode ( 0 ) ) ;
404404 }
405+ None => { }
405406 }
406407 } else {
407408 md ( & mut term, MSVC_MESSAGE ) ;
408409 md ( & mut term, MSVC_MANUAL_INSTALL_MESSAGE ) ;
409- if !common:: confirm ( "\n Continue? (y/N) " , false ) ? {
410+ if !common:: question_bool ( "\n Continue?" , false ) ? {
410411 info ! ( "aborting installation" ) ;
411412 return Ok ( utils:: ExitCode ( 0 ) ) ;
412413 }
0 commit comments