Skip to content

Change Windows installation instructions #361

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

Merged
merged 6 commits into from
Aug 21, 2023
Merged

Change Windows installation instructions #361

merged 6 commits into from
Aug 21, 2023

Conversation

libewa
Copy link
Contributor

@libewa libewa commented Aug 18, 2023

Motivation:

The Windows installation process errored out on my PC, complaining that start could not find the vs_community.exe file, which was however present after running ls.

Modifications:

  • Change the installation code block for Windows to not use start, but instead execute the installer directly.
  • Change the reference to the Microsoft Store from "App Store".

Result:

The installation instructions for Windows have changed to
a) not quit with an error
b) correctly reference the Microsoft Store

@alexandersandberg
Copy link
Member

cc: @compnerd

@stevapple
Copy link
Contributor

stevapple commented Aug 18, 2023

The Windows installation guide currently handles VS installation manually. We can leverage WinGet features instead:

winger install Microsoft.VisualStudio.2019.Community --force --custom "--add Microsoft.VisualStudio.Component.Windows10SDK.19041 --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64"

Breakdown:

  • The Microsoft.VisualStudio.2019.Community installer is exactly the latest version of https://aka.ms/vs/16/release/vs_community.exe;
  • --force ensures that the installer is run even when the latest VS is installed;
  • --custom passes the supplied flags to the installer, which will add the dependencies for us.

Such approach is much less error-prone as WinGet already counts for different environments (most notably, Powershell or CMD).

@stevapple
Copy link
Contributor

Also I feel that installing the community version of VS is a waste because Swift developers don't need the IDE stuff. Visual Studio C++ Build Tools (vs_buildtools.exe or Microsoft.VisualStudio.2019.BuildTools) is pretty enough.

@compnerd
Copy link
Member

@libewa did you run from cmd or powershell/pwsh? The expectation is that you are using the cmd shell. For automation, the use of start is important.

@stevapple yes, winget is the easier solution. Especially now that winget is a stub on Windows 11 that auto installs. Perhaps we should swap the order and direct people to the winget instructions?

Also, you are correct that the build tools are sufficient but there are questions around licensing. VS Community is permitted for use for many cases. The build tools require a license of Visual Studio and thus the installation of VS. The instructions seem complicated enough so I think that we should keep to the Visual Studio installation.

@libewa
Copy link
Contributor Author

libewa commented Aug 18, 2023

@compnerd I used pscore7, maybe that's the problem, but I'm going on holiday and can't try any of the solutions.
@stevapple sounds good, as we are installing deps with winget anyways. we should maybe add a note that winget comes preinstalled on win11.

@libewa
Copy link
Contributor Author

libewa commented Aug 18, 2023

also, maybe we should actually use cmd syntax highlighting instead of pwsh

--installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community" ^
--add Microsoft.VisualStudio.Component.Windows10SDK.19041 ^
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64
winget install Microsoft.VisualStudio.2019.Community --force --custom "--add Microsoft.VisualStudio.Component.Windows10SDK.19041 --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should just move this to VS2022 at this point and update the SDK to the latest.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a story for another pr imo

--installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community" ^
--add Microsoft.VisualStudio.Component.Windows10SDK.19041 ^
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64
winget install Microsoft.VisualStudio.2019.Community --force --custom "--add Microsoft.VisualStudio.Component.Windows10SDK.19041 --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alexandersandberg
Copy link
Member

@swift-ci please test

@alexandersandberg alexandersandberg enabled auto-merge (squash) August 19, 2023 09:45
@alexandersandberg
Copy link
Member

@swift-ci please test

@alexandersandberg alexandersandberg merged commit 70b753d into swiftlang:main Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants