swiftlang / swift-installer-scripts

Apache License 2.0
73 stars 35 forks source link

Install the VC++ redistributable as part of the Swift toolchain installer #250

Closed tristanlabelle closed 11 months ago

tristanlabelle commented 11 months ago

Packages the VC++ redistributable and installs it as part of the toolchain install on Windows, since this is a dependency. Note that this will pop a UAC prompt because that installer is per-machine.

This is the Microsoft-recommended approach: run the vcredist installer to install it globally (which makes it serviceable by microsoft), and don't uninstall it when uninstalling the toolchain since other apps may depend on it.

This requires build script changes to take effect, but is backwards compatible with build scripts that don't specify the new properties.

I consciously departed from ALL_CAPS naming of properties because the MSBuild standard is PascalCase and the logic in installer.wixproj was looking really ugly otherwise.

How tested:

Built with and without build script changes, uninstalled the VC runtime, installed the Swift toolchain, and verified that the VC runtime was installed in Add/Remove programs:

image

image
compnerd commented 11 months ago

All uppercase names are public properties, the pascal case variables are private.

compnerd commented 11 months ago

Tested at https://github.com/apple/swift/pull/69182 - https://ci-external.swift.org/job/swift-PR-build-toolchain-windows/947/

compnerd commented 11 months ago

We should backport this to 5.10

compnerd commented 11 months ago

https://github.com/apple/swift-installer-scripts/pull/251