off to avoid producing redundant packages.
-->
<BuildDistroIndependentInstallers Condition="'$(BuildDistroIndependentInstallers)' == ''">true</BuildDistroIndependentInstallers>
+
+ <WixVersion>3.10.4</WixVersion>
+ <WixToolsDir>$(IntermediateOutputRootPath)WixTools.$(WixVersion)/</WixToolsDir>
+ <!-- Used in WiX targets to locate files. -->
+ <WixInstallPath>$(WixToolsDir)</WixInstallPath>
+ <WixTargetsPath>$(WixToolsDir)wix.targets</WixTargetsPath>
+ <WixObjRoot>$(IntermediateOutputRootPath)wix/</WixObjRoot>
+ <WixObjDir>$(WixObjRoot)$(MSBuildProjectName)/</WixObjDir>
+ <MsiArch>$(TargetArchitecture)</MsiArch>
+ <MicrosoftEulaFile>$(MSBuildThisFileDirectory)packaging/windows/eula.rtf</MicrosoftEulaFile>
+
+ <GenerateMSI>true</GenerateMSI>
+ <GenerateMSI Condition="'$(TargetArchitecture)' == 'arm' or '$(TargetArchitecture)' == 'arm64'">false</GenerateMSI>
+ <GenerateMSI Condition="'$(OSGroup)' != 'Windows_NT'">false</GenerateMSI>
+ </PropertyGroup>
+
+ <PropertyGroup>
+ <ProductBrandPrefix Condition="'$(ProductBrandPrefix)' == ''">Microsoft .NET Core</ProductBrandPrefix>
+ <ProductBrandSuffix>$(ProductionVersion)</ProductBrandSuffix>
+ <ProductBrandSuffix Condition="'$(ReleaseBrandSuffix)'!=''">$(ProductionVersion) $(ReleaseBrandSuffix)</ProductBrandSuffix>
+ <SharedHostBrandName>$(ProductBrandPrefix) Host - $(ProductBrandSuffix)</SharedHostBrandName>
+ <HostFxrBrandName>$(ProductBrandPrefix) Host FX Resolver - $(ProductBrandSuffix)</HostFxrBrandName>
+ <TargetingPackBrandName>$(ProductBrandPrefix) Targeting Pack - $(ProductBrandSuffix)</TargetingPackBrandName>
+ <SharedFrameworkBrandName>$(ProductBrandPrefix) Runtime - $(ProductBrandSuffix)</SharedFrameworkBrandName>
</PropertyGroup>
<ItemGroup>
<RuntimeIdGraphDefinitionFile>$(PackagesDir)$(PlatformPackageId.ToLowerInvariant())\$(MicrosoftNETCorePlatformsPackageVersion)\runtime.json</RuntimeIdGraphDefinitionFile>
</PropertyGroup>
+ <UsingTask TaskName="DownloadFilesFromUrl" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll" />
+ <UsingTask TaskName="ZipFileExtractToDirectory" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll"/>
+
+ <UsingTask TaskName="GenerateGuidFromName" AssemblyFile="$(LocalBuildToolsTaskDir)core-setup.tasks.dll" />
+ <UsingTask TaskName="GenerateMsiVersion" AssemblyFile="$(LocalBuildToolsTaskDir)core-setup.tasks.dll" />
+
<!-- Create deb tool package and set up the project that consumes it as a CLI tool. -->
<Target Name="InitializeDotnetDebTool">
<!--
Text="FPM tool Not found, RPM packages will not be built."
Importance="High" />
</Target>
+
+ <!--
+ Acquire WiX tools, if not present.
+
+ Adapted from https://github.com/dotnet/core-sdk/blob/6aed0cd3614f9b740cfb3f21fdb795bab53ef7e9/src/redist/targets/GenerateMSIs.targets#L80-L102
+ -->
+ <Target Name="AcquireWix"
+ DependsOnTargets="GetAcquireWixProperties"
+ Condition="'$(GenerateMSI)' == 'true'"
+ Inputs="$(WixDownloadSentinel)"
+ Outputs="$(WixDestinationPath)">
+ <!-- Setup sentinel to take advantage of incrementality -->
+ <MakeDir Directories="$(WixToolsDir)" />
+ <WriteLinesToFile
+ File="$(WixDownloadSentinel)"
+ Lines="$(WixVersion)"
+ Overwrite="true"
+ Encoding="Unicode" />
+
+ <ItemGroup>
+ <_wixToolDownload
+ Include="WixTool"
+ Url="$(WixDownloadUrl)"
+ DestinationDir="$(WixToolsDir)" />
+ </ItemGroup>
+
+ <DownloadFilesFromUrl Items="@(_wixToolDownload)" />
+
+ <ZipFileExtractToDirectory
+ SourceArchive="$(WixDestinationPath)"
+ DestinationDirectory="$(WixToolsDir)" />
+ </Target>
+
+ <Target Name="GetAcquireWixProperties">
+ <PropertyGroup>
+ <WixDownloadFilename>wix.$(WixVersion).zip</WixDownloadFilename>
+ <WixDownloadUrl>https://dotnetcli.azureedge.net/build/wix/$(WixDownloadFilename)</WixDownloadUrl>
+ <WixDestinationPath>$(WixToolsDir)$(WixDownloadFilename)</WixDestinationPath>
+ <WixDownloadSentinel>$(WixToolsDir)WixDownload.$(WixVersion).sentinel</WixDownloadSentinel>
+ </PropertyGroup>
+ </Target>
+
+ <Target Name="GenerateMsiVersionString">
+ <GenerateMsiVersion
+ Major="$(MajorVersion)"
+ Minor="$(MinorVersion)"
+ Patch="$(PatchVersion)"
+ BuildNumberMajor="$(BuildNumberMajor)"
+ BuildNumberMinor="$(BuildNumberMajor)">
+ <Output TaskParameter="MsiVersion" PropertyName="MsiVersionString" />
+ </GenerateMsiVersion>
+ </Target>
+
</Project>
<SharedHostPublishRoot>$(IntermediateOutputRootPath)sharedHost/</SharedHostPublishRoot>
<HostFxrPublishRoot>$(IntermediateOutputRootPath)hostFxr/</HostFxrPublishRoot>
<SharedFrameworkPublishRoot>$(IntermediateOutputRootPath)sharedFx/</SharedFrameworkPublishRoot>
- <TargetingPackPublishRoot>$(IntermediateOutputRootPath)Microsoft.NETCore.App.Ref/layout/</TargetingPackPublishRoot>
<CombinedPublishRoot>$(IntermediateOutputRootPath)combined-framework-host/</CombinedPublishRoot>
</PropertyGroup>
<SharedFrameworkCompressedFile>dotnet-runtime-internal-$(ProductMoniker)$(CompressedFileExtension)</SharedFrameworkCompressedFile>
<SharedFrameworkSymbolsCompressedFile>dotnet-runtime-symbols-$(ProductMoniker)$(CompressedFileExtension)</SharedFrameworkSymbolsCompressedFile>
</PropertyGroup>
-
- <PropertyGroup>
- <ProductBrandPrefix>Microsoft .NET Core</ProductBrandPrefix>
- <ProductBrandSuffix>$(ProductionVersion)</ProductBrandSuffix>
- <ProductBrandSuffix Condition="'$(ReleaseBrandSuffix)'!=''">$(ProductionVersion) $(ReleaseBrandSuffix)</ProductBrandSuffix>
- <SharedHostBrandName>$(ProductBrandPrefix) Host - $(ProductBrandSuffix)</SharedHostBrandName>
- <HostFxrBrandName>$(ProductBrandPrefix) Host FX Resolver - $(ProductBrandSuffix)</HostFxrBrandName>
- <TargetingPackBrandName>$(ProductBrandPrefix) Targeting Pack - $(ProductBrandSuffix)</TargetingPackBrandName>
- <SharedFrameworkBrandName>$(ProductBrandPrefix) Runtime - $(ProductBrandSuffix)</SharedFrameworkBrandName>
- </PropertyGroup>
</Project>
\ No newline at end of file
+++ /dev/null
-Param(
- [string]$WixFilename,
- [string]$OutputDir="."
-)
-
-$uri = "https://dotnetcli.blob.core.windows.net/build/wix/" + $wixFilename
-$outFile = $OutputDir + "\" + $wixFilename
-
-if (!(Test-Path "$OutputDir"))
-{
- mkdir "$OutputDir" | Out-Null
-}
-
-if(!(Test-Path "$outFile"))
-{
- Write-Output "Downloading WixTools to $outFile.."
- Write-Output $uri
- Invoke-WebRequest -Uri $uri -OutFile $outFile
-}
\ No newline at end of file
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:dep="http://schemas.microsoft.com/wix/DependencyExtension">
<?include "Variables.wxi" ?>
<Fragment>
- <Component Id="$(var.DependencyKeyId)" Directory="TARGETDIR" Win64="no" Guid="82516259-FF21-446E-A432-1FFCA5A02296">
+ <Component Id="$(var.DependencyKeyId)" Directory="TARGETDIR" Win64="no">
<dep:Provides Key="$(var.DependencyKey)" />
</Component>
</Fragment>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:dep="http://schemas.microsoft.com/wix/DependencyExtension">
<?include "Variables.wxi" ?>
<Fragment>
- <Component Id="$(var.DependencyKeyId)" Directory="TARGETDIR" Win64="no" Guid="4B2C9861-01F9-4438-886A-FBDFE82AD1F3">
+ <Component Id="$(var.DependencyKeyId)" Directory="TARGETDIR" Win64="no">
<dep:Provides Key="$(var.DependencyKey)" />
</Component>
</Fragment>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WindowsScriptRoot>$(PackagingRoot)windows\</WindowsScriptRoot>
- <WixVersion>3.10.4</WixVersion>
- <GetWixScript>$(WindowsScriptRoot)GetWix.ps1</GetWixScript>
- <WixToolsDir>$(IntermediateOutputRootPath)WixTools.$(WixVersion)</WixToolsDir>
- <WixObjRoot>$(IntermediateOutputRootPath)wix/</WixObjRoot>
- <MsiArch>$(TargetArchitecture)</MsiArch>
- <GenerateMSI>true</GenerateMSI>
- <GenerateMSI Condition="'$(TargetArchitecture)' == 'arm' or '$(TargetArchitecture)' == 'arm64'">false</GenerateMSI>
<InsigniaCmd>$(WixToolsDir)\insignia.exe</InsigniaCmd>
</PropertyGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project='package.props' />
-
- <UsingTask TaskName="GenerateMsiVersion" AssemblyFile="$(LocalBuildToolsTaskDir)core-setup.tasks.dll" />
- <UsingTask TaskName="GenerateGuidFromName" AssemblyFile="$(LocalBuildToolsTaskDir)core-setup.tasks.dll" />
- <UsingTask TaskName="ZipFileExtractToDirectory" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll"/>
-
- <Target Name="GenerateMsiVersionString">
- <GenerateMsiVersion
- Major="$(MajorVersion)"
- Minor="$(MinorVersion)"
- Patch="$(PatchVersion)"
- BuildNumberMajor="$(BuildNumberMajor)"
- BuildNumberMinor="$(BuildNumberMajor)">
- <Output TaskParameter="MsiVersion" PropertyName="MsiVersionString" />
- </GenerateMsiVersion>
- </Target>
<Target Name="GenerateMsis"
- DependsOnTargets="GenerateMsiVersionString"
+ DependsOnTargets="AcquireWix;GenerateMsiVersionString"
Condition="'$(OSGroup)' == 'Windows_NT' and '$(GenerateMSI)' == 'true'">
-
- <PropertyGroup>
- <WixFilename>wix.$(WixVersion).zip</WixFilename>
- </PropertyGroup>
-
- <Exec Command="powershell -NoProfile -NoLogo $(GetWixScript) -WixFilename $(WixFilename) -OutputDir $(WixToolsDir)" />
-
- <ItemGroup>
- <_filelist Include="$(WixToolsDir)\**" />
- </ItemGroup>
-
- <Message Importance="High" Text="Contents of $(WixToolsDir): @(_filelist)" />
-
- <Message Importance="High" Text="Extracting Wix tools from $(WixToolsDir)\$(WixFilename)..." />
- <ZipFileExtractToDirectory Condition="!Exists('$(WixToolsDir)\candle.exe')"
- SourceArchive="$(WixToolsDir)\$(WixFilename)"
- DestinationDirectory="$(WixToolsDir)"
- OverwriteDestination="false" />
-
<GenerateGuidFromName Name="$(SharedHostInstallerFile)">
<Output TaskParameter="GeneratedGuid" PropertyName="SharedHostUpgradeCode" />
</GenerateGuidFromName>
<Output TaskParameter="GeneratedGuid" PropertyName="HostFxrUpgradeCode" />
</GenerateGuidFromName>
- <GenerateGuidFromName Name="$(TargetingPackInstallerFile)">
- <Output TaskParameter="GeneratedGuid" PropertyName="TargetingPackUpgradeCode" />
- </GenerateGuidFromName>
-
<ItemGroup>
<WixOutputs Include="$(WixObjRoot)host">
<InputDir>$(SharedHostPublishRoot)</InputDir>
<InstallerName>$(HostFxrInstallerFile)</InstallerName>
<UpgradeCode>$(HostFxrUpgradeCode)</UpgradeCode>
</WixOutputs>
- <WixOutputs Include="$(WixObjRoot)targetingpack">
- <InputDir>$(TargetingPackPublishRoot)</InputDir>
- <BrandName>$(TargetingPackBrandName)</BrandName>
- <InstallerName>$(TargetingPackInstallerFile)</InstallerName>
- <UpgradeCode>$(TargetingPackUpgradeCode)</UpgradeCode>
- </WixOutputs>
<!-- shared framework has extra arguments so it needs to be in a separate group -->
<WixOutputs2 Include="$(WixObjRoot)sharedframework">
<InputDir>$(SharedFrameworkPublishRoot)</InputDir>
</Target>
<Target Name="GenerateBundles"
- DependsOnTargets="GetBundleDisplayVersion;GenerateMsiVersionString"
+ DependsOnTargets="AcquireWix;GetBundleDisplayVersion;GenerateMsiVersionString"
Condition="'$(OSGroup)' == 'Windows_NT' and '$(GenerateMSI)' == 'true'">
<PropertyGroup>
<SharedFxBundleScript>$(WindowsScriptRoot)sharedframework\generatebundle.ps1</SharedFxBundleScript>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:dep="http://schemas.microsoft.com/wix/DependencyExtension">
<?include "Variables.wxi" ?>
<Fragment>
- <Component Id="$(var.DependencyKeyId)" Directory="TARGETDIR" Win64="no" Guid="F47B3A4D-7CEB-4F18-8464-0F6C5978E08E">
+ <Component Id="$(var.DependencyKeyId)" Directory="TARGETDIR" Win64="no">
<dep:Provides Key="$(var.DependencyKey)" />
</Component>
</Fragment>
+++ /dev/null
-# Copyright (c) .NET Foundation and contributors. All rights reserved.
-# Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-param(
- [Parameter(Mandatory=$true)][string]$TargetingPackPublishRoot,
- [Parameter(Mandatory=$true)][string]$TargetingPackMSIOutput,
- [Parameter(Mandatory=$true)][string]$WixRoot,
- [Parameter(Mandatory=$true)][string]$ProductMoniker,
- [Parameter(Mandatory=$true)][string]$TargetingPackMSIVersion,
- [Parameter(Mandatory=$true)][string]$TargetingPackNugetVersion,
- [Parameter(Mandatory=$true)][string]$Architecture,
- [Parameter(Mandatory=$true)][string]$TargetArchitecture,
- [Parameter(Mandatory=$true)][string]$WixObjRoot,
- [Parameter(Mandatory=$true)][string]$TargetingPackUpgradeCode
-)
-
-$RepoRoot = Convert-Path "$PSScriptRoot\..\..\..\..\.."
-$CommonScript = "$RepoRoot\tools-local\scripts\common\_common.ps1"
-
-if(-Not (Test-Path "$CommonScript"))
-{
- Exit -1
-}
-. "$CommonScript"
-
-$PackagingRoot = Join-Path $RepoRoot "src\pkg\packaging"
-
-$InstallFileswsx = "$WixObjRoot\install-files.wxs"
-$InstallFilesWixobj = "$WixObjRoot\install-files.wixobj"
-
-function RunHeat
-{
- $Result = $true
- pushd "$WixRoot"
-
- Write-Host Running heat.. to $InstallFileswsx
- Write-Host "Root $TargetingPackPublishRoot"
-
- .\heat.exe dir `"$TargetingPackPublishRoot`" `
- -nologo `
- -template fragment `
- -sreg -gg `
- -var var.TargetingPackSrc `
- -cg InstallFiles `
- -srd `
- -dr DOTNETHOME `
- -out $InstallFileswsx | Out-Host
-
- if($LastExitCode -ne 0)
- {
- $Result = $false
- Write-Host "Heat failed with exit code $LastExitCode."
- }
-
- popd
- return $Result
-}
-
-function RunCandle
-{
- $Result = $true
- pushd "$WixRoot"
-
- Write-Host Running candle..
- $AuthWsxRoot = Join-Path $PackagingRoot "windows\targetingpack"
-
- $ComponentVersion = $TargetingPackNugetVersion.Replace('-', '_');
-
- .\candle.exe -nologo `
- -out "$WixObjRoot\" `
- -dTargetingPackSrc="$TargetingPackPublishRoot" `
- -dMicrosoftEula="$PackagingRoot\windows\eula.rtf" `
- -dProductMoniker="$ProductMoniker" `
- -dBuildVersion="$TargetingPackMSIVersion" `
- -dNugetVersion="$TargetingPackNugetVersion" `
- -dComponentVersion="$ComponentVersion" `
- -dTargetArchitecture="$TargetArchitecture" `
- -dUpgradeCode="$TargetingPackUpgradeCode" `
- -arch $Architecture `
- -ext WixDependencyExtension.dll `
- "$AuthWsxRoot\targetingpack.wxs" `
- "$AuthWsxRoot\provider.wxs" `
- $InstallFileswsx | Out-Host
-
- if($LastExitCode -ne 0)
- {
- $Result = $false
- Write-Host "Candle failed with exit code $LastExitCode."
- }
-
- popd
- return $Result
-}
-
-function RunLight
-{
- $Result = $true
- pushd "$WixRoot"
-
- Write-Host Running light..
-
- .\light.exe -nologo `
- -ext WixUIExtension.dll `
- -ext WixDependencyExtension.dll `
- -ext WixUtilExtension.dll `
- -cultures:en-us `
- "$WixObjRoot\targetingpack.wixobj" `
- "$WixObjRoot\provider.wixobj" `
- "$InstallFilesWixobj" `
- -out $TargetingPackMSIOutput | Out-Host
-
- if($LastExitCode -ne 0)
- {
- $Result = $false
- Write-Host "Light failed with exit code $LastExitCode."
- }
-
- popd
- return $Result
-}
-
-if(!(Test-Path $TargetingPackPublishRoot))
-{
- throw "$TargetingPackPublishRoot not found"
-}
-
-if(!(Test-Path $WixObjRoot))
-{
- throw "$WixObjRoot not found"
-}
-
-Write-Host "Creating Targeting Pack MSI at $TargetingPackMSIOutput"
-
-if([string]::IsNullOrEmpty($WixRoot))
-{
- Exit -1
-}
-
-if(-Not (RunHeat))
-{
- Exit -1
-}
-
-if(-Not (RunCandle))
-{
- Exit -1
-}
-
-if(-Not (RunLight))
-{
- Exit -1
-}
-
-if(!(Test-Path $TargetingPackMSIOutput))
-{
- throw "Unable to create the Targeting Pack MSI."
-}
-
-Write-Host -ForegroundColor Green "Successfully created Targeting Pack MSI - $TargetingPackMSIOutput"
-
-exit $LastExitCode
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\dir.props" />
+
<PropertyGroup>
<PackagePlatform>AnyCPU</PackagePlatform>
<IntermediateOutputPath Condition="'$(IntermediateOutputPath)' == ''">obj/$(Configuration)/</IntermediateOutputPath>
<IntermediateOutputPath Condition="'$(NuGetRuntimeIdentifier)' != ''">$(IntermediateOutputPath)$(NuGetRuntimeIdentifier)/</IntermediateOutputPath>
-
- <!--
- Allow packaging one build's outputs for a different RID. For example, package portable bits
- for multiple Debian-based distros.
- -->
- <InstallerSourceOSPlatformConfig Condition="'$(InstallerSourceOSPlatformConfig)' == ''">$(OSPlatformConfig)</InstallerSourceOSPlatformConfig>
- <InstallerSourceIntermediateOutputDir>$(BaseIntermediateOutputPath)$(InstallerSourceOSPlatformConfig)\$(MSBuildProjectName)\</InstallerSourceIntermediateOutputDir>
<SkipPackageFileCheck>true</SkipPackageFileCheck>
<!-- This property must be set to the same value as $(PackageOutputPath) for the nuspecs and nupkgs to be binplaced to the intended location. -->
<PackProjectDependencies>true</PackProjectDependencies>
</PropertyGroup>
+ <Import Project="packaging-tools\packaging-tools.props" />
+
<!-- In *.builds projects, the current phase's name is the same as the project name. -->
<PropertyGroup>
<BuildPhase>$(MSBuildProjectName)</BuildPhase>
</Otherwise>
</Choose>
- <!-- Detect framework pack suffix and apply defaults. -->
- <PropertyGroup Condition="$(MSBuildProjectName.EndsWith('.Ref'))">
- <FrameworkPackType>targeting</FrameworkPackType>
-
- <!--
- Prevent 'runtime.<rid>.Microsoft.<framework>.App.Ref' packages from being built.
-
- Not the same as HasRuntimePackages, which is used to set up ProjectReferences on the runtime
- packages and generate assets such as the platform manifest.
- -->
- <BuildRuntimePackages>false</BuildRuntimePackages>
-
- <PackageType>DotnetPlatform</PackageType>
- <Version>$(SharedFrameworkNugetVersion)</Version>
-
- <!-- Include the platform manifest in the data dir. -->
- <PlatformManifestTargetPath>data/PlatformManifest.txt</PlatformManifestTargetPath>
- <FrameworkListTargetPath>data/</FrameworkListTargetPath>
-
- <!-- Exclude runtime.json from the package. -->
- <IncludeRuntimeJson>false</IncludeRuntimeJson>
- <IsLineupPackage>false</IsLineupPackage>
-
- <!-- Remove package dependencies. -->
- <ExcludeLineupReference>true</ExcludeLineupReference>
- <PackProjectDependencies>false</PackProjectDependencies>
-
- <!-- Location to lay out pack contents, and where to grab bits to create installers. -->
- <PackLayoutDir>$(InstallerSourceIntermediateOutputDir)layout/$(FrameworkPackType)/</PackLayoutDir>
-
- <InstallerName>$(ShortFrameworkName)-targeting-pack</InstallerName>
- </PropertyGroup>
-
- <PropertyGroup>
- <VersionedInstallerName>$(InstallerName)-$(PackageNameSuffix)</VersionedInstallerName>
- <VersionedInstallerName>$(VersionedInstallerName.ToLowerInvariant())</VersionedInstallerName>
- <InstallerPackageRelease>1</InstallerPackageRelease>
-
- <InstallerPackageVersion>$(ProductionVersion)</InstallerPackageVersion>
- </PropertyGroup>
-
- <PropertyGroup Condition="'$(InstallerExtension)' == '.deb'">
- <InstallerPackageVersion Condition="'$(IncludePreReleaseLabelInPackageVersion)' == 'true'">$(ProductionVersion)~$(VersionSuffix)</InstallerPackageVersion>
- </PropertyGroup>
-
- <PropertyGroup Condition="'$(InstallerExtension)' == '.rpm'">
- <InstallerPackageRelease Condition="'$(IncludePreReleaseLabelInPackageVersion)' == 'true'">0.1.$(VersionSuffix)</InstallerPackageRelease>
- <InstallerPackageRelease>$([System.String]::Copy('$(InstallerPackageRelease)').Replace('-', '_'))</InstallerPackageRelease>
- </PropertyGroup>
-
- <PropertyGroup>
- <InstallerIntermediatesDir>$(PackagesIntermediateDir)$(InstallerName)/$(InstallerPackageVersion)/</InstallerIntermediatesDir>
-
- <InstallerBuildPart>$(ProductMoniker)</InstallerBuildPart>
- <InstallerBuildPart Condition="'$(InstallerExtension)' == '.deb' or '$(InstallerExtension)' == '.rpm'"
- >$(SharedFrameworkNugetVersion)-$(TargetArchitecture)</InstallerBuildPart>
-
- <!-- Location to place the installer, in bin. -->
- <InstallerFile>$(AssetOutputPath)$(InstallerName)-$(InstallerBuildPart)$(InstallerExtension)</InstallerFile>
- </PropertyGroup>
-
<PropertyGroup Condition="'$(MSBuildProjectExtension)' == '.depproj'">
<!-- we intentionally don't want to produce output -->
<OutputPath>unused</OutputPath>
<CrossGenSymbolsOutputPath>$(PackageSymbolsBinDir)/$(MSBuildProjectName)</CrossGenSymbolsOutputPath>
</PropertyGroup>
- <PropertyGroup Condition="'$(IsFrameworkPackage)' == 'true'">
- <Version>$(SharedFrameworkNugetVersion)</Version>
- <OmitDependencies>true</OmitDependencies>
- <SkipValidatePackage>true</SkipValidatePackage>
- </PropertyGroup>
-
<!-- Add required legal files to packages -->
<ItemGroup Condition="'$(MSBuildProjectExtension)' == '.pkgproj'">
<File Condition="Exists('$(PackageLicenseFile)')"
<ItemGroup>
<!--
- Create Debian and RPM packages for targeting packs. Similar to the runtime package, we only
- make one for all distros.
+ Create targeting pack packages/installers. Similar to the runtime package, we only make one
+ Debian or RPM package for all distros of that type.
-->
<InstallerPackageProject
Include="$(MSBuildProjectFullPath)"
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\dir.targets" />
- <!--
- Include common targets for specific project types. These files include BuildTools target
- overrides that shouldn't be applied to other projects.
- -->
- <Import Project="framework.dependency.targets" Condition="'$(MSBuildProjectExtension)' == '.depproj'"/>
- <Import Project="framework.packaging.targets" Condition="'$(IsFrameworkPackage)' == 'true'"/>
+ <Import Project="packaging-tools\packaging-tools.targets" />
<UsingTask TaskName="CreateFrameworkListFile" AssemblyFile="$(LocalBuildToolsTaskDir)core-setup.tasks.dll"/>
<UsingTask TaskName="GenerateFileVersionProps" AssemblyFile="$(LocalBuildToolsTaskDir)core-setup.tasks.dll"/>
<Target Name="GenerateInstallers"
DependsOnTargets="
GenerateDeb;
- GenerateRpm" />
+ GenerateRpm;
+ GenerateMsi" />
- <Target Name="GenerateDeb" DependsOnTargets="TestDebuild;CreateDeb" />
- <Target Name="GenerateRpm" DependsOnTargets="TestFPMTool;CreateRpm" />
+ <Target Name="GenerateDeb" DependsOnTargets="TestDebuild;CreateDeb" Condition="'$(BuildDebPackage)' == 'true'"/>
+ <Target Name="GenerateRpm" DependsOnTargets="TestFPMTool;CreateRpm" Condition="'$(BuildRpmPackage)' == 'true'"/>
+ <Target Name="GenerateMsi" DependsOnTargets="CreateMsi" Condition="'$(GenerateMSI)' == 'true'"/>
<!--
Create Debian package.
InitializeDotnetDebTool;
CreateInstallerLayout;
GetDebInstallerJsonProperties"
- Condition="'$(BuildDebPackage)' == 'true' AND '$(DebuildPresent)' == 'true'">
+ Condition="'$(DebuildPresent)' == 'true'">
<PropertyGroup>
<ConfigJsonFile>$(LayoutDirectory)debian_config.json</ConfigJsonFile>
<DebIntermediatesDir>$(InstallerIntermediatesDir)out-deb</DebIntermediatesDir>
DependsOnTargets="
CreateInstallerLayout;
GetRpmInstallerJsonProperties"
- Condition="'$(BuildRpmPackage)' == 'true' AND '$(FPMPresent)' == 'true'">
+ Condition="'$(FPMPresent)' == 'true'">
<PropertyGroup>
<ConfigJsonFile>$(LayoutDirectory)rpm_config.json</ConfigJsonFile>
<RpmIntermediatesDir>$(InstallerIntermediatesDir)out-rpm</RpmIntermediatesDir>
</Target>
<!--
+ Create MSI installer, using WiX tools.
+ -->
+ <Target Name="CreateMsi"
+ DependsOnTargets="RunLightLinker">
+ <Message Text="Created '$(InstallerFile)'" Importance="High" />
+ </Target>
+
+ <!--
+ If UpgradeCode isn't manually set, generate based on installer full path. Not suitable for
+ bundles.
+ -->
+ <Target Name="GetUpgradeCode"
+ Condition="'$(UpgradeCode)' == ''">
+ <GenerateGuidFromName Name="$(InstallerFile)">
+ <Output TaskParameter="GeneratedGuid" PropertyName="UpgradeCode" />
+ </GenerateGuidFromName>
+ </Target>
+
+ <Target Name="RunHeatHarvester">
+ <PropertyGroup>
+ <InstallFilesWixSourceFile>$(WixObjDir)install-files.wxs</InstallFilesWixSourceFile>
+ <InstallFilesWixObjFile>$(WixObjDir)install-files.wixobj</InstallFilesWixObjFile>
+
+ <_wixArgs></_wixArgs>
+ <_wixArgs>$(_wixArgs) dir "$(PackLayoutDir)"</_wixArgs>
+ <_wixArgs>$(_wixArgs) -nologo</_wixArgs>
+ <_wixArgs>$(_wixArgs) -template fragment</_wixArgs>
+ <_wixArgs>$(_wixArgs) -sreg</_wixArgs>
+ <_wixArgs>$(_wixArgs) -gg</_wixArgs>
+ <_wixArgs>$(_wixArgs) -var var.TargetingPackSrc</_wixArgs>
+ <_wixArgs>$(_wixArgs) -cg InstallFiles</_wixArgs>
+ <_wixArgs>$(_wixArgs) -srd</_wixArgs>
+ <_wixArgs>$(_wixArgs) -dr DOTNETHOME</_wixArgs>
+ <_wixArgs>$(_wixArgs) -out $(InstallFilesWixSourceFile)</_wixArgs>
+ </PropertyGroup>
+
+ <Message Importance="High" Text="Heat '$(MSBuildProjectName)'" />
+ <Exec Command="heat.exe $(_wixArgs)" WorkingDirectory="$(WixToolsDir)" />
+ </Target>
+
+ <Target Name="RunCandleCompiler"
+ DependsOnTargets="
+ GetUpgradeCode;
+ GenerateMsiVersionString">
+ <PropertyGroup>
+ <_wixArgs></_wixArgs>
+ <_wixArgs>$(_wixArgs) -nologo</_wixArgs>
+ <_wixArgs>$(_wixArgs) -ext WixDependencyExtension.dll</_wixArgs>
+ <_wixArgs>$(_wixArgs) -arch $(MsiArch)</_wixArgs>
+
+ <_wixArgs>$(_wixArgs) -dTargetingPackSrc="$(PackLayoutDir)" </_wixArgs>
+ <_wixArgs>$(_wixArgs) -dMicrosoftEula="$(MicrosoftEulaFile)"</_wixArgs>
+ <_wixArgs>$(_wixArgs) -dProductMoniker="$(TargetingPackBrandName)"</_wixArgs>
+ <_wixArgs>$(_wixArgs) -dBuildVersion="$(MsiVersionString)"</_wixArgs>
+ <_wixArgs>$(_wixArgs) -dNugetVersion="$(SharedFrameworkNugetVersion)"</_wixArgs>
+ <_wixArgs>$(_wixArgs) -dTargetArchitecture="$(TargetArchitecture)"</_wixArgs>
+ <_wixArgs>$(_wixArgs) -dUpgradeCode="$(UpgradeCode)"</_wixArgs>
+ <_wixArgs>$(_wixArgs) -dDependencyKeyName="$(InstallerName.Replace('-', '_'))"</_wixArgs>
+
+ <_wixArgs>$(_wixArgs) "$(MSBuildThisFileDirectory)windows/targetingpack.wxs"</_wixArgs>
+ <_wixArgs>$(_wixArgs) "$(MSBuildThisFileDirectory)windows/provider.wxs"</_wixArgs>
+ <_wixArgs>$(_wixArgs) "$(InstallFilesWixSourceFile)"</_wixArgs>
+
+ <_wixArgs>$(_wixArgs) -out "$(WixObjDir)"</_wixArgs>
+ </PropertyGroup>
+
+ <Message Importance="High" Text="Candle '$(MSBuildProjectName)'" />
+ <Exec Command="candle.exe $(_wixArgs)" WorkingDirectory="$(WixToolsDir)" />
+ </Target>
+
+ <Target Name="RunLightLinker"
+ DependsOnTargets="
+ RunHeatHarvester;
+ RunCandleCompiler">
+ <PropertyGroup>
+ <_wixArgs></_wixArgs>
+ <_wixArgs>$(_wixArgs) -nologo</_wixArgs>
+ <_wixArgs>$(_wixArgs) -ext WixUIExtension.dll</_wixArgs>
+ <_wixArgs>$(_wixArgs) -ext WixDependencyExtension.dll</_wixArgs>
+ <_wixArgs>$(_wixArgs) -ext WixUtilExtension.dll</_wixArgs>
+ <_wixArgs>$(_wixArgs) -cultures:en-us</_wixArgs>
+
+ <_wixArgs>$(_wixArgs) "$(WixObjDir)targetingpack.wixobj"</_wixArgs>
+ <_wixArgs>$(_wixArgs) "$(WixObjDir)provider.wixobj"</_wixArgs>
+ <_wixArgs>$(_wixArgs) "$(InstallFilesWixObjFile)"</_wixArgs>
+
+ <_wixArgs>$(_wixArgs) -out $(InstallerFile)</_wixArgs>
+ </PropertyGroup>
+
+ <Message Importance="High" Text="Light '$(MSBuildProjectName)'" />
+ <Exec Command="light.exe $(_wixArgs)" WorkingDirectory="$(WixToolsDir)" />
+ </Target>
+
+ <!--
Create installer layout. Used for RPM or Debian package creation.
-->
<Target Name="CreateInstallerLayout"
<Target Name="CopyFilesToLayout">
<PropertyGroup>
- <LayoutDirectory>$(InstallerIntermediatesDir)/debianLayoutDirectory/</LayoutDirectory>
+ <LayoutDirectory>$(InstallerIntermediatesDir)/layoutDirectory/</LayoutDirectory>
<LayoutAbsolute>$(LayoutDirectory)$</LayoutAbsolute>
<LayoutPackageRoot>$(LayoutDirectory)package_root</LayoutPackageRoot>
<LayoutSamples>$(LayoutDirectory)samples</LayoutSamples>
<Target Name="CreateFrameworkPackLayout"
AfterTargets="CreatePackage"
Condition="'$(FrameworkPackType)' != ''">
+ <!--
+ Clean up existing layout. Otherwise, unclean dev builds can lay out multiple versions side by
+ side in the layout that all get packed into installers, causing confusion.
+ -->
+ <RemoveDir Directories="$(PackLayoutDir)" />
+
<PropertyGroup>
<TargetingPackNupkgFile>$(PackageOutputPath)$(Id).$(PackageVersion).nupkg</TargetingPackNupkgFile>
</PropertyGroup>
--- /dev/null
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+ <PropertyGroup>
+ <!--
+ Allow packaging one build's outputs for a different RID. For example, package portable bits
+ for multiple Debian-based distros.
+ -->
+ <InstallerSourceOSPlatformConfig Condition="'$(InstallerSourceOSPlatformConfig)' == ''">$(OSPlatformConfig)</InstallerSourceOSPlatformConfig>
+ <InstallerSourceIntermediateOutputDir>$(BaseIntermediateOutputPath)$(InstallerSourceOSPlatformConfig)\$(MSBuildProjectName)\</InstallerSourceIntermediateOutputDir>
+ </PropertyGroup>
+
+ <!-- Detect framework pack suffix and apply defaults. -->
+ <PropertyGroup Condition="$(MSBuildProjectName.EndsWith('.Ref'))">
+ <FrameworkPackType>targeting</FrameworkPackType>
+
+ <!--
+ Prevent 'runtime.<rid>.Microsoft.<framework>.App.Ref' packages from being built.
+
+ Not the same as HasRuntimePackages, which is used to set up ProjectReferences on the runtime
+ packages and generate assets such as the platform manifest.
+ -->
+ <BuildRuntimePackages>false</BuildRuntimePackages>
+
+ <PackageType>DotnetPlatform</PackageType>
+ <Version>$(SharedFrameworkNugetVersion)</Version>
+
+ <!-- Include the platform manifest in the data dir. -->
+ <PlatformManifestTargetPath>data/PlatformManifest.txt</PlatformManifestTargetPath>
+ <FrameworkListTargetPath>data/</FrameworkListTargetPath>
+
+ <!-- Exclude runtime.json from the package. -->
+ <IncludeRuntimeJson>false</IncludeRuntimeJson>
+ <IsLineupPackage>false</IsLineupPackage>
+
+ <!-- Remove package dependencies. -->
+ <ExcludeLineupReference>true</ExcludeLineupReference>
+ <PackProjectDependencies>false</PackProjectDependencies>
+
+ <!-- Location to lay out pack contents, and where to grab bits to create installers. -->
+ <PackLayoutDir>$(InstallerSourceIntermediateOutputDir)layout/$(FrameworkPackType)/</PackLayoutDir>
+
+ <InstallerName>$(ShortFrameworkName)-targeting-pack</InstallerName>
+ </PropertyGroup>
+
+ <!-- Only targeting pack MSIs are currently supported by this infrastructure. -->
+ <PropertyGroup Condition="'$(FrameworkPackType)' != 'targeting'">
+ <GenerateMSI>false</GenerateMSI>
+ </PropertyGroup>
+
+ <PropertyGroup>
+ <VersionedInstallerName>$(InstallerName)-$(PackageNameSuffix)</VersionedInstallerName>
+ <VersionedInstallerName>$(VersionedInstallerName.ToLowerInvariant())</VersionedInstallerName>
+ <InstallerPackageRelease>1</InstallerPackageRelease>
+
+ <InstallerPackageVersion>$(ProductionVersion)</InstallerPackageVersion>
+ </PropertyGroup>
+
+ <PropertyGroup Condition="'$(InstallerExtension)' == '.deb'">
+ <InstallerPackageVersion Condition="'$(IncludePreReleaseLabelInPackageVersion)' == 'true'">$(ProductionVersion)~$(VersionSuffix)</InstallerPackageVersion>
+ </PropertyGroup>
+
+ <PropertyGroup Condition="'$(InstallerExtension)' == '.rpm'">
+ <InstallerPackageRelease Condition="'$(IncludePreReleaseLabelInPackageVersion)' == 'true'">0.1.$(VersionSuffix)</InstallerPackageRelease>
+ <InstallerPackageRelease>$([System.String]::Copy('$(InstallerPackageRelease)').Replace('-', '_'))</InstallerPackageRelease>
+ </PropertyGroup>
+
+ <PropertyGroup>
+ <InstallerIntermediatesDir>$(PackagesIntermediateDir)$(InstallerName)/$(InstallerPackageVersion)/</InstallerIntermediatesDir>
+
+ <InstallerBuildPart>$(ProductMoniker)</InstallerBuildPart>
+ <InstallerBuildPart Condition="'$(InstallerExtension)' == '.deb' or '$(InstallerExtension)' == '.rpm'"
+ >$(SharedFrameworkNugetVersion)-$(TargetArchitecture)</InstallerBuildPart>
+
+ <!-- Location to place the installer, in bin. -->
+ <InstallerFileNameWithoutExtension>$(InstallerName)-$(InstallerBuildPart)</InstallerFileNameWithoutExtension>
+ <InstallerFile>$(AssetOutputPath)$(InstallerFileNameWithoutExtension)$(InstallerExtension)</InstallerFile>
+ </PropertyGroup>
+
+ <PropertyGroup Condition="'$(IsFrameworkPackage)' == 'true'">
+ <Version>$(SharedFrameworkNugetVersion)</Version>
+ <OmitDependencies>true</OmitDependencies>
+ <SkipValidatePackage>true</SkipValidatePackage>
+ </PropertyGroup>
+
+ <PropertyGroup Condition="'$(InstallerFileNameWithoutExtension)' != '' AND '$(GenerateMSI)' == 'true'">
+ <OutputType>Package</OutputType>
+ <OutputName>$(InstallerFileNameWithoutExtension)</OutputName>
+ </PropertyGroup>
+
+</Project>
--- /dev/null
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+ <!--
+ Include common targets for specific project types. These files include BuildTools target
+ overrides that shouldn't be applied to other projects.
+ -->
+ <Import Project="framework.dependency.targets" Condition="'$(MSBuildProjectExtension)' == '.depproj'" />
+ <Import Project="framework.packaging.targets" Condition="'$(IsFrameworkPackage)' == 'true'" />
+
+</Project>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:dep="http://schemas.microsoft.com/wix/DependencyExtension">
<?include "Variables.wxi" ?>
<Fragment>
- <Component Id="$(var.DependencyKeyId)" Directory="TARGETDIR" Win64="no" Guid="117B1755-5027-4257-A1A9-7C37D81C3D5F">
+ <Component Id="$(var.DependencyKeyId)" Directory="TARGETDIR" Win64="no">
<dep:Provides Key="$(var.DependencyKey)" />
</Component>
</Fragment>
<?error Invalid Platform ($(var.Platform))?>
<?endif?>
- <?define DependencyKey = "Dotnet_Core_TargetingPack_$(var.BuildVersion)_$(var.Platform)"?>
+ <?define DependencyKey = "$(var.DependencyKeyName)_$(var.BuildVersion)_$(var.Platform)"?>
<?define DependencyKeyId = "$(var.DependencyKey)" ?>
</Include>
\ No newline at end of file
<PropertyGroup>
<IsFrameworkPackage>true</IsFrameworkPackage>
<ShortFrameworkName>windowsdesktop</ShortFrameworkName>
+ <ProductBrandPrefix>Microsoft Windows Desktop</ProductBrandPrefix>
</PropertyGroup>
<Import Project="..\..\dir.props" />