Create WindowsDesktop shared framework nupkgs and MSIs (dotnet/core-setup#5741)
authorDavis Goodin <dagood@users.noreply.github.com>
Fri, 12 Apr 2019 16:43:25 +0000 (11:43 -0500)
committerGitHub <noreply@github.com>
Fri, 12 Apr 2019 16:43:25 +0000 (11:43 -0500)
* Move packaging-tools out: unwanted dir.props

Move packaging-tools from src/pkg/projects/ to src/pkg/ so the shared framework project isn't interfered with by src/pkg/projects/dir.props. Changing the dir.props would be wasted effort because packaging-tools will have to move to become shared tooling in the future.

* WindowsDesktop shared framework, nupkg + msi

Commit migrated from https://github.com/dotnet/core-setup/commit/e1f47891f3fc715cbf73b599a5466ef8fce105ea

33 files changed:
eng/jobs/windows-build.yml
src/installer/config.json
src/installer/dir.proj
src/installer/pkg/dir.props
src/installer/pkg/dir.traversal.targets
src/installer/pkg/packaging-tools/framework.dependency.targets [moved from src/installer/pkg/projects/packaging-tools/framework.dependency.targets with 93% similarity]
src/installer/pkg/packaging-tools/framework.packaging.targets [moved from src/installer/pkg/projects/packaging-tools/framework.packaging.targets with 78% similarity]
src/installer/pkg/packaging-tools/packaging-tools.props [new file with mode: 0644]
src/installer/pkg/packaging-tools/packaging-tools.targets [new file with mode: 0644]
src/installer/pkg/packaging-tools/sharedFramework/Directory.Build.props [new file with mode: 0644]
src/installer/pkg/packaging-tools/sharedFramework/sharedFramework.csproj [new file with mode: 0644]
src/installer/pkg/packaging-tools/windows/product.common.wxi [new file with mode: 0644]
src/installer/pkg/packaging-tools/windows/provider.wxs [moved from src/installer/pkg/projects/packaging-tools/windows/provider.wxs with 100% similarity]
src/installer/pkg/packaging-tools/windows/sharedFramework/product.wxs [new file with mode: 0644]
src/installer/pkg/packaging-tools/windows/sharedFramework/registrykeys.wxs [new file with mode: 0644]
src/installer/pkg/packaging-tools/windows/targetingPack/product.wxs [new file with mode: 0644]
src/installer/pkg/packaging-tools/windows/variables.wxi [moved from src/installer/pkg/projects/packaging-tools/windows/variables.wxi with 68% similarity]
src/installer/pkg/packaging-tools/windows/wix.targets [new file with mode: 0644]
src/installer/pkg/packaging/dir.proj
src/installer/pkg/projects/descriptions.json
src/installer/pkg/projects/dir.props
src/installer/pkg/projects/dir.targets
src/installer/pkg/projects/dir.traversal.targets
src/installer/pkg/projects/installer.builds
src/installer/pkg/projects/netcoreapp/pkg/Microsoft.NETCore.App.pkgproj
src/installer/pkg/projects/packaging-tools/packaging-tools.props [deleted file]
src/installer/pkg/projects/packaging-tools/packaging-tools.targets [deleted file]
src/installer/pkg/projects/packaging-tools/windows/targetingpack.wxs [deleted file]
src/installer/pkg/projects/sharedfx.builds [new file with mode: 0644]
src/installer/pkg/projects/windowsdesktop/dir.props
src/installer/pkg/projects/windowsdesktop/pkg/Microsoft.WindowsDesktop.App.pkgproj [new file with mode: 0644]
src/installer/pkg/projects/windowsdesktop/src/windowsdesktop.depproj
src/installer/pkg/projects/windowsdesktop/windowsdesktopRIDs.props [new file with mode: 0644]

index 77e999d..d9d0fdf 100644 (file)
@@ -98,11 +98,17 @@ jobs:
       displayName: Build Nuget package
       condition: succeeded()
 
-    # Build sharedframework layout
+    # Build Shared Frameworks
+    - script: build.cmd -sharedfx-netcoreapp
+        -- '$(CommonMSBuildArgs)
+        /bl:$(Build.SourcesDirectory)\sharedframework-netcoreapp.binlog'
+      displayName: Build sharedframework layout (legacy infrastructure)
+      condition: succeeded()
+
     - script: build.cmd -sharedfx
         -- '$(CommonMSBuildArgs)
         /bl:$(Build.SourcesDirectory)\sharedframework.binlog'
-      displayName: Build sharedframework layout
+      displayName: Build sharedframework layouts (new infrastructure)
       condition: succeeded()
 
     - ${{ if ne(parameters.skipTests, 'true') }}:
index ef3444b..6c513ca 100644 (file)
             "Project": "publish\\publish.proj"
           }
         },
-        "sharedfx": {
-          "description": "Build Shared Framework project.",
+        "sharedfx-netcoreapp": {
+          "description": "Build legacy netcoreapp Shared Framework project.",
           "settings": {
             "Project": "src\\sharedframework\\sharedframework.proj"
           }
         },
+        "sharedfx": {
+          "description": "Build Shared Framework projects.",
+          "settings": {
+            "Project": "src\\pkg\\projects\\sharedfx.builds"
+          }
+        },
         "signing-validation": {
           "description": "Build signing validation project.",
           "settings": {
index 121aebc..8d32915 100644 (file)
@@ -11,6 +11,7 @@
     <Project Include="$(MSBuildThisFileDirectory)src.builds" />
     <Project Include="$(MSBuildThisFileDirectory)pkg/dir.proj" />
     <Project Include="$(MSBuildThisFileDirectory)sharedFramework/sharedFramework.proj" />
+    <Project Include="$(MSBuildThisFileDirectory)pkg/projects/sharedfx.builds" />
   </ItemGroup>
 
   <!-- Tasks from buildtools for easy project.json dependency updates -->
index 0247cc5..0f8f4f7 100644 (file)
@@ -29,6 +29,8 @@
   </PropertyGroup>
 
   <PropertyGroup>
+    <PackagingToolsDir>$(MSBuildThisFileDirectory)packaging-tools/</PackagingToolsDir>
+
     <PackagesIntermediateDir>$(IntermediateOutputRootPath)packages/</PackagesIntermediateDir>
 
     <RpmTemplatesDir>$(MSBuildThisFileDirectory)packaging/rpm/templates/</RpmTemplatesDir>
index fa702d0..781d053 100644 (file)
@@ -2,15 +2,14 @@
 <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
 
   <Target Name="Build">
+    <PropertyGroup>
+      <BuildsFileTarget Condition="'$(BuildsFileTarget)' == ''">$(MSBuildProjectDefaultTargets)</BuildsFileTarget>
+    </PropertyGroup>
+
     <!-- To Serialize we use msbuild's batching functionality '%' to force it to batch all similar projects with the same identity 
          however since the project names are unique it will essentially force each to run in its own batch -->
-    <MSBuild Targets="Build" Projects="@(Project)" Condition="'$(SerializeProjects)'=='true'" Properties="Dummy=%(Identity)"/>
-    <MSBuild Targets="Build" Projects="@(Project)" Condition="'$(SerializeProjects)'!='true'" BuildInParallel="true" />
-  </Target>
-
-  <Target Name="GenerateInstallers">
-    <MSBuild Targets="GenerateInstallers" Projects="@(Project)" Condition="'$(SerializeProjects)'=='true'" Properties="Dummy=%(Identity)"/>
-    <MSBuild Targets="GenerateInstallers" Projects="@(Project)" Condition="'$(SerializeProjects)'!='true'" BuildInParallel="true" />
+    <MSBuild Targets="$(BuildsFileTarget)" Projects="@(Project)" Condition="'$(SerializeProjects)'=='true'" Properties="Dummy=%(Identity)"/>
+    <MSBuild Targets="$(BuildsFileTarget)" Projects="@(Project)" Condition="'$(SerializeProjects)'!='true'" BuildInParallel="true" />
   </Target>
 
   <Target Name="Clean">
         <TargetPath Condition="'%(FilesToPackage.IsNative)' != 'true'">runtimes/$(NuGetRuntimeIdentifier)/lib/$(PackageTargetFramework)</TargetPath>
         <TargetPath Condition="'%(FilesToPackage.IsNative)' == 'true'">runtimes/$(NuGetRuntimeIdentifier)/native</TargetPath>
       </FilesToPackage>
+      <!-- Ensure localization resource files make it to their subdirs. -->
+      <FilesToPackage Condition="'%(FilesToPackage.DestinationSubDirectory)' != ''">
+        <TargetPath>%(FilesToPackage.TargetPath)/%(FilesToPackage.DestinationSubDirectory)</TargetPath>
+      </FilesToPackage>
     </ItemGroup>
 
     <ItemGroup Condition="'$(NuGetRuntimeIdentifier)' == ''">
@@ -6,6 +6,8 @@
   <UsingTask TaskName="BuildFPMToolPreReqs" AssemblyFile="$(LocalBuildToolsTaskDir)core-setup.tasks.dll"/>
   <UsingTask TaskName="GenerateJsonObjectString" AssemblyFile="$(LocalBuildToolsTaskDir)core-setup.tasks.dll"/>
 
+  <Import Project="$(MSBuildThisFileDirectory)windows/wix.targets" />
+
   <Target Name="GenerateInstallers"
           DependsOnTargets="
             GenerateDeb;
@@ -23,6 +25,7 @@
   -->
   <Target Name="CreateDeb"
           DependsOnTargets="
+            GetInstallerProperties;
             InitializeDotnetDebTool;
             CreateInstallerLayout;
             GetDebInstallerJsonProperties"
@@ -73,6 +76,7 @@
   -->
   <Target Name="CreateRpm"
           DependsOnTargets="
+            GetInstallerProperties;
             CreateInstallerLayout;
             GetRpmInstallerJsonProperties"
           Condition="'$(FPMPresent)' == 'true'">
     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="$(ProductVersion)"</_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)" />
+            GetInstallerProperties;
+            RunLightLinker">
+    <Message Text="Created '$(InstallerFile)'" Importance="High" />
   </Target>
 
   <!--
     Create macOS pkg installer.
   -->
-  <Target Name="CreatePkg">
+  <Target Name="CreatePkg"
+          DependsOnTargets="GetInstallerProperties">
     <PropertyGroup>
       <_pkgArgs></_pkgArgs>
       <_pkgArgs>$(_pkgArgs) --root $(PackLayoutDir)</_pkgArgs>
       Include="@(TargetingPackDataEntries)" />
   </Target>
 
+  <Target Name="GenerateSharedFramework"
+          Condition="'$(GenerateSharedFramework)' == 'true'">
+    <PropertyGroup>
+      <SharedFrameworkIntermediateOutputPath>$(IntermediateOutputPath)sharedFx/</SharedFrameworkIntermediateOutputPath>
+    </PropertyGroup>
+
+    <!-- Delete layout directory and sfx NuGet cache to ensure freshness. -->
+    <RemoveDir Directories="$(SharedFrameworkLayoutDir);$(SharedFrameworkIntermediateOutputPath)" />
+
+    <!--
+      Build a csproj that lays out the shared framework using the SDK publish targets. Pass
+      properties to make the csproj restore and publish specific to the current pkgproj.
+
+      Noteworthy inputs:
+        SharedFrameworkName:
+          Name of the shared framework, such as Microsoft.NETCore.App.
+        SharedFrameworkPkgprojFile:
+          Full path of the pkgproj that produces the framework package. The framework package
+          identity is extracted from here via an MSBuild task, to be restored.
+        SharedFrameworkLayoutDir:
+          Directory to lay out "<id>/<version>/<files>" of the shared fx.
+        IntermediateOutputPath:
+          Typical: directory for intermediates, custom to avoid clashing.
+        MSBuildProjectExtensionsPath:
+          Same as IntermediateOutputPath. Passed in as a workaround, because the SDK needs the value
+          in its props file before we have a chance to override in this project.
+    -->
+    <MSBuild
+      Projects="$(MSBuildThisFileDirectory)sharedFramework/sharedFramework.csproj"
+      Properties="
+        SharedFrameworkName=$(MSBuildProjectName);
+        SharedFrameworkPkgprojFile=$(MSBuildProjectFullPath);
+        SharedFrameworkLayoutDir=$(SharedFrameworkLayoutDir);
+        IntermediateOutputPath=$(SharedFrameworkIntermediateOutputPath);
+        MSBuildProjectExtensionsPath=$(SharedFrameworkIntermediateOutputPath);
+        PackageRID=$(PackageRID);
+        GenerateNetCoreAppRuntimeConfig=$(GenerateNetCoreAppRuntimeConfig);
+        GenerateRuntimeGraph=$(GenerateRuntimeGraph)" />
+  </Target>
+
   <!--
     Add note to Targeting Pack nupkg description that this package shouldn't be referenced directly.
     The packaging tooling normally only adds this to runtime packages.
diff --git a/src/installer/pkg/packaging-tools/packaging-tools.props b/src/installer/pkg/packaging-tools/packaging-tools.props
new file mode 100644 (file)
index 0000000..a42c345
--- /dev/null
@@ -0,0 +1,53 @@
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+  <PropertyGroup>
+    <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>$(ProductVersion)</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>
+  </PropertyGroup>
+
+  <PropertyGroup>
+    <SharedFrameworkLayoutDir>$(InstallerSourceIntermediateOutputDir)sharedFxLayout/</SharedFrameworkLayoutDir>
+  </PropertyGroup>
+
+  <PropertyGroup Condition="'$(IsFrameworkPackage)' == 'true'">
+    <Version>$(ProductVersion)</Version>
+    <OmitDependencies>true</OmitDependencies>
+    <SkipValidatePackage>true</SkipValidatePackage>
+  </PropertyGroup>
+
+  <PropertyGroup Condition="'$(InstallerFileNameWithoutExtension)' != '' AND '$(GenerateMSI)' == 'true'">
+    <OutputType>Package</OutputType>
+    <OutputName>$(InstallerFileNameWithoutExtension)</OutputName>
+  </PropertyGroup>
+
+</Project>
diff --git a/src/installer/pkg/packaging-tools/packaging-tools.targets b/src/installer/pkg/packaging-tools/packaging-tools.targets
new file mode 100644 (file)
index 0000000..f131b66
--- /dev/null
@@ -0,0 +1,59 @@
+<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'" />
+
+  <!--
+    Set up properties for installer file. These depend on properties defined in the project file.
+    (Unlike properties set up in packaging-tools.props, which shouldn't.)
+  -->
+  <Target Name="GetInstallerProperties">
+    <!-- Detect framework pack suffix and apply defaults. -->
+    <PropertyGroup Condition="'$(FrameworkPackType)' == 'targeting'">
+      <InstallerName>$(ShortFrameworkName)-targeting-pack</InstallerName>
+      <WixProductMoniker>$(TargetingPackBrandName)</WixProductMoniker>
+
+      <MacOSComponentName>com.microsoft.$(ShortFrameworkName).pack.$(FrameworkPackType).$(ProductVersion).component.osx.x64</MacOSComponentName>
+      <MacOSSharedInstallDir>/usr/local/share/dotnet</MacOSSharedInstallDir>
+    </PropertyGroup>
+
+    <PropertyGroup Condition="'$(GenerateSharedFramework)' == 'true'">
+      <InstallerName>$(ShortFrameworkName)-runtime</InstallerName>
+      <WixProductMoniker>$(SharedFrameworkBrandName)</WixProductMoniker>
+    </PropertyGroup>
+
+    <PropertyGroup>
+      <VersionedInstallerName>$(InstallerName)-$(ProductBandVersion)</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'"
+        >$(ProductVersion)-$(TargetArchitecture)</InstallerBuildPart>
+
+      <!-- Location to place the installer, in bin. -->
+      <InstallerFileNameWithoutExtension>$(InstallerName)-$(InstallerBuildPart)</InstallerFileNameWithoutExtension>
+      <InstallerFile>$(AssetOutputPath)$(InstallerFileNameWithoutExtension)$(InstallerExtension)</InstallerFile>
+    </PropertyGroup>
+  </Target>
+
+</Project>
diff --git a/src/installer/pkg/packaging-tools/sharedFramework/Directory.Build.props b/src/installer/pkg/packaging-tools/sharedFramework/Directory.Build.props
new file mode 100644 (file)
index 0000000..999058d
--- /dev/null
@@ -0,0 +1,11 @@
+<Project>
+
+  <!--
+    This Directory.Build.props prevents the SDK from skipping down to the root
+    Directory.Build.props, following the dir.props chain instead.
+
+    Specifically, gets LibPrefix, LibSuffix, etc.
+  -->
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+
+</Project>
diff --git a/src/installer/pkg/packaging-tools/sharedFramework/sharedFramework.csproj b/src/installer/pkg/packaging-tools/sharedFramework/sharedFramework.csproj
new file mode 100644 (file)
index 0000000..497c79e
--- /dev/null
@@ -0,0 +1,151 @@
+<Project Sdk="Microsoft.NET.Sdk" InitialTargets="GetPackageReference" DefaultTargets="Restore;Publish">
+  <!--
+    This project lays out a shared framework using the SDK targets.
+  -->
+
+  <UsingTask TaskName="ProcessSharedFrameworkDeps" AssemblyFile="$(LocalBuildToolsTaskDir)core-setup.tasks.dll" />
+
+  <PropertyGroup>
+    <TargetFramework>$(NETCoreAppFramework)</TargetFramework>
+    <RuntimeIdentifier>$(PackageRID)</RuntimeIdentifier>
+    <PackageId>unused</PackageId>
+
+    <ProjectDepsFileName>$(SharedFrameworkName).deps.json</ProjectDepsFileName>
+
+    <!--
+      When blank, MicrosoftNETPlatformLibrary defaults to Microsoft.NETCore.App. This property
+      causes the SDK to trim dependencies when publishing a framework-dependent app. We want to be
+      able to create Microsoft.NETCore.App here, so disable this behavior. Use a non-'' value to
+      avoid the default and make it hint at the goal in case it shows up in a weird place.
+    -->
+    <MicrosoftNETPlatformLibrary>do-not-consider-existing-platform</MicrosoftNETPlatformLibrary>
+
+    <!-- Don't reference NETCore.App -->
+    <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
+    <!-- Only Restore from our built packages -->
+    <RestoreSources>$(PackageOutputPath)</RestoreSources>
+    <!-- Ensure only this repo's NuGet.config file is used. -->
+    <RestoreConfigFile>$(ProjectDir)NuGet.config</RestoreConfigFile>
+    <!-- Use repo-restored packages for platforms and targets dependencies -->
+    <RestoreFallbackFolders>$(PackagesDir)</RestoreFallbackFolders>
+    <DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
+    <!-- Don't error due to lack of runtime-specific deps, we're referencing those directly -->
+    <EnsureRuntimePackageDependencies>false</EnsureRuntimePackageDependencies>
+    <!-- Use a project-local packages folder -->
+    <RestorePackagesPath>$(IntermediateOutputPath)packages</RestorePackagesPath>
+    <!-- Do not build or nor build in publish output or deps -->
+    <NoBuild>true</NoBuild>
+    <CopyBuildOutputToPublishDirectory>false</CopyBuildOutputToPublishDirectory>
+    <CopyOutputSymbolsToPublishDirectory>false</CopyOutputSymbolsToPublishDirectory>
+    <IncludeMainProjectInDepsFile>false</IncludeMainProjectInDepsFile>
+  </PropertyGroup>
+
+  <Target Name="GetPackageReference">
+    <Error Condition="'$(SharedFrameworkName)' == ''" Text="'SharedFrameworkName' property not specified." />
+    <Error Condition="'$(SharedFrameworkPkgprojFile)' == ''" Text="'SharedFrameworkPkgprojFile' property not specified." />
+
+    <MSBuild
+      Projects="$(SharedFrameworkPkgprojFile)"
+      Targets="GetPackageIdentity"
+      RemoveProperties="Configuration">
+      <Output TaskParameter="TargetOutputs" ItemName="PackageReference" />
+    </MSBuild>
+
+    <PropertyGroup>
+      <PublishDir>$(SharedFrameworkLayoutDir)%(PackageReference.Identity)/%(PackageReference.Version)/</PublishDir>
+    </PropertyGroup>
+  </Target>
+
+  <!--
+    During framework-dependent publish, Microsoft.NETCore.App's props file statically adds a
+    PackageConflictPlatformManifests item. This causes NuGet to remove files from publish output
+    because they're "already" defined in the shared framework. But we're creating a shared framework
+    here, so we need to remove the PackageConflictPlatformManifests items before they're used.
+  -->
+  <Target Name="RemovePlatformManifests"
+          BeforeTargets="
+            _HandlePublishFileConflicts;
+            _HandlePackageFileConflicts">
+    <ItemGroup>
+      <PackageConflictPlatformManifests Remove="@(PackageConflictPlatformManifests)" />
+    </ItemGroup>
+  </Target>
+
+  <Target Name="GenerateNetCoreAppRuntimeConfig"
+          Condition="'$(GenerateNetCoreAppRuntimeConfig)' == 'true'"
+          BeforeTargets="Publish">
+    <MakeDir Directories="$(PublishDir)" />
+    
+    <PropertyGroup>
+      <_runtimeConfigContent>
+      <![CDATA[
+{
+  "runtimeOptions": {
+    "tfm": "$(TargetFramework)",
+    "framework": {
+      "name": "Microsoft.NETCore.App",
+      "version": "$(SharedFrameworkNugetVersion)"
+    }
+  }
+}
+      ]]>
+      </_runtimeConfigContent>
+    </PropertyGroup>
+    
+    <WriteLinesToFile
+      File="$(PublishDir)$(SharedFrameworkName).runtimeconfig.json"
+      Lines="$(_runtimeConfigContent)"
+      Overwrite="true" />
+  </Target>
+
+  <Target Name="GenerateVersionFile"
+          DependsOnTargets="GetPackageReference"
+          BeforeTargets="Publish">
+    <!-- Generate .version file -->
+    <ItemGroup>
+      <VersionLines Include="$(LatestCommit)" />
+      <VersionLines Include="%(PackageReference.Version)" />
+    </ItemGroup>
+
+    <WriteLinesToFile
+      File="$(PublishDir).version"
+      Lines="@(VersionLines)"
+      Overwrite="true" />
+  </Target>
+
+  <!-- Clean up artifacts that dotnet-publish generates which we don't need -->
+  <Target Name="DeleteUnnecessaryPublishOutputs" AfterTargets="Publish">
+    <ItemGroup>
+      <ToDelete Include="$(PublishDir)apphost$(ExeSuffix)" />
+      <ToDelete Include="$(PublishDir)$(LibPrefix)comhost$(LibSuffix)" />
+      <ToDelete Include="$(PublishDir)$(LibPrefix)hostfxr$(LibSuffix)" />
+      <ToDelete Include="$(PublishDir)$(LibPrefix)ijwhost$(LibSuffix)" />
+    </ItemGroup>
+
+    <Delete Files="@(ToDelete)" />
+  </Target>
+
+  <Target Name="GenerateRuntimeGraph"
+          Condition="'$(GenerateRuntimeGraph)' == 'true'"
+          AfterTargets="Publish">
+    <PropertyGroup>
+      <SharedFrameworkAssetsFile>$(IntermediateOutputPath)/project.assets.json</SharedFrameworkAssetsFile>
+      <SharedFrameworkDepsFile>$(PublishDir)$(ProjectDepsFileName)</SharedFrameworkDepsFile>
+      <RuntimeGraphGeneratorRuntime Condition="'$(OSGroup)'=='Windows_NT'">win</RuntimeGraphGeneratorRuntime>
+      <RuntimeGraphGeneratorRuntime Condition="'$(OSGroup)'=='OSX'">osx</RuntimeGraphGeneratorRuntime>
+      <RuntimeGraphGeneratorRuntime Condition="'$(OSGroup)'=='FreeBSD'">freebsd</RuntimeGraphGeneratorRuntime>
+      <RuntimeGraphGeneratorRuntime Condition="'$(RuntimeGraphGeneratorRuntime)'==''">linux</RuntimeGraphGeneratorRuntime>
+    </PropertyGroup>
+
+    <ProcessSharedFrameworkDeps AssetsFilePath="$(SharedFrameworkAssetsFile)"
+                                DepsFilePath="$(SharedFrameworkDepsFile)"
+                                Runtime="$(RuntimeGraphGeneratorRuntime)"
+                                BuildToolsTaskDir="$(BuildToolsTaskDir)" />
+  </Target>
+
+  <Target Name="CleanPackages" BeforeTargets="Clean">
+    <RemoveDir Directories="$(PublishDir);$(RestorePackagesPath)" />
+    <Delete Files="$(ProjectAssetsFile)" />
+  </Target>
+
+</Project>
diff --git a/src/installer/pkg/packaging-tools/windows/product.common.wxi b/src/installer/pkg/packaging-tools/windows/product.common.wxi
new file mode 100644 (file)
index 0000000..463468f
--- /dev/null
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<Include xmlns="http://schemas.microsoft.com/wix/2006/wi">
+
+  <Package Compressed="yes" InstallScope="perMachine" InstallerVersion="200" />
+
+  <MajorUpgrade DowngradeErrorMessage="$(var.DowngradeErrorMessage)" Schedule="afterInstallInitialize"/>
+
+  <MediaTemplate CompressionLevel="high" EmbedCab="yes"/>
+
+  <Feature
+    Id="Provider"
+    Absent="disallow"
+    AllowAdvertise="no"
+    Description="Used for Ref Counting"
+    Display="hidden"
+    Level="1"
+    InstallDefault="local"
+    Title="RefCounting"
+    TypicalDefault="install">
+    <ComponentRef Id="$(var.DependencyKeyId)" />
+  </Feature>
+
+  <Property Id="MSIFASTINSTALL" Value="7" />
+
+  <WixVariable Id="WixUILicenseRtf" Value="$(var.MicrosoftEula)" />
+
+  <Property Id="WIXUI_INSTALLDIR" Value="DOTNETHOME"/>
+  <UIRef Id="WixUI_InstallDir" />
+
+  <CustomActionRef Id="WixBroadcastEnvironmentChange" />
+
+</Include>
diff --git a/src/installer/pkg/packaging-tools/windows/sharedFramework/product.wxs b/src/installer/pkg/packaging-tools/windows/sharedFramework/product.wxs
new file mode 100644 (file)
index 0000000..907ffd4
--- /dev/null
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+
+  <?include "..\variables.wxi" ?>
+
+  <Product
+    Id="*"
+    Name="$(var.ProductName)"
+    Language="$(var.ProductLanguage)"
+    Version="$(var.ProductVersion)"
+    Manufacturer="$(var.Manufacturer)"
+    UpgradeCode="$(var.UpgradeCode)">
+
+    <?include "..\product.common.wxi" ?>
+
+    <Feature Id="MainFeature" Title="Main Feature" Level="1">
+      <ComponentGroupRef Id="InstallFiles" />
+      <ComponentGroupRef Id="AuthoredRegistryKeys"/>
+    </Feature>
+  </Product>
+
+  <Fragment>
+    <Directory Id="TARGETDIR" Name="SourceDir">
+      <Directory Id="$(var.Program_Files)">
+        <Directory Id="DOTNETHOME" Name="dotnet" >
+          <Directory Id="SHARED" Name="shared" />
+        </Directory>
+      </Directory>
+    </Directory>
+  </Fragment>
+
+</Wix>
diff --git a/src/installer/pkg/packaging-tools/windows/sharedFramework/registrykeys.wxs b/src/installer/pkg/packaging-tools/windows/sharedFramework/registrykeys.wxs
new file mode 100644 (file)
index 0000000..95cd684
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+  <?include "..\Variables.wxi" ?>
+  <Fragment>
+    <ComponentGroup Id="AuthoredRegistryKeys">
+      <Component Id="SetupRegistry_x86" Directory="TARGETDIR" Win64="no">
+        <RegistryKey Root="HKLM" Key="SOFTWARE\dotnet\Setup\InstalledVersions\$(var.Platform)\sharedfx\$(var.FrameworkName)">
+          <RegistryValue Action="write" Name="$(var.NugetVersion)" Type="integer" Value="1" KeyPath="yes"/>
+        </RegistryKey>
+      </Component>
+    </ComponentGroup>
+  </Fragment>
+</Wix>
diff --git a/src/installer/pkg/packaging-tools/windows/targetingPack/product.wxs b/src/installer/pkg/packaging-tools/windows/targetingPack/product.wxs
new file mode 100644 (file)
index 0000000..ce6f91a
--- /dev/null
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+
+  <?include "..\variables.wxi" ?>
+
+  <Product
+    Id="*"
+    Name="$(var.ProductName)"
+    Language="$(var.ProductLanguage)"
+    Version="$(var.ProductVersion)"
+    Manufacturer="$(var.Manufacturer)"
+    UpgradeCode="$(var.UpgradeCode)">
+
+    <?include "..\product.common.wxi" ?>
+
+    <Feature Id="MainFeature" Title="Main Feature" Level="1">
+      <ComponentGroupRef Id="InstallFiles" />
+    </Feature>
+  </Product>
+
+  <Fragment>
+    <Directory Id="TARGETDIR" Name="SourceDir">
+      <Directory Id="$(var.Program_Files)">
+        <Directory Id="DOTNETHOME" Name="dotnet"/>
+      </Directory>
+    </Directory>
+  </Fragment>
+
+</Wix>
@@ -1,8 +1,9 @@
 <?xml version="1.0"?>
 <Include xmlns="http://schemas.microsoft.com/wix/2006/wi">
 
-  <?define Dotnet_ProductVersion   =   "$(var.BuildVersion)" ?>
-  <?define Dotnet_BuildVersion   =   "$(var.BuildVersion)" ?>
+  <?define Dotnet_ProductVersion = "$(var.BuildVersion)" ?>
+  <?define Dotnet_BuildVersion = "$(var.BuildVersion)" ?>
+
   <?define Manufacturer     =   "Microsoft Corporation" ?>
   <?define ProductName      =   "$(var.ProductMoniker) ($(var.TargetArchitecture))" ?>
   <?define ProductLanguage  =   "1033" ?>
   <?define DowngradeErrorMessage  = "A newer version is already installed; please uninstall it and re-run setup."?>
 
   <?define Platform   =   "$(sys.BUILDARCH)" ?>
+
   <?if $(var.Platform)=x86?>
-  <?define Program_Files="ProgramFilesFolder"?>
-  <?define Win64AttributeValue=no?>
+    <?define Program_Files="ProgramFilesFolder"?>
+    <?define Win64AttributeValue=no?>
   <?elseif $(var.Platform)=x64?>
-  <?define Program_Files="ProgramFiles64Folder"?>
-  <?define Win64AttributeValue=yes?>
+    <?define Program_Files="ProgramFiles64Folder"?>
+    <?define Win64AttributeValue=yes?>
   <?else?>
-  <?error Invalid Platform ($(var.Platform))?>
+    <?error Invalid Platform ($(var.Platform))?>
   <?endif?>
 
   <?define DependencyKey   = "$(var.DependencyKeyName)_$(var.BuildVersion)_$(var.Platform)"?>
   <?define DependencyKeyId = "$(var.DependencyKey)" ?>
-</Include>
\ No newline at end of file
+
+</Include>
diff --git a/src/installer/pkg/packaging-tools/windows/wix.targets b/src/installer/pkg/packaging-tools/windows/wix.targets
new file mode 100644 (file)
index 0000000..3dad253
--- /dev/null
@@ -0,0 +1,131 @@
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <!--
+    These targets use MSBuild Exec tasks to run WiX 3 toolset commands.
+
+    WiX 4 is expected to support running in .NET Core. Once using WiX 4, we can (more easily) remove
+    this file and switch to wixproj. See https://github.com/wixtoolset/issues/issues/5627
+  -->
+
+  <!--
+    If UpgradeCode isn't manually set, generate based on installer full path. Not suitable for
+    bundles.
+  -->
+  <Target Name="GetUpgradeCode"
+          DependsOnTargets="GetInstallerProperties"
+          Condition="'$(UpgradeCode)' == ''">
+    <GenerateGuidFromName Name="$(InstallerFile)">
+      <Output TaskParameter="GeneratedGuid" PropertyName="UpgradeCode" />
+    </GenerateGuidFromName>
+  </Target>
+
+  <!-- Set up information to pass to WiX, depending on the type of installer being created. -->
+  <Target Name="GetWixBuildConfiguration" DependsOnTargets="GetInstallerProperties">
+
+    <ItemGroup Condition="'$(FrameworkPackType)' == 'targeting'">
+      <DirectoryToHarvest
+        Include="$(PackLayoutDir)"
+        Name="install-files"
+        SubstituteVar="TargetingPackSrc"
+        ComponentGroupName="InstallFiles"
+        DirectoryRef="DOTNETHOME" />
+
+      <WixSrcFile Include="$(MSBuildThisFileDirectory)targetingPack/product.wxs" />
+    </ItemGroup>
+
+    <ItemGroup Condition="'$(GenerateSharedFramework)' == 'true'">
+      <DirectoryToHarvest
+        Include="$(SharedFrameworkLayoutDir)"
+        Name="install-shared-framework"
+        SubstituteVar="SharedFrameworkSrc"
+        ComponentGroupName="InstallFiles"
+        DirectoryRef="SHARED" />
+
+      <WixSrcFile Include="$(MSBuildThisFileDirectory)sharedFramework/product.wxs" />
+      <WixSrcFile Include="$(MSBuildThisFileDirectory)sharedFramework/registrykeys.wxs" />
+    </ItemGroup>
+
+    <ItemGroup>
+      <WixSrcFile Include="$(MSBuildThisFileDirectory)provider.wxs" />
+    </ItemGroup>
+  </Target>
+
+  <Target Name="RunHeatHarvester"
+          DependsOnTargets="GetWixBuildConfiguration">
+    <ItemGroup>
+      <DirectoryToHarvest
+        WixSourceFile="$(WixObjDir)%(Name).wxs"
+        WixObjFile="$(WixObjDir)%(Name).wixobj" />
+
+      <DirectoryToHarvest
+        Command="heat.exe ^
+          dir &quot;%(Identity)&quot; ^
+          -nologo ^
+          -template fragment ^
+          -sreg ^
+          -gg ^
+          -var var.%(SubstituteVar) ^
+          -cg %(ComponentGroupName) ^
+          -srd ^
+          -dr %(DirectoryRef) ^
+          -out %(WixSourceFile)" />
+    </ItemGroup>
+
+    <Message Importance="High" Text="Heat '$(MSBuildProjectName)'" />
+    <Exec Command="%(DirectoryToHarvest.Command)" WorkingDirectory="$(WixToolsDir)" />
+  </Target>
+
+  <Target Name="RunCandleCompiler"
+          DependsOnTargets="
+            GetWixBuildConfiguration;
+            GetUpgradeCode;
+            GenerateMsiVersionString">
+    <PropertyGroup>
+      <_wixArgs></_wixArgs>
+      <_wixArgs>$(_wixArgs) -nologo</_wixArgs>
+      <_wixArgs>$(_wixArgs) -ext WixDependencyExtension.dll</_wixArgs>
+      <_wixArgs>$(_wixArgs) -arch $(MsiArch)</_wixArgs>
+
+      <_wixArgs>$(_wixArgs) -dMicrosoftEula="$(MicrosoftEulaFile)"</_wixArgs>
+      <_wixArgs>$(_wixArgs) -dProductMoniker="$(WixProductMoniker)"</_wixArgs>
+      <_wixArgs>$(_wixArgs) -dFrameworkName="$(SharedFrameworkName)"</_wixArgs>
+      <_wixArgs>$(_wixArgs) -dBuildVersion="$(MsiVersionString)"</_wixArgs>
+      <_wixArgs>$(_wixArgs) -dNugetVersion="$(ProductVersion)"</_wixArgs>
+      <_wixArgs>$(_wixArgs) -dTargetArchitecture="$(TargetArchitecture)"</_wixArgs>
+      <_wixArgs>$(_wixArgs) -dUpgradeCode="$(UpgradeCode)"</_wixArgs>
+      <_wixArgs>$(_wixArgs) -dDependencyKeyName="$(InstallerName.Replace('-', '_'))"</_wixArgs>
+      <_wixArgs>$(_wixArgs) @(DirectoryToHarvest -> '-d%(SubstituteVar)="%(Identity)', ' ')" </_wixArgs>
+
+      <_wixArgs>$(_wixArgs) @(WixSrcFile -> '"%(Identity)"', ' ')</_wixArgs>
+      <_wixArgs>$(_wixArgs) @(DirectoryToHarvest -> '"%(WixSourceFile)"', ' ')</_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="
+            GetWixBuildConfiguration;
+            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) @(WixSrcFile -> '"$(WixObjDir)%(Filename).wixobj"', ' ')</_wixArgs>
+      <_wixArgs>$(_wixArgs) @(DirectoryToHarvest -> '"%(WixObjFile)"', ' ')</_wixArgs>
+
+      <_wixArgs>$(_wixArgs) -out $(InstallerFile)</_wixArgs>
+    </PropertyGroup>
+
+    <Message Importance="High" Text="Light '$(MSBuildProjectName)'" />
+    <Exec Command="light.exe $(_wixArgs)" WorkingDirectory="$(WixToolsDir)" />
+  </Target>
+
+</Project>
index 5b368e6..64c178d 100644 (file)
 
   <!-- Run the project-based installer creation infrastructure as well. -->
   <Target Name="GenerateProjectInstallers">
-    <MSBuild Targets="GenerateInstallers" Projects="..\projects\installer.builds" />
+    <MSBuild Projects="..\projects\installer.builds" />
   </Target>
 
   <Target Name="GenerateNugetPackages" DependsOnTargets="InitPackage" Condition="'$(UsePrebuiltPortableBinariesForInstallers)' == 'false'">
index 8d3652a..2461aed 100644 (file)
         "CommonTypes": [ ]
     },
     {
+        "Name": "Microsoft.WindowsDesktop.App",
+        "Description": "Shared Framework for Windows Forms and WPF.",
+        "CommonTypes": [ ]
+    },
+    {
         "Name": "Microsoft.WindowsDesktop.App.Ref",
         "Description": "Windows Forms and WPF targeting pack. Contains reference assemblies, documentation, and other design-time assets.",
         "CommonTypes": [ ]
index fbfc46b..bdd61d6 100644 (file)
@@ -62,7 +62,7 @@
     </Otherwise>
   </Choose>
 
-  <Import Project="packaging-tools\packaging-tools.props" />
+  <Import Project="$(PackagingToolsDir)packaging-tools.props" />
 
   <PropertyGroup Condition="'$(MSBuildProjectExtension)' == '.depproj'">
     <!-- we intentionally don't want to produce output -->
   <ItemGroup Condition="'$(PackageTargetRuntime)' == '' and '$(HasRuntimePackages)' != 'false'">
     <ProjectReference Include="@(RuntimeProject)" />
   </ItemGroup>
-
-  <ItemGroup>
-    <!--
-      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)"
-      Condition="
-        '$(FrameworkPackType)' == 'targeting' AND
-        '$(BuildDistroIndependentInstallers)' == 'true'" />
-  </ItemGroup>
   
 </Project>
\ No newline at end of file
index 3719ef4..0a29238 100644 (file)
@@ -1,7 +1,7 @@
 <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <Import Project="..\dir.targets" />
 
-  <Import Project="packaging-tools\packaging-tools.targets" />
+  <Import Project="$(PackagingToolsDir)packaging-tools.targets" />
 
   <UsingTask TaskName="CreateFrameworkListFile" AssemblyFile="$(LocalBuildToolsTaskDir)core-setup.tasks.dll"/>
   <UsingTask TaskName="GenerateFileVersionProps" AssemblyFile="$(LocalBuildToolsTaskDir)core-setup.tasks.dll"/>
 
       <Project Include="@(PkgSrcProject)" Phase="pkg" />
       <Project Include="@(PkgSrcProject)" Phase="src" />
-      <Project Include="@(InstallerPackageProject)" Phase="installer" />
+
+      <!--
+        Create targeting pack packages/installers. Similar to the runtime package, we only make one
+        Debian or RPM package for all distros of that type.
+      -->
+      <Project
+        Include="$(MSBuildProjectFullPath)"
+        Phase="installer"
+        Condition="
+          '$(FrameworkPackType)' == 'targeting' AND
+          '$(BuildDistroIndependentInstallers)' == 'true'" />
+    </ItemGroup>
+
+    <!-- Create shared framework and its installers. -->
+    <ItemGroup Condition="'$(GenerateSharedFramework)' == 'true' AND '$(BuildDistroIndependentInstallers)' == 'true'">
+      <Project Include="$(MSBuildProjectFullPath)" Phase="sharedfx" />
+      <!--
+        Currently any pkgproj is assumed to only build one type of installer, so there is no
+        distinction between this Project and a targeting pack installer Project. Some
+        AdditionalProperties may need to be added if this assumption doesn't hold up.
+      -->
+      <Project Include="$(MSBuildProjectFullPath)" Phase="installer" />
     </ItemGroup>
   </Target>
 
index 3597ba5..027f2d7 100644 (file)
@@ -9,7 +9,10 @@
     use this to build runtime packages, for example.
   -->
   <Target Name="ExpandProjects"
-          BeforeTargets="Build;GenerateInstallers">
+          BeforeTargets="
+            Build;
+            GenerateInstallers;
+            GenerateSharedFramework">
     <MSBuild Projects="@(ProjectProvider)" Targets="GetProjectsToBuild">
       <Output TaskParameter="TargetOutputs" ItemName="_everyProject" />
     </MSBuild>
index 6f29147..14c909f 100644 (file)
@@ -1,7 +1,11 @@
 <?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="GenerateInstallers" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
 
+  <PropertyGroup>
+    <BuildsFileTarget>GenerateInstallers</BuildsFileTarget>
+  </PropertyGroup>
+
   <ItemGroup>
     <ProjectProvider Include="**\*.pkgproj" Exclude="@(ProjectExclusions)" />
   </ItemGroup>
index 9361214..087ffdb 100644 (file)
@@ -7,6 +7,11 @@
     <BuildTargetPath>build/$(NETCoreAppFramework)</BuildTargetPath>
     <PlatformManifestTargetPath>$(BuildTargetPath)</PlatformManifestTargetPath>
     <FileVersionPropsTargetPath>$(BuildTargetPath)</FileVersionPropsTargetPath>
+
+    <GenerateRuntimeGraph>true</GenerateRuntimeGraph>
+
+    <!-- NETCoreApp sfx is still built by old tooling. Switchover is pending validation. -->
+    <GenerateSharedFramework>false</GenerateSharedFramework>
   </PropertyGroup>
 
   <!-- Identity / Reference package content -->
diff --git a/src/installer/pkg/projects/packaging-tools/packaging-tools.props b/src/installer/pkg/projects/packaging-tools/packaging-tools.props
deleted file mode 100644 (file)
index caf922c..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-
-  <PropertyGroup>
-    <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>$(ProductVersion)</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>
-
-    <MacOSComponentName>com.microsoft.$(ShortFrameworkName).pack.$(FrameworkPackType).$(ProductVersion).component.osx.x64</MacOSComponentName>
-    <MacOSSharedInstallDir>/usr/local/share/dotnet</MacOSSharedInstallDir>
-  </PropertyGroup>
-
-  <!-- Only targeting pack MSIs are currently supported by this infrastructure. -->
-  <PropertyGroup Condition="'$(FrameworkPackType)' != 'targeting'">
-    <GenerateMSI>false</GenerateMSI>
-    <GeneratePkg>false</GeneratePkg>
-  </PropertyGroup>
-
-  <PropertyGroup>
-    <VersionedInstallerName>$(InstallerName)-$(ProductBandVersion)</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'"
-      >$(ProductVersion)-$(TargetArchitecture)</InstallerBuildPart>
-
-    <!-- Location to place the installer, in bin. -->
-    <InstallerFileNameWithoutExtension>$(InstallerName)-$(InstallerBuildPart)</InstallerFileNameWithoutExtension>
-    <InstallerFile>$(AssetOutputPath)$(InstallerFileNameWithoutExtension)$(InstallerExtension)</InstallerFile>
-  </PropertyGroup>
-
-  <PropertyGroup Condition="'$(IsFrameworkPackage)' == 'true'">
-    <Version>$(ProductVersion)</Version>
-    <OmitDependencies>true</OmitDependencies>
-    <SkipValidatePackage>true</SkipValidatePackage>
-  </PropertyGroup>
-
-  <PropertyGroup Condition="'$(InstallerFileNameWithoutExtension)' != '' AND '$(GenerateMSI)' == 'true'">
-    <OutputType>Package</OutputType>
-    <OutputName>$(InstallerFileNameWithoutExtension)</OutputName>
-  </PropertyGroup>
-
-</Project>
diff --git a/src/installer/pkg/projects/packaging-tools/packaging-tools.targets b/src/installer/pkg/projects/packaging-tools/packaging-tools.targets
deleted file mode 100644 (file)
index 8611aea..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<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>
diff --git a/src/installer/pkg/projects/packaging-tools/windows/targetingpack.wxs b/src/installer/pkg/projects/packaging-tools/windows/targetingpack.wxs
deleted file mode 100644 (file)
index cde9e53..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
-    <?include "Variables.wxi" ?>
-    <Product Id="*" Name="$(var.ProductName)" Language="$(var.ProductLanguage)" Version="$(var.ProductVersion)" Manufacturer="$(var.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
-        <Package Compressed="yes" InstallScope="perMachine" InstallerVersion="200" />
-
-        <MajorUpgrade DowngradeErrorMessage="$(var.DowngradeErrorMessage)" Schedule="afterInstallInitialize"/>
-
-        <MediaTemplate CompressionLevel="high" EmbedCab="yes" />
-
-        <Feature Id="MainFeature" Title="Main Feature" Level="1">
-            <ComponentGroupRef Id="InstallFiles" />
-        </Feature>
-        <Feature Id="Provider" Absent="disallow" AllowAdvertise="no" Description="Used for Ref Counting" Display="hidden" Level="1" InstallDefault="local" Title="RefCounting" TypicalDefault="install">
-            <ComponentRef Id="$(var.DependencyKeyId)" />
-        </Feature>
-        <Property Id="ProductCPU" Value="$(var.Platform)" />
-        <Property Id="RTM_ProductVersion" Value="$(var.Dotnet_ProductVersion)" />
-
-        <Property Id="MSIFASTINSTALL" Value="7" />
-
-        <WixVariable Id="WixUILicenseRtf" Value="$(var.MicrosoftEula)" />
-
-        <Property Id="WIXUI_INSTALLDIR" Value="DOTNETHOME"/>
-        <UIRef Id="WixUI_InstallDir" />
-
-        <CustomActionRef Id="WixBroadcastEnvironmentChange" />
-    </Product>
-    <Fragment>
-        <Directory Id="TARGETDIR" Name="SourceDir">
-            <Directory Id="$(var.Program_Files)">
-                <Directory Id="DOTNETHOME" Name="dotnet"/>
-            </Directory>
-        </Directory>
-    </Fragment>
-</Wix>
diff --git a/src/installer/pkg/projects/sharedfx.builds b/src/installer/pkg/projects/sharedfx.builds
new file mode 100644 (file)
index 0000000..9713042
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+
+  <PropertyGroup>
+    <BuildsFileTarget>GenerateSharedFramework</BuildsFileTarget>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <ProjectProvider Include="**\*.pkgproj" Exclude="@(ProjectExclusions)" />
+  </ItemGroup>
+
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.traversal.targets))\dir.traversal.targets" />
+</Project>
index cf941f3..605ac70 100644 (file)
@@ -1,5 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <RIDPropsFile>$(MSBuildThisFileDirectory)windowsdesktopRIDs.props</RIDPropsFile>
+  </PropertyGroup>
+
   <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., dir.props))\dir.props" />
 
   <PropertyGroup>
@@ -16,4 +20,5 @@
     -->
     <PermitDllAndExeFilesLackingFileVersion>true</PermitDllAndExeFilesLackingFileVersion>
   </PropertyGroup>
+
 </Project>
diff --git a/src/installer/pkg/projects/windowsdesktop/pkg/Microsoft.WindowsDesktop.App.pkgproj b/src/installer/pkg/projects/windowsdesktop/pkg/Microsoft.WindowsDesktop.App.pkgproj
new file mode 100644 (file)
index 0000000..cfdcef8
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+
+  <PropertyGroup>
+    <PreventImplementationReference Condition="'$(PackageTargetRuntime)' != ''">true</PreventImplementationReference>
+    <BuildTargetPath>build/$(NETCoreAppFramework)</BuildTargetPath>
+    <PlatformManifestTargetPath>$(BuildTargetPath)</PlatformManifestTargetPath>
+    <FileVersionPropsTargetPath>$(BuildTargetPath)</FileVersionPropsTargetPath>
+
+    <GenerateSharedFramework>true</GenerateSharedFramework>
+    <GenerateNetCoreAppRuntimeConfig>true</GenerateNetCoreAppRuntimeConfig>
+  </PropertyGroup>
+
+  <!-- Identity / Reference package content -->
+  <ItemGroup Condition="'$(PackageTargetRuntime)' == ''">
+    <!-- reference RID specific packages to generate lineup -->
+    <ProjectReference Include="@(RuntimeProject)" />
+  </ItemGroup>
+
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+</Project>
index ca872f8..d810488 100644 (file)
@@ -3,9 +3,7 @@
   <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
 
   <ItemGroup>
-    <PackageReference Include="Microsoft.WindowsDesktop.App">
-      <Version>$(MicrosoftWindowsDesktopAppPackageVersion)</Version>
-    </PackageReference>
+    <PackageReference Include="Microsoft.Private.WindowsDesktop.App" Version="$(MicrosoftPrivateWindowsDesktopAppPackageVersion)" />
   </ItemGroup>
 
   <Target Name="GetDependencyVersionFiles" DependsOnTargets="ResolveNuGetPackages">
diff --git a/src/installer/pkg/projects/windowsdesktop/windowsdesktopRIDs.props b/src/installer/pkg/projects/windowsdesktop/windowsdesktopRIDs.props
new file mode 100644 (file)
index 0000000..4a31d5a
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+  <PropertyGroup>
+    <PackageRID Condition="'$(PackageRID)' == ''">$(OutputRid)</PackageRID>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <OfficialBuildRID Include="win-x86" Platform="x86" />
+    <OfficialBuildRID Include="win-x64"/>
+  </ItemGroup>
+
+</Project>