-
Notifications
You must be signed in to change notification settings - Fork 1k
Visual Studio prerequisites changes #4676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- remove the extra check if Visual Studio Installer is installed (the download is only 4mb and it will try update the the VS Installer.) - update manual download link and infos
- winget command line to install (but gui install because of license agreement)
|
@pino1536 Oh, I didn't notice the license change until today. Thanks for pointing it out! @ChrisDenton this should be a good opportunity for us in this regard I guess? We don't really want the user to accept the VS Community license just to fetch
|
| Once you've downloaded and started the installer, the easiest way to get everything installed is to select "Desktop Development with C++". | ||
| This will include the necessary components. | ||
| On the "Language Packs" tab, make sure the English language pack is installed in addition to your preferred language. | ||
| But you could [download the Microsoft Build Tools for Visual Studio][vs download] Installer yourself and do the same steps manual. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| But you could [download the Microsoft Build Tools for Visual Studio][vs download] Installer yourself and do the same steps manual. | |
| But you could [download the Microsoft Build Tools for Visual Studio][vs download] Installer yourself and do the same steps manually. |
| However this requires you already have a license to the Community, Professional or Enterprise edition. | ||
| If you chose the automatic install this winget command will run in the background: | ||
| ```Batchfile | ||
| winget install --id Microsoft.VisualStudio.BuildTools --force --interactive --custom "--focusedUi --addProductLang En-us --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows11SDK.26100" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question regarding #4543: will the wrong --add params causing the whole command to fail?
The thing is that Microsoft, as it turned out, can remove any of those components from its server, meaning that these versions might no longer be valid a while later. However, if this is not a fatal error (meaning the GUI launches correctly and the user can tick the missing boxes manually) then this would be less of a problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but this was also a problem before (the vs installer is the same) and it only affects Windows 11 sdk. the "Microsoft.VisualStudio.Component.VC.Tools.x86.x64" is always the lasted version.
The best way would be to simple update the "Windows 11 SDK" it in the tool periodical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this is a problem currently which is why we're looking into mitigations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this is a problem currently which is why we're looking into mitigations.
There are another 2 options:
- We could get the SDK via winget (its not a part of the Visual Studio licens):
winget install --id Microsoft.WindowsSDK.10.0.26100
- We could export a json file with all available components to parse the last version:
Microsoft Visual Studio\Installer\setup.exe export --productId Microsoft.VisualStudio.Product.BuildTools --channelId VisualStudio.18.Release --config "%UserProfile%\Desktop\temp.vsconfig" --all --quiet```There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we use winget then doing a search for the latest would be best (we can use the version field to filter it).
Using the json from the VS installer would be better in a sense because then we can be sure the it will show up labelled as installed when someone is attempting to debug issues. But I do worry that the json may not be stable between Visual Studio versions. That could be mitigated by ensuring we use a defined version.
|
|
||
| // Run the installer. Arguments are documented at: | ||
| // https://docs.microsoft.com/en-us/visualstudio/install/use-command-line-parameters-to-install-visual-studio | ||
| let mut cmd = Command::new("winget"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is winget a component that comes with all supported Windows installations? Please note that we are currently stating support for Windows 10/2026 or later.
If this is not the case, maybe we should notify the user and provide an installation hint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it comes with every Windows 10 and 11 pre installed. In many cases Microsoft uses it itself for many things. (you can see it because many auto installed stuff comes with the install source winget) and you can find everything official through winget.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not with every SKU. E.g. Windows Sandbox does not have it installed by default. I'm not entirely against using winget here but I also don't think it get us anything useful. The aka.ms links always work.
The license change does not affect us because we use link.exe to directly develop software. Basically you can substitute "Rust" for "C++" in that blog post. This was investigated at the time and we got an official response from Microsoft in 2023. |
| If you want more details on the installation process or want to further customize the install then follow the walkthrough below. | ||
| Otherwise complete the Visual Studio install and continue with installing Rust. | ||
|
|
||
| ## Walkthrough: Installing Visual Studio 2022 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think we should remove the GUI instructions, especially as it's the main user interface for the Visual Studio installer. If it's confusing we should improve that. If other installation methods are better then we should add those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But to be honest if someone cant use the installer and find the, in text form described, components he is on the level of my grandma using a computer 😬
I even would remove the license part... somehow there isn't even a way around other then to accept them.
And somehow I wanted to clarify that it would be better to use the new auto installer because unlike other examples it does the exact same (but guided) as you would do manual.
For me as a complete newcomer to rust (one week), the documentation only to get rustup ready, splatted over 3 documentations was a bit too much for these little requirements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to read it all. We can add a command line section before the full GUI instructions. The reason it was added in the first place is because people do indeed struggle with it.
|
As I mentioned above, I tested nearly every case:
For the last Test: In most cases the Visual Studio Build Tools are installed instead of the full IDE if you use other dev environments like Flutter etc. Somehow it even better in any case to install the Components as a part of the "Visual Studio Build Tools" instead to add it to "Visual Studio Community". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've stated this a few times but I do want to be absolutely clear because I consider this a blocker:
For licensing reasons we cannot recommend the build tools nor install them by default unless the user already has Visual Studio installed. We could suggest it as an alternative, so long as we're clear on the licensing requirements. Or we could perhaps allow users to select their Visual Studio edition.

rustup auto install script:
winget is very stable and the download is official maintained by microsoft and used official
This is simple not necessary or brings any negative aspect. The download is only 4mb and it will try update the the VS Installer but don't change any installations. Its a indented and the reason why the VS Installer-Installer itself can take setup arguments.
documentation
maybe it shouldn't even have an extra site for a step you can do in a single command-line.
Was very confusing, reads like you're installing the entire IDE.
To the license thing of the build tools:
First of all they are indented to be used outside of an whole VS IDE. Official VSCode advertising it for the C#/C++ programming. Just like "Visual Studio Community", where you don't need an account or anything, the "Build Tools for Visual Studio" is also a Visual Studio Product itself where you "get an free license" by agree to it. The winget download runs the installer in gui mode and the user has to accept the license itself.