Skip to content

WiX: package up the experimental dynamic SDK and the runtime redistributables #456

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions platforms/Windows/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@
WindowsRuntimeARM64=$(WindowsRuntimeARM64);
WindowsRuntimeX64=$(WindowsRuntimeX64);
WindowsRuntimeX86=$(WindowsRuntimeX86);
WindowsExperimentalRuntimeARM64=$(WindowsExperimentalRuntimeARM64);
WindowsExperimentalRuntimeX64=$(WindowsExperimentalRuntimeX64);
WindowsExperimentalRuntimeX86=$(WindowsExperimentalRuntimeX86);
</DefineConstants>
</PropertyGroup>

Expand Down
6 changes: 5 additions & 1 deletion platforms/Windows/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ItemGroup Condition="'$(MSBuildProjectName)' != 'shared' AND '$(MSBuildProjectName)' != 'rtllib' AND '$(MSBuildProjectName)' != 'rtlmsm'">
<PropertyGroup>
<RuntimePackages>;rtllib;rtlmsm;rtl.static.msm;rtl.shared.lib;rtl.shared.msm;</RuntimePackages>
</PropertyGroup>

<ItemGroup Condition=" ! $([System.String]::Copy('$(RuntimePackages)').Contains($(MSBuildProjectName))) ">
<ProjectReference Include="$(MSBuildThisFileDirectory)shared\shared.wixproj" />
</ItemGroup>

Expand Down
2 changes: 2 additions & 0 deletions platforms/Windows/SideBySideUpgradeStrategy.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<IdeAssertsUpgradeCode>{8DD91C86-D13D-490B-B06B-9522A9CF504C}</IdeAssertsUpgradeCode>
<IdeNoAssertsUpgradeCode>{C5519168-CF7B-4127-98B7-D886D9789B42}</IdeNoAssertsUpgradeCode>
<RtlUpgradeCode>{BEA8C6DC-F73E-445B-9486-2333D1CF2886}</RtlUpgradeCode>
<ExperimentalRTLUpgradeCode>{F9BA01C7-0C7C-4898-90BD-9D6BB308F0B3}</ExperimentalRTLUpgradeCode>
<AndroidPlatformUpgradeCode>{313B9C1F-D5B5-4FED-B7E0-138F1EE6B26A}</AndroidPlatformUpgradeCode>
<WindowsPlatformUpgradeCode>{01AFF1CF-A025-41B6-BCBC-728D794353FD}</WindowsPlatformUpgradeCode>
</PropertyGroup>
Expand Down Expand Up @@ -67,6 +68,7 @@
IdeAssertsUpgradeCode=$(IdeAssertsUpgradeCode);
IdeNoAssertsUpgradeCode=$(IdeNoAssertsUpgradeCode);
RtlUpgradeCode=$(RtlUpgradeCode);
ExperimentalRTLUpgradeCode=$(ExperimentalRTLUpgradeCode);
AndroidPlatformUpgradeCode=$(AndroidPlatformUpgradeCode);
WindowsPlatformUpgradeCode=$(WindowsPlatformUpgradeCode);
</DefineConstants>
Expand Down
4 changes: 4 additions & 0 deletions platforms/Windows/bundle/installer.wixproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
<ProjectReference Include="..\rtl\msi\rtlmsi.wixproj" BindName="rtl" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\rtl\shared\msi\rtl.shared.msi.wixproj" Properties="ProductArchitecture=$(ProductArchitecture)" BindName="rtl.shared" />
</ItemGroup>

<ItemGroup Condition=" $(Platforms.Contains('android')) ">
<ProjectReference Include="..\platforms\android\android.wixproj" Properties="AndroidArchitectures=$(AndroidArchitectures)" BindName="platform.android" />
</ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions platforms/Windows/platforms/windows/windows.wixproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,20 @@

<ItemGroup Condition=" $(WindowsArchitectures.Contains('i686')) ">
<ProjectReference Include="..\..\rtl\msm\rtlmsm.wixproj" Properties="Platform=x86;ProductArchitecture=x86" BindName="rtl.x86.msm" />
<ProjectReference Include="..\..\rtl\shared\msm\rtl.shared.msm.wixproj" Properties="Platform=x86;ProductArchitecture=x86" BindName="rtl.shared.x86.msm" />
<ProjectReference Include="..\..\rtl\static\msm\rtl.static.msm.wixproj" Properties="Platform=x86;ProductArchitecture=x86" BindName="rtl.static.x86.msm" />
</ItemGroup>

<ItemGroup Condition=" $(WindowsArchitectures.Contains('x86_64')) ">
<ProjectReference Include="..\..\rtl\msm\rtlmsm.wixproj" Properties="Platform=x86;ProductArchitecture=amd64" BindName="rtl.amd64.msm" />
<ProjectReference Include="..\..\rtl\shared\msm\rtl.shared.msm.wixproj" Properties="Platform=x86;ProductArchitecture=amd64" BindName="rtl.shared.amd64.msm" />
<ProjectReference Include="..\..\rtl\static\msm\rtl.static.msm.wixproj" Properties="Platform=x86;ProductArchitecture=amd64" BindName="rtl.static.amd64.msm" />
</ItemGroup>

<ItemGroup Condition=" $(WindowsArchitectures.Contains('aarch64')) ">
<ProjectReference Include="..\..\rtl\msm\rtlmsm.wixproj" Properties="Platform=x86;ProductArchitecture=arm64" BindName="rtl.arm64.msm" />
<ProjectReference Include="..\..\rtl\shared\msm\rtl.shared.msm.wixproj" Properties="Platform=x86;ProductArchitecture=arm64" BindName="rtl.shared.arm64.msm" />
<ProjectReference Include="..\..\rtl\static\msm\rtl.static.msm.wixproj" Properties="Platform=x86;ProductArchitecture=arm64" BindName="rtl.static.arm64.msm" />
</ItemGroup>

<ItemGroup>
Expand Down
996 changes: 995 additions & 1 deletion platforms/Windows/platforms/windows/windows.wxs

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions platforms/Windows/rtl/shared/lib/rtl.shared.lib.wixproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project Sdk="WixToolset.Sdk/4.0.5">
<PropertyGroup>
<OutputName>rtl.shared.$(ProductArchitecture)</OutputName>
<OutputType>Library</OutputType>
<BindFiles>true</BindFiles>
</PropertyGroup>
</Project>
123 changes: 123 additions & 0 deletions platforms/Windows/rtl/shared/lib/rtl.shared.lib.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Fragment>
<?if $(sys.BUILDARCH) == x64 ?>
<?define RuntimeDirectoryComponentGuidGenerationSeed = "E33B165B-8460-467D-ABCD-27EA8197A3CF" ?>
<?define RuntimeRoot = $(WindowsExperimentalRuntimeX64)?>
<?elseif $(sys.BUILDARCH) == arm64 ?>
<?define RuntimeDirectoryComponentGuidGenerationSeed = "BFFDD8F7-CC47-40CB-AF0E-095273FF10FC" ?>
<?define RuntimeRoot = $(WindowsExperimentalRuntimeARM64)?>
<?elseif $(sys.BUILDARCH) == x86 ?>
<?define RuntimeDirectoryComponentGuidGenerationSeed = "72064820-3795-4331-8CBD-FF1ABA7DAE7B" ?>
<?define RuntimeRoot = $(WindowsExperimentalRuntimeX86)?>
<?endif?>

<Directory Id="RUNTIMEDIR_$(ProductArchitecture)" ComponentGuidGenerationSeed="$(RuntimeDirectoryComponentGuidGenerationSeed)" />

<ComponentGroup Id="stdlib_$(ProductArchitecture)" Directory="RUNTIMEDIR_$(ProductArchitecture)">
<Component>
<File Source="$(RuntimeRoot)\usr\bin\swiftCore.dll" />
</Component>
<Component>
<File Source="$(RuntimeRoot)\usr\bin\swiftCRT.dll" />
</Component>
<Component>
<File Source="$(RuntimeRoot)\usr\bin\swiftDistributed.dll" />
</Component>
<Component>
<File Source="$(RuntimeRoot)\usr\bin\swiftObservation.dll" />
</Component>
<Component>
<File Source="$(RuntimeRoot)\usr\bin\swiftRegexBuilder.dll" />
</Component>
<Component>
<File Source="$(RuntimeRoot)\usr\bin\swiftRemoteMirror.dll" />
</Component>
<Component>
<File Source="$(RuntimeRoot)\usr\bin\swiftSwiftOnoneSupport.dll" />
</Component>
<Component>
<File Source="$(RuntimeRoot)\usr\bin\swiftSynchronization.dll" />
</Component>
<Component>
<File Source="$(RuntimeRoot)\usr\bin\swiftWinSDK.dll" />
</Component>
<Component>
<File Source="$(RuntimeRoot)\usr\bin\swift_Builtin_float.dll" />
</Component>
<Component>
<File Source="$(RuntimeRoot)\usr\bin\swift_Concurrency.dll" />
</Component>
<Component>
<File Source="$(RuntimeRoot)\usr\bin\swift_Differentiation.dll" />
</Component>
<Component>
<File Source="$(RuntimeRoot)\usr\bin\swift_RegexParser.dll" />
</Component>
<Component>
<File Source="$(RuntimeRoot)\usr\bin\swift_StringProcessing.dll" />
</Component>
<Component>
<File Source="$(RuntimeRoot)\usr\bin\swift_Volatile.dll" />
</Component>

<!-- TODO(compnerd) should we distribute the undecoration library in the runtime?
<Component Directory="_usr_bin" Id="swiftDemangle.dll">
<File Id="swiftDemangle.dll" Source="$(RuntimeRoot)\bin\swiftDemangle.dll" />
</Component>
-->
</ComponentGroup>

<ComponentGroup Id="BlocksRuntime_$(ProductArchitecture)" Directory="RUNTIMEDIR_$(ProductArchitecture)">
<Component>
<File Source="$(RuntimeRoot)\usr\bin\BlocksRuntime.dll" />
</Component>
</ComponentGroup>

<ComponentGroup Id="libdispatch_$(ProductArchitecture)" Directory="RUNTIMEDIR_$(ProductArchitecture)">
<Component>
<File Source="$(RuntimeRoot)\usr\bin\dispatch.dll" />
</Component>
<Component>
<File Source="$(RuntimeRoot)\usr\bin\swiftDispatch.dll" />
</Component>
</ComponentGroup>

<ComponentGroup Id="Foundation_$(ProductArchitecture)" Directory="RUNTIMEDIR_$(ProductArchitecture)">
<Component>
<File Source="$(RuntimeRoot)\usr\bin\Foundation.dll" />
</Component>
<Component>
<File Source="$(RuntimeRoot)\usr\bin\FoundationEssentials.dll" />
</Component>
<Component>
<File Source="$(RuntimeRoot)\usr\bin\FoundationInternationalization.dll" />
</Component>
<Component>
<File Source="$(RuntimeRoot)\usr\bin\FoundationNetworking.dll" />
</Component>
<Component>
<File Source="$(RuntimeRoot)\usr\bin\FoundationXML.dll" />
</Component>
<Component>
<File Source="$(RuntimeRoot)\usr\bin\_FoundationICU.dll" />
</Component>
</ComponentGroup>

<ComponentGroup Id="plutil_$(ProductArchitecture)" Directory="RUNTIMEDIR_$(ProductArchitecture)">
<Component>
<File Source="$(RuntimeRoot)\usr\bin\plutil.exe" />
</Component>
</ComponentGroup>

<ComponentGroup Id="swift_runtime_$(ProductArchitecture)">
<ComponentGroupRef Id="stdlib_$(ProductArchitecture)" />
<ComponentGroupRef Id="BlocksRuntime_$(ProductArchitecture)" />
<ComponentGroupRef Id="libdispatch_$(ProductArchitecture)" />
<ComponentGroupRef Id="Foundation_$(ProductArchitecture)" />
</ComponentGroup>

<ComponentGroup Id="swift_runtime_utilities_$(ProductArchitecture)">
<ComponentGroupRef Id="plutil_$(ProductArchitecture)" />
</ComponentGroup>
</Fragment>
</Wix>
36 changes: 36 additions & 0 deletions platforms/Windows/rtl/shared/msi/rtl.shared.msi.wixproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<Project Sdk="WixToolset.Sdk/4.0.5">
<PropertyGroup>
<OutputName>rtl.$(ProductArchitecture)</OutputName>
<DefineConstants>
$(DefineConstants);
VCRedistDir=$(VCRedistDir);
</DefineConstants>
</PropertyGroup>

<ItemGroup Condition=" '$(ProductArchitecture)' == 'amd64' ">
<ProjectReference Include="..\lib\rtl.shared.lib.wixproj" Properties="ProductArchitecture=amd64;Platform=x64" />
</ItemGroup>

<ItemGroup Condition=" '$(ProductArchitecture)' == 'arm64' ">
<ProjectReference Include="..\lib\rtl.shared.lib.wixproj" Properties="ProductArchitecture=arm64;Platform=arm64" />
</ItemGroup>

<ItemGroup Condition=" '$(ProductArchitecture)' == 'x86' ">
<ProjectReference Include="..\lib\rtl.shared.lib.wixproj" Properties="ProductArchitecture=x86;Platform=x86" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="WixToolset.Heat" Version="4.0.5" />
</ItemGroup>

<ItemGroup>
<HarvestDirectory Include="$(VCRedistDir)">
<ComponentGroupName>VCRuntime_$(ProductArchitecture)</ComponentGroupName>
<DirectoryRefId>RUNTIMEDIR_$(ProductArchitecture)</DirectoryRefId>
<PreprocessorVariable>var.VCRedistDir</PreprocessorVariable>
<SuppressCom>true</SuppressCom>
<SuppressRegistry>true</SuppressRegistry>
<SuppressRootDirectory>true</SuppressRootDirectory>
</HarvestDirectory>
</ItemGroup>
</Project>
40 changes: 40 additions & 0 deletions platforms/Windows/rtl/shared/msi/rtl.shared.msi.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Package
Language="1033"
Manufacturer="!(loc.ManufacturerName)"
Name="!(loc.Rtl_ProductName_$(ProductArchitecture))"
UpgradeCode="$(ExperimentalRTLUpgradeCode)"
Version="$(NonSemVerProductVersion)"
Scope="$(PackageScope)">

<Media Id="1" Cabinet="rtl.$(ProductArchitecture).cab" EmbedCab="$(ArePackageCabsEmbedded)" />

<WixVariable Id="SideBySidePackageUpgradeCode" Value="$(ExperimentalRTLUpgradeCode)" />
<FeatureGroupRef Id="SideBySideUpgradeStrategy" />

<!-- Point the RTL component group to the right directory. -->
<DirectoryRef Id="runtimes_usr_bin" />
<SetDirectory Id="RUNTIMEDIR_$(ProductArchitecture)" Value="[runtimes_usr_bin]" Sequence="first" />

<ComponentGroup Id="EnvironmentVariables" Directory="RUNTIMEDIR_$(ProductArchitecture)">
<Component Id="UserPathVariable" Condition="NOT ALLUSERS=1" Guid="bc309c80-221e-48db-b989-07157ac8f286">
<Environment Action="set" Name="Path" Part="last" Permanent="no" System="no" Value="[runtimes_usr_bin]" />
</Component>
</ComponentGroup>

<Feature Id="VCRuntime" AllowAbsent="no" Title="!(loc.VCRuntime_ProductName_$(ProductArchitecture))">
<ComponentGroupRef Id="VCRuntime_$(ProductArchitecture)" />
</Feature>

<Feature Id="SwiftRuntime" AllowAbsent="no" Title="!(loc.Rtl_ProductName_$(ProductArchitecture))">
<ComponentGroupRef Id="swift_runtime_$(ProductArchitecture)" />
<ComponentGroupRef Id="EnvironmentVariables" />
<ComponentGroupRef Id="VersionedDirectoryCleanup" />
</Feature>

<Feature Id="SwiftRuntimeUtilities" AllowAbsent="yes" Title="!(loc.Utl_ProductName_$(ProductArchitecture))">
<Level Condition="INSTALLUTILITIES = 0" Value="0" />
<ComponentGroupRef Id="swift_runtime_utilities_$(ProductArchitecture)" />
</Feature>
</Package>
</Wix>
18 changes: 18 additions & 0 deletions platforms/Windows/rtl/shared/msm/rtl.shared.msm.wixproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project Sdk="WixToolset.Sdk/4.0.5">
<PropertyGroup>
<OutputType>Module</OutputType>
<OutputName>rtl.shared.$(ProductArchitecture)</OutputName>
</PropertyGroup>

<ItemGroup Condition=" '$(ProductArchitecture)' == 'amd64' ">
<ProjectReference Include="..\lib\rtl.shared.lib.wixproj" Properties="ProductArchitecture=amd64;Platform=x64" />
</ItemGroup>

<ItemGroup Condition=" '$(ProductArchitecture)' == 'arm64' ">
<ProjectReference Include="..\lib\rtl.shared.lib.wixproj" Properties="ProductArchitecture=arm64;Platform=arm64" />
</ItemGroup>

<ItemGroup Condition=" '$(ProductArchitecture)' == 'x86' ">
<ProjectReference Include="..\lib\rtl.shared.lib.wixproj" Properties="ProductArchitecture=x86;Platform=x86" />
</ItemGroup>
</Project>
15 changes: 15 additions & 0 deletions platforms/Windows/rtl/shared/msm/rtl.shared.msm.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">

<?if $(sys.BUILDARCH) == x64 ?>
<?define ModuleId = "18546442-4BD6-4B39-B030-7B4F46CF07F8" ?>
<?elseif $(sys.BUILDARCH) == arm64 ?>
<?define ModuleId = "41013040-0B93-4BA0-8544-9437366AD3CF" ?>
<?elseif $(sys.BUILDARCH) == x86 ?>
<?define ModuleId = "B4250F08-F3A0-4A7A-A27D-24CC473D5F16" ?>
<?endif?>

<Module Guid="$(ModuleId)" Id="swift_runtime" Language="0" Version="$(NonSemVerProductVersion)">
<ComponentGroupRef Id="swift_runtime_$(ProductArchitecture)" />
<ComponentGroupRef Id="swift_runtime_utilities_$(ProductArchitecture)" />
</Module>
</Wix>
6 changes: 6 additions & 0 deletions platforms/Windows/rtl/static/msm/rtl.static.msm.wixproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project Sdk="WixToolset.Sdk/4.0.5">
<PropertyGroup>
<OutputType>Module</OutputType>
<OutputName>rtl.static.$(ProductArchitecture)</OutputName>
</PropertyGroup>
</Project>
28 changes: 28 additions & 0 deletions platforms/Windows/rtl/static/msm/rtl.static.msm.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">

<?if $(sys.BUILDARCH) == x86 ?>
<?define RuntimeDirectoryComponentGuidGenerationSeed = "D3021274-DCA3-4369-82D3-B6CEE436A3FC" ?>
<?define ModuleID = "53C54287-A59A-4828-A526-4F64E00B340E" ?>
<?define RuntimeRoot = $(WindowsExperimentalRuntimeX64)?>
<?elseif $(sys.BUILDARCH) == x64 ?>
<?define RuntimeDirectoryComponentGuidGenerationSeed = "639A8564-3505-4424-BA2F-449AAF743A90" ?>
<?define ModuleID = "F84DDCA4-72B0-42AB-9316-21DBAB241540" ?>
<?define RuntimeRoot = $(WindowsExperimentalRuntimeARM64)?>
<?elseif $(sys.BUILDARCH) == arm64 ?>
<?define RuntimeDirectoryComponentGuidGenerationSeed = "F8BF026F-8E3F-42B5-A5E7-E0A4D186EDF3" ?>
<?define ModuleID = "0439EF46-C6C2-43DF-A5A7-8F4C3F5C64A7" ?>
<?define RuntimeRoot = $(WindowsExperimentalRuntimeX86)?>
<?endif?>

<Module Guid="$(ModuleID)" Id="swift_runtime" Language="0" Version="$(NonSemVerProductVersion)">
<Directory Id="RUNTIMEDIR_$(ProductArchitecture)" ComponentGuidGenerationSeed="$(RuntimeDirectoryComponentGuidGenerationSeed)">
<Component Id="BlocksRuntime_$(ProductArchitecture)">
<File Source="$(RuntimeRoot)\usr\bin\BlocksRuntime.dll" />
</Component>

<Component Id="libdispatch_$(ProductArchitecture)">
<File Source="$(RuntimeRoot)\usr\bin\dispatch.dll" />
</Component>
</Directory>
</Module>
</Wix>