-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[WiX 5] Migrate SDK from v3 to v5 #48699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1a383a9
78ef998
0498cc7
fbeaf9a
ba026e9
5376bce
93d82c2
6097207
1174585
13575cf
eae53c7
53f8f29
6538603
1d85ec3
597e613
0d0e221
9f1b031
0cf48df
86563a2
9b8cc2c
dba9968
e254b01
83e34db
d8116cd
1cf816c
05bc7fc
7f30869
81a0bf6
89bcde4
2a195d0
be170d3
75b67aa
f518704
ae28b5b
8948dac
bb4137a
32ede71
d2941f4
e86002d
77e98af
c464656
7575954
1109be8
c6be598
f1f9ba8
17dbaf3
035903c
d908c78
8bc686c
84e034b
135f19c
c42e1c7
bf3363d
dabe3a7
57a4dda
9843cb1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
@echo off | ||
|
||
setlocal | ||
|
||
echo %* | findstr /C:"-pack" >nul | ||
if %errorlevel%==0 ( | ||
set SkipBuildingInstallers= | ||
set skipFlags="/p:SkipUsingCrossgen=false /p:SkipBuildingInstallers=false" | ||
) else ( | ||
REM skip crossgen for inner-loop builds to save a ton of time | ||
set skipFlags="/p:SkipUsingCrossgen=true /p:SkipBuildingInstallers=true" | ||
) | ||
set DOTNET_SYSTEM_NET_SECURITY_NOREVOCATIONCHECKBYDEFAULT=true | ||
powershell -NoLogo -NoProfile -ExecutionPolicy ByPass -command "& """%~dp0eng\common\build.ps1""" -restore -build -msbuildEngine dotnet %skipFlags% %*" | ||
|
||
endlocal | ||
exit /b %ErrorLevel% |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<Project Sdk="Microsoft.Build.NoTargets"> | ||
<Project Sdk="Microsoft.Build.NoTargets"> | ||
|
||
<PropertyGroup> | ||
<BuildSdkRpm Condition="'$(BuildSdkRpm)' == '' and '$(IsRPMBasedDistro)' == 'true'">true</BuildSdkRpm> | ||
|
@@ -33,6 +33,22 @@ | |
|
||
<ItemGroup> | ||
<ProjectReference Include="..\redist\redist.csproj" ReferenceOutputAssembly="false" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(OS)' == 'Windows_NT'"> | ||
<!-- These project references ensure that package references for WiX extensions are correctly restored. The Idle target is a no-op as the | ||
projects are built later when computed properties are available. These properties do not exist when projects are evaluated. --> | ||
Comment on lines
+39
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a crazy "hack". I've never seen that Idle target used before. Is this something @rainersigwald suggested? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, @rainersigwald and I chatted about this. The problem with invoking There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Submitted #49964 as a clean-up |
||
<ProjectReference Include="windows\msis\placeholder\placeholder.wixproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" | ||
Targets="Idle" /> | ||
<ProjectReference Include="windows\msis\templates\templates.wixproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" | ||
Targets="Idle" /> | ||
<ProjectReference Include="windows\msis\toolset\toolset.wixproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" | ||
Targets="Idle" /> | ||
<ProjectReference Include="windows\bundles\sdk\bundle.wixproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" | ||
Targets="Idle" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Installers" /> | ||
</ItemGroup> | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the MIT license. See License.txt in the project root for full license information. --> | ||
<Project> | ||
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" /> | ||
|
||
<PropertyGroup> | ||
<!-- Currently, WiX only supports 'full' for the -pdbType option. This affects both bundle and package projects. --> | ||
<DebugType>full</DebugType> | ||
|
||
<!-- .wixproj defaults to AnyCPU which eventually defaults to x86. InstallerPlatform determines the bitness of | ||
the installer and should always match for MSIs. For bundles, we have to remain on x86. --> | ||
<InstallerPlatform Condition="'$(InstallerPlatform)' == ''">$(TargetArchitecture)</InstallerPlatform> | ||
<Platform>$(InstallerPlatform)</Platform> | ||
<PlatformName>$(InstallerPlatform)</PlatformName> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(MSBuildProjectExtension)' == '.wixproj'"> | ||
<DefineConstants>$(DefineConstants);SdkFeatureBandVersion=$(CliProductBandVersion)00</DefineConstants> | ||
<DefineConstants>$(DefineConstants);ProductLanguage=1033</DefineConstants> | ||
<DefineConstants>$(DefineConstants);Manufacturer=Microsoft Corporation</DefineConstants> | ||
<DefineConstants>$(DefineConstants);MajorVersion=$(VersionMajor)</DefineConstants> | ||
<DefineConstants>$(DefineConstants);MinorVersion=$(VersionMinor)</DefineConstants> | ||
<DefineConstants>$(DefineConstants);TargetArchitecture=$(TargetArchitecture)</DefineConstants> | ||
|
||
<!-- Technically we don't support .NET on any version of Windows where the version of Windows Installer is less than 5.0. --> | ||
<DefineConstants Condition="'$(InstallerPlatform)' != 'arm64'">$(DefineConstants);InstallerVersion=200</DefineConstants> | ||
<DefineConstants Condition="'$(InstallerPlatform)' == 'arm64'">$(DefineConstants);InstallerVersion=500</DefineConstants> | ||
</PropertyGroup> | ||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the MIT license. See License.txt in the project root for full license information. --> | ||
<Project> | ||
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.targets', '$(MSBuildThisFileDirectory)../'))" /> | ||
|
||
<PropertyGroup Condition="'$(MSBuildProjectExtension)' == '.wixproj'"> | ||
<!-- Example: Microsoft .NET SDK 10.0.100 --> | ||
<DefineConstants>$(DefineConstants);SdkBrandName=$(SdkBrandName)</DefineConstants> | ||
<!-- Example: Microsoft .NET SDK 10.0.100 (x64) --> | ||
<DefineConstants>$(DefineConstants);SdkPlatformBrandName=$(SdkBrandName) ($(TargetArchitecture))</DefineConstants> | ||
|
||
<!-- NativeMachine values match the expected values for image file machine constants | ||
https://docs.microsoft.com/en-us/windows/win32/sysinfo/image-file-machine-constants --> | ||
<DefineConstants>$(DefineConstants);NativeMachine_x86=332</DefineConstants> | ||
<DefineConstants>$(DefineConstants);NativeMachine_x64=34404</DefineConstants> | ||
<DefineConstants>$(DefineConstants);NativeMachine_arm64=43620</DefineConstants> | ||
|
||
<!-- This is the full semenatic version of the SDK. --> | ||
<DefineConstants>$(DefineConstants);Version=$(Version)</DefineConstants> | ||
<!-- BundleVersion is used by MSIs when generating provider keys, but ProductVersion is never used when generating bundles. --> | ||
<DefineConstants Condition="'$(ProductVersion)' != ''">$(DefineConstants);ProductVersion=$(ProductVersion)</DefineConstants> | ||
<DefineConstants Condition="'$(BundleVersion)' != ''">$(DefineConstants);BundleVersion=$(BundleVersion)</DefineConstants> | ||
</PropertyGroup> | ||
|
||
<!-- MSI upgrade codes are generated based on the name of the installer, which typically includes the version and platform information. --> | ||
<Target Name="GenerateUpgradeCode" BeforeTargets="CoreCompile"> | ||
<Error Condition="'$(InstallerPath)' == '' AND '$(UpgradeCode)' == ''" | ||
Text="Unable to compute UpgradeCode. The InstallerPath property is not set." /> | ||
|
||
<!-- Only use the file name when generating the GUID. Full paths may be inconsistent across different build environments. --> | ||
<GenerateGuidFromName Name="$([System.IO.Path]::GetFileName($(InstallerPath)))" Condition="'$(UpgradeCode)' == ''"> | ||
<Output TaskParameter="GeneratedGuid" PropertyName="UpgradeCode" /> | ||
</GenerateGuidFromName> | ||
|
||
<PropertyGroup> | ||
<DefineConstants>$(DefineConstants);UpgradeCode=$(UpgradeCode)</DefineConstants> | ||
</PropertyGroup> | ||
</Target> | ||
|
||
<!-- This target does nothing. It's intended to allow ProjectReference items to specify a target that has | ||
no build impact, but allow projects to participate in restore operations. --> | ||
<Target Name="Idle" /> | ||
|
||
<!-- This target is intended to catch changes that require someone to investigate. --> | ||
<Target Name="ValidateBuild" BeforeTargets="CoreCompile"> | ||
<!-- Bundles must target x86 for back compat. --> | ||
<Error Condition="'$(OutputType)' == 'Bundle' AND '$(InstallerPlatform)' != 'x86'" | ||
Text="Bundles must target x86. InstallerPlatform=$(InstallerPlatform)" /> | ||
</Target> | ||
|
||
<Target Name="GenerateWixpackPackage" AfterTargets="CoreCompile"> | ||
<PropertyGroup> | ||
<WixpackWorkingDir>$(IntermediateOutputPath)wixpack</WixpackWorkingDir> | ||
<WixpackOutputDir>$(ArtifactsNonShippingPackagesDir)</WixpackOutputDir> | ||
</PropertyGroup> | ||
|
||
<CreateWixBuildWixpack | ||
BindTrackingFile="$(IntermediateOutputPath)$(BindTrackingFilePrefix)%(CultureGroup.OutputSuffix)$(BindTrackingFileExtension)" | ||
Cultures="%(CultureGroup.Identity)" | ||
DefineConstants="$(DefineConstants);$(SolutionDefineConstants);$(ProjectDefineConstants);$(ProjectReferenceDefineConstants)" | ||
Extensions="@(_ResolvedWixExtensionPaths)" | ||
InstallerPlatform="$(InstallerPlatform)" | ||
InstallerFile="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetFileName)" | ||
IntermediateDirectory="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)" | ||
OutputFolder="$(WixpackOutputDir)" | ||
OutputType="$(OutputType)" | ||
PdbFile="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetPdbFileName)" | ||
PdbType="$(DebugType)" | ||
SourceFiles="@(Compile)" | ||
WixpackWorkingDir="$(WixpackWorkingDir)"> | ||
<Output TaskParameter="OutputFile" PropertyName="_WixBuildCommandPackageNameOutput" /> | ||
</CreateWixBuildWixpack> | ||
</Target> | ||
</Project> |
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.