Skip to content

Package the VC runtime dlls directly #256

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 3 commits into from
Nov 30, 2023
Merged

Package the VC runtime dlls directly #256

merged 3 commits into from
Nov 30, 2023

Conversation

tristanlabelle
Copy link
Contributor

@tristanlabelle tristanlabelle commented Oct 31, 2023

The Swift runtime depends on the Visual C++ runtime. We currently call the vcredist.exe installer, as recommended by Microsoft, but this is a per-machine installer so it makes our per-user installer require elevation. I tried switching to using the vcredist merge modules, but they seem to reference machine-global paths like System64 and it causes build errors. We're left with the option to package the vcruntime dlls directly in the msi. We're not including them in the Swift runtime msm's since application developers may choose to distribute their vcruntime differently.

The new VCRedistDir property is optional so that this remains backwards compatible with build scripts that don't specify it.

Result:
image

@tristanlabelle tristanlabelle marked this pull request as ready for review October 31, 2023 18:10
@compnerd
Copy link
Member

CC: @barnson (in case he has any suggestions here)

@barnson
Copy link
Contributor

barnson commented Oct 31, 2023

Perfectly valid lifestyle choice: https://learn.microsoft.com/en-us/cpp/windows/deployment-in-visual-cpp?view=msvc-170#local-deployment The biggest downside, other than the theoretical pain of having to service the DLLs yourselves, is having multiple copies of the DLLs if you have executables in multiple directories. (WiX uses static linking in Burn and custom actions to avoid needing to bootstrap the runtime.)

@tristanlabelle
Copy link
Contributor Author

I'm now using harvesting to make sure we capture all redistributable dlls. Ping for a review!

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.

3 participants