dotnet-installer/src/redist/targets/GenerateMSIs.targets

204 lines
11 KiB
Text
Raw Normal View History

2016-06-28 01:26:57 +00:00
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2018-10-31 20:56:32 +00:00
<Target Name="SetupWixProperties" DependsOnTargets="GetCurrentRuntimeInformation">
2017-02-23 18:37:48 +00:00
<!-- AcquireWix Properties -->
<PropertyGroup>
2018-01-02 20:37:00 +00:00
<WixVersion>3.10.4</WixVersion>
2017-02-23 18:37:48 +00:00
<WixDownloadUrl>https://dotnetcli.azureedge.net/build/wix/wix.$(WixVersion).zip</WixDownloadUrl>
2018-10-31 20:56:32 +00:00
<WixRoot>$(ArtifactsDir)Tools/WixTools/$(WixVersion)</WixRoot>
2017-02-23 18:37:48 +00:00
<WixDestinationPath>$(WixRoot)/WixTools.$(WixVersion).zip</WixDestinationPath>
<WixDownloadSentinel>$(WixRoot)/WixDownload.$(WixVersion).sentinel</WixDownloadSentinel>
</PropertyGroup>
<!-- Generate MSI/Bundle Properties -->
<PropertyGroup>
2018-10-31 20:56:32 +00:00
<CombinedFrameworkSdkHostBundleEngineName>$(ArtifactsShippingPackagesDir)/$(ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)-engine.exe</CombinedFrameworkSdkHostBundleEngineName>
2017-02-23 18:37:48 +00:00
2018-10-31 20:56:32 +00:00
<SdkGenerateMsiPowershellScript>$(MSBuildThisFileDirectory)packaging/windows/clisdk/generatemsi.ps1</SdkGenerateMsiPowershellScript>
<SdkStableFileIdForApphostTransform>$(MSBuildThisFileDirectory)packaging/windows/clisdk/stablefileidforapphosttransform.xslt</SdkStableFileIdForApphostTransform>
<SdkGenerateBundlePowershellScript>$(MSBuildThisFileDirectory)packaging/windows/clisdk/generatebundle.ps1</SdkGenerateBundlePowershellScript>
<SdkGenerateNupkgPowershellScript>$(MSBuildThisFileDirectory)packaging/windows/clisdk/generatenupkg.ps1</SdkGenerateNupkgPowershellScript>
2017-02-23 18:37:48 +00:00
2018-10-31 20:56:32 +00:00
<SdkInstallerNuspecFile>$(MSBuildThisFileDirectory)packaging/windows/clisdk/VS.Redist.Common.Net.Core.SDK.$(Architecture).nuspec</SdkInstallerNuspecFile>
<SdkInstallerNupkgFile>$(ArtifactsShippingPackagesDir)VS.Redist.Common.Net.Core.SDK.$(Architecture).$(FullNugetVersion).nupkg</SdkInstallerNupkgFile>
2018-10-31 20:56:32 +00:00
<!--<SdkMSBuildExtensionsNuspecFile>$(MSBuildThisFileDirectory)packaging/windows/clisdk/VS.Redist.Common.Net.Core.SDK.MSBuildExtensions.nuspec</SdkMSBuildExtensionsNuspecFile>
<SdkMSBuildExtensionsNupkgFile>$(ArtifactsShippingPackagesDir)VS.Redist.Common.Net.Core.SDK.MSBuildExtensions.$(FullNugetVersion).nupkg</SdkMSBuildExtensionsNupkgFile>
<SdkMSBuildExtensionsSwrFile>$(ArtifactsShippingPackagesDir)VS.Redist.Common.Net.Core.SDK.MSBuildExtensions.swr</SdkMSBuildExtensionsSwrFile>-->
2017-02-23 18:37:48 +00:00
</PropertyGroup>
<PropertyGroup>
2018-11-06 22:29:00 +00:00
<SdkMSIInstallerFile>$(ArtifactsShippingPackagesDir)$(ArtifactNameWithVersionSdk)$(InstallerExtension)</SdkMSIInstallerFile>
<CombinedFrameworkSdkHostMSIInstallerFile>$(ArtifactsShippingPackagesDir)$(ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(BundleExtension)</CombinedFrameworkSdkHostMSIInstallerFile>
2018-10-31 20:56:32 +00:00
2018-11-02 06:15:59 +00:00
<!--<SdkDebianIntermediateDirectory>$(IntermediateOutputPath)debian/sdk/</SdkDebianIntermediateDirectory>
2018-10-31 20:56:32 +00:00
<LayoutDirectory Condition=" '$(OSName)' == 'ubuntu' OR '$(OSName)' == 'debian' ">$(SdkDebianIntermediateDirectory)debianLayoutDirectory</LayoutDirectory>
<LayoutDirectory Condition=" '$(OSName)' != 'ubuntu' AND '$(OSName)' != 'debian' ">$(IntermediateOutputPath)layouts</LayoutDirectory>
<SdkLayoutOutputDirectory>$(LayoutDirectory)$(ArtifactNameSdk)</SdkLayoutOutputDirectory>
2018-11-02 06:15:59 +00:00
<MSBuildExtensionsOutputDirectory>$(LayoutDirectory)MSBuildExtensions</MSBuildExtensionsOutputDirectory>-->
2017-02-23 18:37:48 +00:00
</PropertyGroup>
2018-10-31 20:56:32 +00:00
</Target>
2016-06-28 01:26:57 +00:00
2018-10-31 20:56:32 +00:00
<Target Name="MsiTargetsSetupInputOutputs"
DependsOnTargets="GenerateLayout;SetupWixProperties;GetCoreSdkGitCommitInfo">
<!-- Generate SDK MSI Inputs -->
<ItemGroup>
<GenerateSdkMsiInputs Include="$(SdkInternalLayoutPath)**/*;
$(SdkGenerateMsiPowershellScript)" />
2018-10-31 20:56:32 +00:00
</ItemGroup>
<!-- Consumed By Publish -->
<ItemGroup>
2018-11-06 22:29:00 +00:00
<GeneratedInstallers Include="$(SdkMSIInstallerFile);$(CombinedFrameworkSdkHostMSIInstallerFile)" />
2018-10-31 20:56:32 +00:00
</ItemGroup>
<GenerateMsiVersion CommitCount="$(GitCommitCount)"
VersionMajor="$(VersionMajor)"
VersionMinor="$(VersionMinor)"
VersionPatch="$(VersionPatch)">
<Output TaskParameter="MsiVersion" PropertyName="MsiVersion" />
</GenerateMsiVersion>
2018-11-06 22:29:00 +00:00
<GenerateGuidFromName Name="$(SdkMSIInstallerFile)">
2018-10-31 20:56:32 +00:00
<Output TaskParameter="OutputGuid"
PropertyName="SdkInstallerUpgradeCode" />
</GenerateGuidFromName>
2018-11-06 22:29:00 +00:00
<GenerateGuidFromName Name="$(CombinedFrameworkSdkHostMSIInstallerFile)">
2018-10-31 20:56:32 +00:00
<Output TaskParameter="OutputGuid"
PropertyName="CombinedFrameworkSDKHostInstallerUpgradeCode" />
</GenerateGuidFromName>
</Target>
<Target Name="AcquireWix"
DependsOnTargets="SetupWixProperties;MsiTargetsSetupInputOutputs"
Inputs="$(WixDownloadSentinel)"
Outputs="$(WixDestinationPath)">
<!-- Setup sentinel to take advantage of incrementality -->
<MakeDir Directories="$(WixRoot)" />
<WriteLinesToFile
File="$(WixDownloadSentinel)"
Lines="$(WixVersion)"
Overwrite="true"
Encoding="Unicode"/>
<DownloadFile
Uri="$(WixDownloadUrl)"
DestinationPath="$(WixDestinationPath)"
Overwrite="false" />
<ExtractArchiveToDirectory
SourceArchive="$(WixDestinationPath)"
DestinationDirectory="$(WixRoot)" />
</Target>
<Target Name="GenerateSdkMsi"
DependsOnTargets="GenerateLayout;AcquireWix;MsiTargetsSetupInputOutputs;SetSdkBrandingInfo"
Condition=" '$(OS)' == 'Windows_NT'"
Inputs="@(GenerateSdkMsiInputs)"
2018-11-06 22:29:00 +00:00
Outputs="$(SdkMSIInstallerFile)">
2018-10-31 20:56:32 +00:00
<Exec Command="powershell -NoProfile -NoLogo $(SdkGenerateMsiPowershellScript) ^
'$(SdkInternalLayoutPath.TrimEnd('\'))' ^
2018-11-06 22:29:00 +00:00
'$(SdkMSIInstallerFile)' ^
2018-09-26 20:15:34 +00:00
'$(WixRoot)' ^
'$(SdkBrandName)' ^
'$(MsiVersion)' ^
'$(SimpleVersion)' ^
'$(NugetVersion)' ^
'$(SdkInstallerUpgradeCode)' ^
'$(Architecture)' ^
'$(SdkStableFileIdForApphostTransform)' ^
2018-10-31 20:56:32 +00:00
-InformationAction Continue" />
</Target>
2016-06-28 01:26:57 +00:00
2018-10-31 20:56:32 +00:00
<Target Name="GenerateSdkBundle"
DependsOnTargets="GenerateLayout;AcquireWix;MsiTargetsSetupInputOutputs;GenerateSdkMsi"
Condition=" '$(OS)' == 'Windows_NT'"
2018-11-06 22:29:00 +00:00
Inputs="$(SdkMSIInstallerFile);
2016-06-28 01:26:57 +00:00
$(DownloadedSharedFrameworkInstallerFile);
$(DownloadedHostFxrInstallerFile);
$(DownloadedSharedHostInstallerFile);
$(SdkGenerateBundlePowershellScript)"
2018-11-06 22:29:00 +00:00
Outputs="$(CombinedFrameworkSdkHostMSIInstallerFile)">
2018-10-31 20:56:32 +00:00
<Exec Command="powershell -NoProfile -NoLogo $(SdkGenerateBundlePowershellScript) ^
2018-11-06 22:29:00 +00:00
'$(SdkMSIInstallerFile)' ^
2018-10-31 20:56:32 +00:00
'$(IntermediateOutputPath)downloads\$(DownloadedAspNetCoreSharedFxInstallerFileName)' ^
'$(IntermediateOutputPath)downloads\$(DownloadedSharedFrameworkInstallerFileName)' ^
'$(IntermediateOutputPath)downloads\$(DownloadedHostFxrInstallerFileName)' ^
'$(IntermediateOutputPath)downloads\$(DownloadedSharedHostInstallerFileName)' ^
'$(IntermediateOutputPath)downloads\$(DownloadedWinFormsAndWpfSharedFrameworkInstallerFileName)' ^
2018-11-06 22:29:00 +00:00
'$(CombinedFrameworkSdkHostMSIInstallerFile)' ^
2018-09-26 20:15:34 +00:00
'$(WixRoot)' ^
'$(SdkBrandName)' ^
'$(MsiVersion)' ^
'$(SimpleVersion)' ^
'$(NugetVersion)' ^
'$(CombinedFrameworkSDKHostInstallerUpgradeCode)' ^
'$(Architecture)' ^
'$(MicrosoftNETCoreAppPackageVersion)' ^
2018-10-31 20:56:32 +00:00
'$(AspNetCoreVersion)' ^
-InformationAction Continue " />
</Target>
<Target Name="GenerateSdkNupkg"
DependsOnTargets="GenerateLayout;MsiTargetsSetupInputOutputs;GenerateSdkBundle"
Condition=" '$(OS)' == 'Windows_NT'"
2018-11-06 22:29:00 +00:00
Inputs="$(CombinedFrameworkSdkHostMSIInstallerFile);
$(SdkInstallerNuspecFile);
$(SdkGenerateNupkgPowershellScript)"
2018-10-31 20:56:32 +00:00
Outputs="$(SdkInstallerNupkgFile)">
2018-10-31 20:56:32 +00:00
<!--<Exec Command="powershell -NoProfile -NoLogo $(SdkGenerateNupkgPowershellScript) ^
2018-11-06 22:29:00 +00:00
'$(CombinedFrameworkSdkHostMSIInstallerFile)' ^
2018-09-26 20:15:34 +00:00
'$(FullNugetVersion)' ^
'$(SdkInstallerNuspecFile)' ^
2018-10-31 20:56:32 +00:00
'$(SdkInstallerNupkgFile)'" />-->
</Target>
2018-10-31 20:56:32 +00:00
<Target Name="GenerateSdkMSBuildExtensionsNupkg"
DependsOnTargets="GenerateLayout;MsiTargetsSetupInputOutputs;GenerateSdkBundle"
Condition=" '$(OS)' == 'Windows_NT' And '$(Architecture)' == 'x64' "
Inputs="$(MSBuildExtensionsLayoutDirectory)/**/*;
$(SdkInstallerNuspecFile);
$(SdkGenerateNupkgPowershellScript)"
2018-10-31 20:56:32 +00:00
Outputs="$(SdkMSBuildExtensionsNupkgFile);$(SdkMSBuildExtensionsSwrFile)">
2018-10-31 20:56:32 +00:00
<!-- Disabling this for now because we don't have the MSBuildExtensions available. -->
2017-10-13 18:52:47 +00:00
2018-10-31 20:56:32 +00:00
<!-- <Exec Command="powershell -NoProfile -NoLogo -InformationAction Continue $(SdkGenerateNupkgPowershellScript) ^
2018-09-26 20:15:34 +00:00
'$(MSBuildExtensionsLayoutDirectory)' ^
'$(FullNugetVersion)' ^
'$(SdkMSBuildExtensionsNuspecFile)' ^
'$(SdkMSBuildExtensionsNupkgFile)'" />
<GenerateMSBuildExtensionsSWR MSBuildExtensionsLayoutDirectory="$(MSBuildExtensionsLayoutDirectory)"
2017-10-13 18:52:47 +00:00
OutputFile="$(SdkMSBuildExtensionsSwrFile)"/> -->
2018-10-31 20:56:32 +00:00
</Target>
<Target Name="GenerateMsis"
DependsOnTargets="GenerateLayout;
2016-06-28 01:26:57 +00:00
MsiTargetsSetupInputOutputs;
AcquireWix;
GenerateSdkMsi;
GenerateSdkBundle;
GenerateSdkNupkg;
2017-10-13 18:52:47 +00:00
GenerateSdkMSBuildExtensionsNupkg"
Condition=" '$(OS)' == 'Windows_NT' and !$(Architecture.StartsWith('arm'))" />
2016-06-28 01:26:57 +00:00
2018-10-31 20:56:32 +00:00
<!-- These targets are used in signing, don't remove them! -->
<!--<Target Name="ExtractEngineFromSdkBundle"
DependsOnTargets="MsiTargetsSetupInputOutputs">
2018-11-06 22:29:00 +00:00
<Exec Command="$(WixRoot)/insignia.exe -ib $(CombinedFrameworkSdkHostMSIInstallerFile) -o $(CombinedFrameworkSdkHostBundleEngineName)" />
2016-06-28 01:26:57 +00:00
</Target>
<Target Name="ReattachEngineToSdkBundle"
DependsOnTargets="MsiTargetsSetupInputOutputs">
2018-11-06 22:29:00 +00:00
<Exec Command="$(WixRoot)/insignia.exe -ab $(CombinedFrameworkSdkHostBundleEngineName) $(CombinedFrameworkSdkHostMSIInstallerFile) -o $(CombinedFrameworkSdkHostMSIInstallerFile)" />
2018-10-31 20:56:32 +00:00
</Target>-->
2016-06-28 01:26:57 +00:00
</Project>