Skip to content

Commit a62b812

Browse files
WiX: Package the VC runtime dlls directly
* Package the VC runtime dlls directly * Make VC redist optional for build script backcompat. * Package VCRuntime using harvesting.
1 parent e91126f commit a62b812

File tree

5 files changed

+26
-11
lines changed

5 files changed

+26
-11
lines changed

platforms/Windows/bundle/installer.wixproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
<VCRedistDownloadUrl Condition=" '$(VCRedistDownloadUrl)' == '' AND '$(VSMajorVersion)' != '' ">https://aka.ms/vs/$(VSMajorVersion)/release/vc_redist.$(ProductArchitecture).exe</VCRedistDownloadUrl>
77
<DefineConstants>
88
$(DefineConstants);
9-
VCRedistInstaller=$(VCRedistInstaller);
10-
VCRedistDownloadUrl=$(VCRedistDownloadUrl);
119
INCLUDE_X86_SDK=$(INCLUDE_X86_SDK);
1210
INCLUDE_ARM64_SDK=$(INCLUDE_ARM64_SDK);
1311
</DefineConstants>

platforms/Windows/bundle/installer.wxs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,6 @@
5959
-->
6060

6161
<Chain>
62-
<?if $(VCRedistInstaller) != ""?>
63-
<BundlePackage
64-
SourceFile="$(VCRedistInstaller)"
65-
Permanent="yes"
66-
InstallArguments="/install /quiet /norestart"
67-
DownloadUrl="$(VCRedistDownloadUrl)">
68-
</BundlePackage>
69-
<?endif?>
70-
7162
<MsiPackage
7263
SourceFile="!(bindpath.rtl)\rtl.msi"
7364
DownloadUrl="$(BaseReleaseDownloadUrl)/{2}">

platforms/Windows/rtl/msi/rtlmsi.wixproj

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
<Project Sdk="WixToolset.Sdk/4.0.1">
22
<PropertyGroup>
33
<OutputName>rtl</OutputName>
4+
<DefineConstants>
5+
$(DefineConstants);
6+
VCRedistDir=$(VCRedistDir);
7+
</DefineConstants>
48
</PropertyGroup>
59

610
<ItemGroup Condition=" '$(ProductArchitecture)' == 'x86' ">
@@ -14,4 +18,19 @@
1418
<ItemGroup Condition=" '$(ProductArchitecture)' == 'arm64' ">
1519
<ProjectReference Include="..\lib\rtllib.wixproj" Properties="ProductArchitecture=arm64;Platform=arm64" />
1620
</ItemGroup>
21+
22+
<ItemGroup>
23+
<PackageReference Include="WixToolset.Heat" Version="4.0.1" />
24+
</ItemGroup>
25+
26+
<ItemGroup>
27+
<HarvestDirectory Include="$(VCRedistDir)">
28+
<ComponentGroupName>VCRuntime_$(ProductArchitecture)</ComponentGroupName>
29+
<DirectoryRefId>RUNTIMEDIR_$(ProductArchitecture)</DirectoryRefId>
30+
<PreprocessorVariable>var.VCRedistDir</PreprocessorVariable>
31+
<SuppressCom>true</SuppressCom>
32+
<SuppressRegistry>true</SuppressRegistry>
33+
<SuppressRootDirectory>true</SuppressRootDirectory>
34+
</HarvestDirectory>
35+
</ItemGroup>
1736
</Project>

platforms/Windows/rtl/msi/rtlmsi.wxs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
</Component>
2323
</ComponentGroup>
2424

25+
<Feature Id="VCRuntime" AllowAbsent="no" Title="!(loc.VCRuntime_ProductName_$(ProductArchitecture))">
26+
<ComponentGroupRef Id="VCRuntime_$(ProductArchitecture)" />
27+
</Feature>
28+
2529
<Feature Id="SwiftRuntime" AllowAbsent="no" Title="!(loc.Rtl_ProductName_$(ProductArchitecture))">
2630
<ComponentGroupRef Id="swift_runtime_$(ProductArchitecture)" />
2731
<ComponentGroupRef Id="EnvironmentVariables" />

platforms/Windows/shared/swift.en-us.wxl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
<String Id="Dbg_ProductName" Value="Swift Debugging Tools" />
88
<String Id="Ide_ProductName" Value="Swift IDE Integration Tools" />
99
<String Id="Rtl_ProductName" Value="Swift Windows Utilities" />
10+
<String Id="VCRuntime_ProductName_arm64" Value="Visual C++ Runtime (ARM64)" />
11+
<String Id="VCRuntime_ProductName_amd64" Value="Visual C++ Runtime (AMD64)" />
12+
<String Id="VCRuntime_ProductName_x86" Value="Visual C++ Runtime (X86)" />
1013
<String Id="Rtl_ProductName_arm64" Value="Swift Windows Utilities (ARM64)" />
1114
<String Id="Rtl_ProductName_amd64" Value="Swift Windows Utilities (AMD64)" />
1215
<String Id="Rtl_ProductName_x86" Value="Swift Windows Utilities (X86)" />

0 commit comments

Comments
 (0)