Skip to content

Commit 5f935fe

Browse files
authored
Set up Windows installer build for the VMR (#58820)
1 parent d30d114 commit 5f935fe

File tree

5 files changed

+67
-24
lines changed

5 files changed

+67
-24
lines changed

Directory.Build.props

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,37 @@
242242
<ArchiveExtension Condition="'$(TargetOsName)' == 'win'">.zip</ArchiveExtension>
243243
</PropertyGroup>
244244

245+
<PropertyGroup>
246+
<OfficialBaseURL>https://dotnetcli.azureedge.net/dotnet/</OfficialBaseURL>
247+
<!-- Allow overriding the public base URL for Unified Build scenarios to pull assets from a local build. -->
248+
<PublicBaseURL Condition="'$(PublicBaseURL)' == ''">https://dotnetbuilds.azureedge.net/public/</PublicBaseURL>
249+
<InternalBaseURL>https://dotnetbuilds.azureedge.net/internal/</InternalBaseURL>
250+
<!-- Allow overriding where installers are pulled in from previously completed jobs in Unified Build scenarios. -->
251+
<CrossArchitectureInstallerBasePath Condition="'$(CrossArchitectureInstallerBasePath)' == ''">$(InstallersOutputPath)</CrossArchitectureInstallerBasePath>
252+
</PropertyGroup>
253+
254+
<!-- Try various places to find the runtime. It's either released (use official version),
255+
public but un-released (use dotnetbuilds/public), or internal and unreleased (use dotnetbuilds/internal) -->
256+
<ItemGroup Condition="'$(DotNetBuild) ' != 'true'">
257+
<RemoteAssetBaseURL Include="$(OfficialBaseURL)" />
258+
<RemoteAssetBaseURL Include="$(PublicBaseURL)" />
259+
<!-- Include the token here as we'll generate the URLs to download based on this item group. -->
260+
<RemoteAssetBaseURL Include="$(InternalBaseURL)"
261+
Condition=" '$(DotnetRuntimeSourceFeedKey)' != '' ">
262+
<token>$(DotnetRuntimeSourceFeedKey)</token>
263+
</RemoteAssetBaseURL>
264+
</ItemGroup>
265+
266+
<!--
267+
Only try downloading from the "public" base URL when doing a vertical build.
268+
In a vertical build, the public URL will be overwritten to point to local build artifacts.
269+
-->
270+
<ItemGroup Condition="'$(DotNetBuild)' == 'true'">
271+
<!-- MSBuild removes the '//' slashes when passing PublicBaseURL from the outer to the inner build. -->
272+
<RemoteAssetBaseURL Condition="$(PublicBaseURL.StartsWith('file:')) and '$(OS)' != 'Windows_NT'" Include="$([System.Text.RegularExpressions.Regex]::Replace('$(PublicBaseURL)', '%28file:\/{1,}%29%28.+%29', 'file:///%242'))" />
273+
<RemoteAssetBaseURL Condition="!$(PublicBaseURL.StartsWith('file:')) or '$(OS)' == 'Windows_NT'" Include="$(PublicBaseURL)" />
274+
</ItemGroup>
275+
245276
<PropertyGroup>
246277
<!-- PackageReadmeFile specifies the package readme file name in the package. PackageReadmeFilePath points to the package readme file on disk. -->
247278
<EnableDefaultPackageReadmeFile Condition="'$(EnableDefaultPackageReadmeFile)' == '' and '$(IsShipping)' != 'false'">true</EnableDefaultPackageReadmeFile>

eng/Build.props

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,13 @@
7171
</ItemGroup>
7272
</When>
7373
<Otherwise>
74-
<ItemGroup Condition=" '$(BuildInstallers)' == 'true' AND '$(TargetOsName)' == 'win' AND ('$(TargetArchitecture)' == 'x86' OR '$(TargetArchitecture)' == 'x64' OR '$(TargetArchitecture)' == 'arm64') ">
74+
<PropertyGroup>
75+
<_BuildWindowsInstallers Condition="'$(BuildInstallers)' == 'true' AND '$(TargetOsName)' == 'win' AND ('$(TargetArchitecture)' == 'x86' OR '$(TargetArchitecture)' == 'x64' OR '$(TargetArchitecture)' == 'arm64') ">true</_BuildWindowsInstallers>
76+
<_WixTargetPlatform Condition="'$(TargetArchitecture)' == 'x86' ">Win32</_WixTargetPlatform>
77+
<_WixTargetPlatform Condition="'$(TargetArchitecture)' == 'x64' ">x64</_WixTargetPlatform>
78+
<_WixTargetPlatform Condition="'$(TargetArchitecture)' == 'arm64' ">ARM64</_WixTargetPlatform>
79+
</PropertyGroup>
80+
<ItemGroup Condition="'$(DotNetBuild)' != 'true' and '$(_BuildWindowsInstallers)' == 'true' ">
7581
<!-- Build the ANCM custom action -->
7682
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\CustomAction\aspnetcoreCA.vcxproj" AdditionalProperties="Platform=x64" />
7783
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\CustomAction\aspnetcoreCA.vcxproj" AdditionalProperties="Platform=Win32" />
@@ -103,7 +109,26 @@
103109
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkLib\SharedFrameworkLib.wixproj" AdditionalProperties="Platform=x86" />
104110
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkLib\SharedFrameworkLib.wixproj" AdditionalProperties="Platform=arm64" />
105111

106-
<!-- Windows hosting bundled -->
112+
<!-- Windows hosting bundle -->
113+
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\WindowsHostingBundle\WindowsHostingBundle.wixproj" AdditionalProperties="Platform=x86" />
114+
</ItemGroup>
115+
116+
<!-- In a vertical build, only build the MSIs for the current vertical in the first pass and build the hosting bundle in the second pass -->
117+
<ItemGroup Condition="'$(DotNetBuild)' == 'true' and ('$(DotNetBuildPass)' == '' or '$(DotNetBuildPass)' == '1') and '$(_BuildWindowsInstallers)' == 'true'">
118+
<!-- Build the ANCM custom action -->
119+
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\CustomAction\aspnetcoreCA.vcxproj" AdditionalProperties="Platform=$(_WixTargetPlatform)" />
120+
<!-- Build the ANCM msis -->
121+
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMIISExpressV2\AncmIISExpressV2.wixproj" AdditionalProperties="Platform=$(_WixTargetPlatform)" />
122+
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMV2\ANCMV2.wixproj" AdditionalProperties="Platform=$(_WixTargetPlatform)" />
123+
<!-- Build the targeting pack installers -->
124+
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\TargetingPack\TargetingPack.wixproj" AdditionalProperties="Platform=$(_WixTargetPlatform)" />
125+
<!-- Build the SharedFramework installers -->
126+
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkBundle\SharedFrameworkBundle.wixproj" AdditionalProperties="Platform=$(_WixTargetPlatform)" />
127+
<!-- Build the SharedFramework wixlib -->
128+
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkLib\SharedFrameworkLib.wixproj" AdditionalProperties="Platform=$(_WixTargetPlatform)" />
129+
</ItemGroup>
130+
131+
<ItemGroup Condition="'$(DotNetBuild)' == 'true' and ('$(DotNetBuildPass)' == '2') and '$(BuildInstallers)' == 'true' AND '$(TargetOsName)' == 'win' and '$(TargetArchitecture)' == 'x64'">
107132
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\WindowsHostingBundle\WindowsHostingBundle.wixproj" AdditionalProperties="Platform=x86" />
108133
</ItemGroup>
109134

src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -556,16 +556,9 @@ This package is an internal implementation of the .NET Core SDK and is not meant
556556
Targets related to creating .zip/.tar.gz
557557
#########################################
558558
-->
559-
<Target Name="_DownloadAndExtractDotNetRuntime" Condition="'$(DotNetBuild)' != 'true'">
560-
<!-- Try various places to find the runtime. It's either released (use official version),
561-
public but un-released (use dotnetbuilds/public), or internal and unreleased (use dotnetbuilds/internal) -->
559+
<Target Name="_DownloadAndExtractDotNetRuntime">
562560
<ItemGroup>
563-
<UrisToDownload Include="https://dotnetcli.azureedge.net/dotnet/$(DotNetRuntimeDownloadPath)" />
564-
<UrisToDownload Include="https://dotnetbuilds.azureedge.net/public/$(DotNetRuntimeDownloadPath)" />
565-
<UrisToDownload Include="https://dotnetbuilds.azureedge.net/internal/$(DotNetRuntimeDownloadPath)"
566-
Condition=" '$(DotnetRuntimeSourceFeedKey)' != '' ">
567-
<token>$(DotnetRuntimeSourceFeedKey)</token>
568-
</UrisToDownload>
561+
<UrisToDownload Include="@(RemoteAssetBaseURL->'%(Identity)$(DotNetRuntimeDownloadPath)')" />
569562
</ItemGroup>
570563

571564
<DownloadFile Condition=" !Exists('$(DotNetRuntimeArchive)') "

src/Installers/Windows/WindowsHostingBundle/Product.targets

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,12 @@
7777

7878
<Target Name="FetchDependencies" BeforeTargets="Restore;CollectPackageReferences"
7979
Outputs="$(DepsPath)%(RemoteAsset.TargetFilename)">
80-
<!--
81-
Try various places to find the runtime. It's either released (use official version), public but
82-
unreleased (use dotnetbuilds/public), or internal and unreleased (use dotnetbuilds/internal).
83-
-->
80+
<PropertyGroup>
81+
<_CurrentRemoteAsset>%(RemoteAsset.Identity)</_CurrentRemoteAsset>
82+
</PropertyGroup>
8483
<ItemGroup>
8584
<UrisToDownload Remove="@(UrisToDownload)" />
86-
<UrisToDownload Include="https://dotnetcli.azureedge.net/dotnet/Runtime/%(RemoteAsset.Identity)" />
87-
<UrisToDownload Include="https://dotnetbuilds.azureedge.net/public/Runtime/%(RemoteAsset.Identity)" />
88-
<UrisToDownload Include="https://dotnetbuilds.azureedge.net/internal/Runtime/%(RemoteAsset.Identity)"
89-
Condition=" '$(DotnetRuntimeSourceFeedKey)' != '' ">
90-
<token>$(DotnetRuntimeSourceFeedKey)</token>
91-
</UrisToDownload>
85+
<UrisToDownload Include="@(RemoteAssetBaseURL->'%(Identity)Runtime/$(_CurrentRemoteAsset)')" />
9286
</ItemGroup>
9387

9488
<DownloadFile Condition=" ! Exists('$(DepsPath)%(RemoteAsset.TargetFilename)') "

src/Installers/Windows/WindowsHostingBundle/WindowsHostingBundle.wixproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,17 @@
104104
</PropertyGroup>
105105

106106
<ItemGroup>
107-
<SharedFxInstallers Include="$(InstallersOutputPath)$(RuntimeInstallerBaseName)-$(SharedFxMsiVersion)-win-x64.msi">
107+
<SharedFxInstallers Include="$(CrossArchitectureInstallerBasePath)$(RuntimeInstallerBaseName)-$(SharedFxMsiVersion)-win-x64.msi">
108108
<TargetPlatform>x64</TargetPlatform>
109109
<BundleNameProperty>SharedFxRedistInstallerx64</BundleNameProperty>
110110
<Version>$(SharedFxPackageVersion)</Version>
111111
</SharedFxInstallers>
112-
<SharedFxInstallers Include="$(InstallersOutputPath)$(RuntimeInstallerBaseName)-$(SharedFxMsiVersion)-win-x86.msi">
112+
<SharedFxInstallers Include="$(CrossArchitectureInstallerBasePath)$(RuntimeInstallerBaseName)-$(SharedFxMsiVersion)-win-x86.msi">
113113
<TargetPlatform>x86</TargetPlatform>
114114
<BundleNameProperty>SharedFxRedistInstallerx86</BundleNameProperty>
115115
<Version>$(SharedFxPackageVersion)</Version>
116116
</SharedFxInstallers>
117-
<SharedFxInstallers Include="$(InstallersOutputPath)$(RuntimeInstallerBaseName)-$(SharedFxMsiVersion)-win-arm64.msi">
117+
<SharedFxInstallers Include="$(CrossArchitectureInstallerBasePath)$(RuntimeInstallerBaseName)-$(SharedFxMsiVersion)-win-arm64.msi">
118118
<TargetPlatform>arm64</TargetPlatform>
119119
<BundleNameProperty>SharedFxRedistInstallerarm64</BundleNameProperty>
120120
<Version>$(SharedFxPackageVersion)</Version>

0 commit comments

Comments
 (0)