Skip to content

Commit

Permalink
Use Arcade's DownloadFile in Windows hosting bundle
Browse files Browse the repository at this point in the history
- was still trying to use our version
  • Loading branch information
dougbu committed Nov 9, 2022
1 parent ada3d82 commit 2dea6cd
Showing 1 changed file with 44 additions and 20 deletions.
64 changes: 44 additions & 20 deletions src/Installers/Windows/WindowsHostingBundle/Product.targets
Original file line number Diff line number Diff line change
Expand Up @@ -26,33 +26,57 @@
</ItemGroup>

<Target Name="FetchDependencies" BeforeTargets="Restore;CollectPackageReferences">
<!-- Use the BrowserDebugHost as a sentinel for the nonshipping version for NETCoreApp. -->
<PropertyGroup>
<DotNetAssetRootUrl Condition=" '$(DotNetAssetRootUrl)' == '' ">https://dotnetcli.azureedge.net/dotnet/</DotNetAssetRootUrl>
<DotNetAssetRootUrl Condition=" ! $(DotNetAssetRootUrl.EndsWith('/'))">$(DotNetAssetRootUrl)/</DotNetAssetRootUrl>
<DotNetPrivateAssetRootUrl Condition=" '$(DotNetPrivateAssetRootUrl)' == '' ">https://dotnetclimsrc.azureedge.net/dotnet/</DotNetPrivateAssetRootUrl>
<DotNetPrivateAssetRootUrl Condition=" ! $(DotNetPrivateAssetRootUrl.EndsWith('/'))">$(DotNetPrivateAssetRootUrl)/</DotNetPrivateAssetRootUrl>
<x64RemoteAsset>Runtime/$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.exe</x64RemoteAsset>
<x64RemoteAssetFileName>dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.exe</x64RemoteAssetFileName>
<x86RemoteAsset>Runtime/$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.exe</x86RemoteAsset>
<x86RemoteAssetFileName>dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.exe</x86RemoteAssetFileName>
<arm64RemoteAsset>Runtime/$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.exe</arm64RemoteAsset>
<arm64RemoteAssetFileName>dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.exe</arm64RemoteAssetFileName>
</PropertyGroup>

<!-- Use the BrowserDebugHost as a sentinel for the nonshipping version for NETCoreApp. -->
<MakeDir Directories="$(DepsPath)" />

<!-- Try various places to find the installers. It's either released (use official version),
public but un-released (use dotnetbuilds/public), or internal and unreleased (use dotnetbuilds/internal) -->
<ItemGroup>
<RemoteAsset Include="Runtime/$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.exe">
<TargetFileName>dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.exe</TargetFileName>
</RemoteAsset>
<RemoteAsset Include="Runtime/$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.exe">
<TargetFileName>dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.exe</TargetFileName>
</RemoteAsset>
<RemoteAsset Include="Runtime/$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.exe">
<TargetFileName>dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.exe</TargetFileName>
</RemoteAsset>
<UrisToDownload Include="https://dotnetcli.azureedge.net/dotnet/Runtime/$(x64RemoteAsset)" />
<UrisToDownload Include="https://dotnetbuilds.azureedge.net/public/$(x64RemoteAsset)" />
<UrisToDownload Include="https://dotnetbuilds.azureedge.net/internal/$(x64RemoteAsset)">
<token>$(DotnetRuntimeSourceFeedKey)</token>
</UrisToDownload>
</ItemGroup>

<MakeDir Directories="$(DepsPath)" />
<DownloadFile Condition=" ! Exists('$(DepsPath)$(x64RemoteAssetFileName)') "
Uris="@(UrisToDownload)"
DestinationPath="$(DepsPath)$(x64RemoteAssetFileName)" />

<ItemGroup>
<UrisToDownload Remove="@(UrisToDownload)" />
<UrisToDownload Include="https://dotnetcli.azureedge.net/dotnet/Runtime/$(x86RemoteAsset)" />
<UrisToDownload Include="https://dotnetbuilds.azureedge.net/public/$(x86RemoteAsset)" />
<UrisToDownload Include="https://dotnetbuilds.azureedge.net/internal/$(x86RemoteAsset)">
<token>$(DotnetRuntimeSourceFeedKey)</token>
</UrisToDownload>
</ItemGroup>

<DownloadFile Condition=" ! Exists('$(DepsPath)$(x86RemoteAssetFileName)') "
Uris="@(UrisToDownload)"
DestinationPath="$(DepsPath)$(x86RemoteAssetFileName)" />

<ItemGroup>
<UrisToDownload Remove="@(UrisToDownload)" />
<UrisToDownload Include="https://dotnetcli.azureedge.net/dotnet/Runtime/$(arm64RemoteAsset)" />
<UrisToDownload Include="https://dotnetbuilds.azureedge.net/public/$(arm64RemoteAsset)" />
<UrisToDownload Include="https://dotnetbuilds.azureedge.net/internal/$(arm64RemoteAsset)">
<token>$(DotnetRuntimeSourceFeedKey)</token>
</UrisToDownload>
</ItemGroup>

<DownloadFile Condition=" ! Exists('$(DepsPath)%(RemoteAsset.TargetFileName)') "
Uri="$(DotNetAssetRootUrl)%(RemoteAsset.Identity)"
PrivateUri="$(DotNetPrivateAssetRootUrl)%(RemoteAsset.Identity)"
PrivateUriSuffix="$(DotNetAssetRootAccessTokenSuffix)"
DestinationPath="$(DepsPath)%(RemoteAsset.TargetFileName)" />
<DownloadFile Condition=" ! Exists('$(DepsPath)$(arm64RemoteAssetFileName)') "
Uris="@(UrisToDownload)"
DestinationPath="$(DepsPath)$(arm64RemoteAssetFileName)" />
</Target>

<Target Name="ExtractPropertiesFromDotNetMsi" DependsOnTargets="FetchDependencies" BeforeTargets="BeforeBuild">
Expand Down

0 comments on commit 2dea6cd

Please sign in to comment.