@@ -313,7 +313,7 @@ static MSVC_AUTO_INSTALL_MESSAGE: &str = r#"# Rust Visual C++ prerequisites
313
313
314
314
Rust requires a linker and Windows API libraries but they don't seem to be available.
315
315
316
- These components can be acquired by installing Visual Studio.
316
+ These components can be acquired through a Visual Studio installer .
317
317
318
318
"# ;
319
319
@@ -376,37 +376,38 @@ pub(crate) fn install(
376
376
warn ! ( "installing msvc toolchain without its prerequisites" ) ;
377
377
} else if !quiet && plan == VsInstallPlan :: Automatic {
378
378
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 ( ) ?;
390
393
return Ok ( utils:: ExitCode ( 0 ) ) ;
391
394
}
395
+ _ => { }
392
396
}
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" ) ;
395
402
return Ok ( utils:: ExitCode ( 0 ) ) ;
396
403
}
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 ) ) ;
404
404
}
405
+ None => { }
405
406
}
406
407
} else {
407
408
md ( & mut term, MSVC_MESSAGE ) ;
408
409
md ( & mut term, MSVC_MANUAL_INSTALL_MESSAGE ) ;
409
- if !common:: confirm ( "\n Continue? (y/N) " , false ) ? {
410
+ if !common:: question_bool ( "\n Continue?" , false ) ? {
410
411
info ! ( "aborting installation" ) ;
411
412
return Ok ( utils:: ExitCode ( 0 ) ) ;
412
413
}
0 commit comments