Skip to content

[WIP] Update to wix5 #62885

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

Draft
wants to merge 35 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
46fcb7f
Initial commit for wix5 update
wtgodbe Jul 23, 2025
8ba1613
Syntax error
wtgodbe Jul 23, 2025
61a709f
Update wixproj's
wtgodbe Jul 23, 2025
3e19f3f
Acquire wix sdk
wtgodbe Jul 23, 2025
68871e0
Fix d.b.p/t
wtgodbe Jul 23, 2025
c6351d2
More ordering stuff
wtgodbe Jul 23, 2025
7b55a21
Get rid of superfluous import
wtgodbe Jul 23, 2025
699e324
Another import removed
wtgodbe Jul 24, 2025
381647d
Custom SDK import
wtgodbe Jul 24, 2025
69ddc01
Another double import
wtgodbe Jul 24, 2025
045f463
Fix hint paths
wtgodbe Jul 24, 2025
21e8c19
Who needs extensions?
wtgodbe Jul 24, 2025
f22d06f
Switch target
wtgodbe Jul 24, 2025
7f377c4
Remove dead switch
wtgodbe Jul 24, 2025
55ab66b
A couple StandardDirectory fixes
wtgodbe Jul 25, 2025
7063711
Merge branch 'wtgodbe/Wix5' of https://github.com/dotnet/aspnetcore i…
wtgodbe Jul 25, 2025
343e522
Small fix
wtgodbe Jul 25, 2025
f740bbd
Back to dir
wtgodbe Jul 25, 2025
fee654b
Typo
wtgodbe Jul 25, 2025
7deda65
Formatting
wtgodbe Aug 5, 2025
cfa8ab7
More formatting
wtgodbe Aug 5, 2025
1f28613
No var.
wtgodbe Aug 5, 2025
b8fc724
Platform -> InstallerPlatform
wtgodbe Aug 5, 2025
f43f04d
No StandardDirectory
wtgodbe Aug 5, 2025
484247b
Fixups
wtgodbe Aug 5, 2025
f2d61eb
Remove unneeded compiles
wtgodbe Aug 5, 2025
34a1c5b
Set Scope
wtgodbe Aug 5, 2025
382e24c
Ref
wtgodbe Aug 5, 2025
c1bd159
Modularize it
wtgodbe Aug 6, 2025
bf6489d
Casing
wtgodbe Aug 6, 2025
fd65c7d
No Var for artifactsdir
wtgodbe Aug 6, 2025
058cec6
Set GUID
wtgodbe Aug 6, 2025
ba57e4e
Move the component into the feature
wtgodbe Aug 6, 2025
93beadb
Generate GUIDs for ANCM DepProviders
wtgodbe Aug 6, 2025
0e8e279
Cheeky workaround
wtgodbe Aug 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions eng/targets/BeforeWix.Common.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<!-- Targets for making .wixproj better. -->
<Project>
<ItemDefinitionGroup>
<!-- Override the MicroBuild default certs which still uses MicrosoftSHA1 and Microsoft401 -->
<SignCabs>
<Authenticode>Microsoft400</Authenticode>
</SignCabs>
<SignMsi>
<Authenticode>Microsoft400</Authenticode>
</SignMsi>
<SignBundle>
<Authenticode>Microsoft400</Authenticode>
</SignBundle>
<SignBundleEngine>
<Authenticode>Microsoft400</Authenticode>
</SignBundleEngine>
</ItemDefinitionGroup>

<PropertyGroup Condition="'$(OutputType)' == 'package'">
<!-- Set package version for SharedFx & TargetingPack wixproj's -->
<!-- Everything built in those projects _except_ the final package & MSI are shipping assets. -->
<_GeneratedPackageVersion>$(PackageVersion)</_GeneratedPackageVersion>
<_GeneratedPackageVersion
Condition="! $(PackageVersion.Contains('$(_PreReleaseLabel)'))">$(PackageVersion)-$(_PreReleaseLabel)$(_BuildNumberLabels)</_GeneratedPackageVersion>
<!-- Insert PackageVersion into OutputName for SharedFx & TargetingPack -->
<OutputName Condition="'$(OutputNamePrefix)' != '' AND '$(OutputNameSuffix)' != ''">$(OutputNamePrefix)$(_GeneratedPackageVersion)$(OutputNameSuffix)</OutputName>

<EmbedCab Condition="'$(EmbedCab)' == ''">yes</EmbedCab>
<InstallDir>$(ProductName)</InstallDir>

<DefineConstants Condition="'$(Configuration)' == 'Debug'">$(DefineConstants);Debug</DefineConstants>
<DefineConstants>$(DefineConstants);EmbedCab=$(EmbedCab)</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(OutputType)' == 'package' AND '$(Cabinet)' == '' ">
<Cabinet>$(OutputName.Replace('-', '_')).cab</Cabinet>
<Cabinet Condition=" '$(EmbedCab)' != 'yes' ">$(OutputName.Replace('_win', '')).cab</Cabinet>
</PropertyGroup>

<PropertyGroup>
<Culture Condition=" '$(Culture)' == '' ">en-US</Culture>
<Cultures Condition=" '$(Cultures)' == '' ">$(Culture)</Cultures>
<InstallerPlatform>$(Platform)</InstallerPlatform>
<OutDir Condition=" '$(OutDir)' == '' ">$(OutputPath)</OutDir>

<DefineConstants>$(DefineConstants);Cabinet=$(Cabinet)</DefineConstants>
<DefineConstants>$(DefineConstants);BinPath=$(OutputPath)$(Culture)\</DefineConstants>
<DefineConstants>$(WixVariables);$(DefineConstants)</DefineConstants>
</PropertyGroup>
</Project>
18 changes: 15 additions & 3 deletions eng/targets/Wix.Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
<SchemaVersion>2.0</SchemaVersion>
<ProductVersion>3.14</ProductVersion>
<WixVersion>$(MicrosoftSignedWixVersion)</WixVersion>
<Wix5Version>$(MicrosoftWixToolsetVersion)</Wix5Version>
<UseWix5>true</UseWix5>
</PropertyGroup>

<PropertyGroup>
<CustomBeforeWixTargets>$(MSBuildThisFileDirectory)BeforeWix.Common.targets</CustomBeforeWixTargets>
<TargetFrameworkMoniker>Native,Version=v0.0</TargetFrameworkMoniker>

<MSBuildProjectExtensionsPath>$(BaseIntermediateOutputPath)</MSBuildProjectExtensionsPath>
Expand All @@ -17,12 +20,21 @@
<NuGetRestoreTargets Condition="'$(NuGetRestoreTargets)'==''">$(MSBuildToolsPath)\NuGet.targets</NuGetRestoreTargets>
</PropertyGroup>

<Import Project="$(MSBuildProjectExtensionsPath)$(MSBuildProjectFile).*.props" Condition="'$(_ProjectExtensionsWereImported)' != 'true'" />

<ItemGroup>
<ItemGroup Condition="'$(UseWix5)' != 'true'">
<PackageReference Include="Microsoft.Signed.Wix" Version="$(WixVersion)" />
</ItemGroup>

<ItemGroup Condition="'$(UseWix5)' == 'true'">
<!-- Microsoft.Wix is a dotnet tool package, so exlude its assets. -->
<PackageReference Include="Microsoft.Wix" Version="$(MicrosoftWixToolsetVersion)" ExcludeAssets="all" />
<!-- Installers needs the $(PkgMicrosoftWixToolsetUIwixext) property to locate the extension. -->
<PackageReference Include="Microsoft.WixToolset.UI.wixext" Version="$(MicrosoftWixToolsetVersion)" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.WixToolset.Dependency.wixext" Version="$(MicrosoftWixToolsetVersion)" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.WixToolset.Util.wixext" Version="$(MicrosoftWixToolsetVersion)" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.WixToolset.Bal.wixext" Version="$(MicrosoftWixToolsetVersion)" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.WixToolset.Heat" Version="$(MicrosoftWixToolsetVersion)" />
</ItemGroup>

<PropertyGroup>
<SignOutput>false</SignOutput>
<DarkToolPath>$(WixExtDir)dark.exe</DarkToolPath>
Expand Down
53 changes: 0 additions & 53 deletions eng/targets/Wix.Common.targets
Original file line number Diff line number Diff line change
@@ -1,57 +1,4 @@
<!-- Targets for making .wixproj better. -->
<Project>

<ItemDefinitionGroup>
<!-- Override the MicroBuild default certs which still uses MicrosoftSHA1 and Microsoft401 -->
<SignCabs>
<Authenticode>Microsoft400</Authenticode>
</SignCabs>
<SignMsi>
<Authenticode>Microsoft400</Authenticode>
</SignMsi>
<SignBundle>
<Authenticode>Microsoft400</Authenticode>
</SignBundle>
<SignBundleEngine>
<Authenticode>Microsoft400</Authenticode>
</SignBundleEngine>
</ItemDefinitionGroup>

<PropertyGroup Condition="'$(OutputType)' == 'package'">
<!-- Set package version for SharedFx & TargetingPack wixproj's -->
<!-- Everything built in those projects _except_ the final package & MSI are shipping assets. -->
<_GeneratedPackageVersion>$(PackageVersion)</_GeneratedPackageVersion>
<_GeneratedPackageVersion
Condition="! $(PackageVersion.Contains('$(_PreReleaseLabel)'))">$(PackageVersion)-$(_PreReleaseLabel)$(_BuildNumberLabels)</_GeneratedPackageVersion>
<!-- Insert PackageVersion into OutputName for SharedFx & TargetingPack -->
<OutputName Condition="'$(OutputNamePrefix)' != '' AND '$(OutputNameSuffix)' != ''">$(OutputNamePrefix)$(_GeneratedPackageVersion)$(OutputNameSuffix)</OutputName>

<EmbedCab Condition="'$(EmbedCab)' == ''">yes</EmbedCab>
<InstallDir>$(ProductName)</InstallDir>

<DefineConstants Condition="'$(Configuration)' == 'Debug'">$(DefineConstants);Debug</DefineConstants>
<DefineConstants>$(DefineConstants);EmbedCab=$(EmbedCab)</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(OutputType)' == 'package' AND '$(Cabinet)' == '' ">
<Cabinet>$(OutputName.Replace('-', '_')).cab</Cabinet>
<Cabinet Condition=" '$(EmbedCab)' != 'yes' ">$(OutputName.Replace('_win', '')).cab</Cabinet>
</PropertyGroup>

<PropertyGroup>
<Culture Condition=" '$(Culture)' == '' ">en-US</Culture>
<Cultures Condition=" '$(Cultures)' == '' ">$(Culture)</Cultures>
<InstallerPlatform>$(Platform)</InstallerPlatform>
<OutDir Condition=" '$(OutDir)' == '' ">$(OutputPath)</OutDir>

<DefineConstants>$(DefineConstants);Cabinet=$(Cabinet)</DefineConstants>
<DefineConstants>$(DefineConstants);BinPath=$(OutputPath)$(Culture)\</DefineConstants>
<DefineConstants>$(WixVariables);$(DefineConstants)</DefineConstants>
</PropertyGroup>

<Import Project="$(NuGetRestoreTargets)" />
<Import Project="$(MSBuildProjectExtensionsPath)$(MSBuildProjectFile).*.targets" />
<Import Project="$(WixTargetsPath)" Condition="'$(WixTargetsPath)' != '' " />
<!-- Don't import the Microbuild signing targets when post build sign is enabled. They override the
standard Wix targets for signing, and call ESRP directly (rather than through SignTool). So without this,
ASPNetCore will sign even when PostbuildSign == true -->
Expand Down
3 changes: 2 additions & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.25372.103",
"Microsoft.DotNet.SharedFramework.Sdk": "10.0.0-beta.25372.103",
"Microsoft.Build.NoTargets": "3.7.0",
"Microsoft.Build.Traversal": "3.4.0"
"Microsoft.Build.Traversal": "3.4.0",
"Microsoft.WixToolset.Sdk": "5.0.2-dotnet.2737382"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.props))\Directory.Build.props" />

<!-- 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="Sdk.props" Sdk="Microsoft.WixToolset.Sdk" />
<PropertyGroup>
<Name>AspNetCoreModuleV2IISExpress</Name>
<IsShipping>true</IsShipping>
Expand All @@ -15,26 +14,18 @@
<TempPlatform Condition="'$(Platform)' == 'x86'">Win32</TempPlatform>
<TempPlatform Condition="'$(Platform)' == 'arm64'">ARM64</TempPlatform>
<ToolsetInstallerNuspecFile>$(MSBuildProjectDirectory)\$(MSBuildProjectName).nuspec</ToolsetInstallerNuspecFile>
<!-- We import D.B.T ourselves in this file -->
<ImportDirectoryBuildTargets>false</ImportDirectoryBuildTargets>
</PropertyGroup>

<ItemGroup>
<WixExtension Include="WixUtilExtension">
<HintPath>$(WixExtDir)\WixUtilExtension.dll</HintPath>
<Name>WixUtilExtension</Name>
</WixExtension>
<WixExtension Include="WixDependencyExtension">
<HintPath>$(WixExtDir)\WixDependencyExtension.dll</HintPath>
<Name>WixDependencyExtension</Name>
</WixExtension>
<WixExtension Include="WixUIExtension">
<HintPath>$(WixExtDir)\WixUIExtension.dll</HintPath>
<Name>WixUIExtension</Name>
</WixExtension>
</ItemGroup>
<PropertyGroup>
<ANCMDepProviderKey Condition="'$(Platform)' == 'x86'">IISExpress_AspNetCore_Module_V2,x86</ANCMDepProviderKey>
<ANCMDepProviderKey Condition="'$(Platform)' != 'x86'">IISExpress_AspNetCore_Module_V2,x64</ANCMDepProviderKey>
<DefineConstants>$(DefineConstants);ANCMDepProviderKey=$(ANCMDepProviderKey)</DefineConstants>
</PropertyGroup>

<ItemGroup>
<Compile Include="ancm_iis_expressv2.wxs" />
<Compile Include="$(IIS-Setup)iisca\wix3\iisca.wxs">
<Compile Include="$(IIS-Setup)iisca\wix5\iisca.wxs">
<Link>iisca.wxs</Link>
</Compile>
<EmbeddedResource Include="..\setupstrings.wxl">
Expand Down Expand Up @@ -66,6 +57,7 @@
<Copy SourceFiles="@(BuildContentForAncmHandler)" DestinationFolder="$(InstallersOutputPath)\IISExpressSymbols\$(TempPlatform)" />
</Target>

<Import Project="Sdk.targets" Sdk="Microsoft.WixToolset.Sdk" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
<Import Project="..\build\settings.props" />

Expand Down
Loading
Loading