Skip to content

Commit 41a0114

Browse files
[EnvVar][Hosts][RegPrev]Decouple and refactor to make it "packable" as nuget package (#32604)
* WIP Hosts - remove deps * Add consumer app * Move App and MainWindow to Consumer app. Make Hosts dll * Try consume it * Fix errors * Make it work with custom build targets * Dependency injection Refactor Explicit page creation Wire missing dependencies * Fix installer * Remove unneeded stuff * Fix build again * Extract UI and logic from MainWindow to RegistryPreviewMainPage * Convert to lib Change namespace to RegistryPreviewUILib Remove PT deps * Add exe app and move App.xaml and MainWindow.xaml * Consume the lib * Update Hosts package creation * Fix RegistryPreview package creation * Rename RegistryPreviewUI back to RegistryPreview * Back to consuming lib * Ship icons and assets in nuget packages * Rename to EnvironmentVariablesUILib and convert to lib * Add app and consume * Telemetry * GPO * nuget * Rename HostsPackageConsumer to Hosts and Hosts lib to HostsUILib * Assets cleanup * nuget struct * v0 * assets * [Hosts] Re-add AppList to Lib Assets, [RegPrev] Copy lib assets to out dir * Sign UI dlls * Revert WinUIEx bump * Cleanup * Align deps * version exception dll * Fix RegistryPreview crashes * XAML format * XAML format 2 * Pack .pri files in lib/ dir --------- Co-authored-by: Darshak Bhatti <[email protected]>
1 parent 28ba2bd commit 41a0114

File tree

125 files changed

+2097
-1212
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+2097
-1212
lines changed

.pipelines/ESRPSigning_core.json

+3
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
"PowerToys.SvgThumbnailProviderCpp.dll",
9797

9898
"WinUI3Apps\\PowerToys.HostsModuleInterface.dll",
99+
"WinUI3Apps\\PowerToys.HostsUILib.dll",
99100
"WinUI3Apps\\PowerToys.Hosts.dll",
100101
"WinUI3Apps\\PowerToys.Hosts.exe",
101102

@@ -113,6 +114,7 @@
113114
"WinUI3Apps\\Powertoys.Peek.dll",
114115

115116
"WinUI3Apps\\PowerToys.EnvironmentVariablesModuleInterface.dll",
117+
"WinUI3Apps\\PowerToys.EnvironmentVariablesUILib.dll",
116118
"WinUI3Apps\\PowerToys.EnvironmentVariables.dll",
117119
"WinUI3Apps\\PowerToys.EnvironmentVariables.exe",
118120

@@ -186,6 +188,7 @@
186188
"WinUI3Apps\\PowerRenameContextMenuPackage.msix",
187189

188190
"WinUI3Apps\\PowerToys.RegistryPreviewExt.dll",
191+
"WinUI3Apps\\PowerToys.RegistryPreviewUILib.dll",
189192
"WinUI3Apps\\PowerToys.RegistryPreview.dll",
190193
"WinUI3Apps\\PowerToys.RegistryPreview.exe",
191194

.pipelines/versionAndSignCheck.ps1

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ $versionExceptions = @(
2020
"Microsoft.Xaml.Interactivity.dll",
2121
"hyjiacan.py4n.dll",
2222
"Microsoft.WindowsAppRuntime.Release.Net.dll",
23-
"Microsoft.Windows.Widgets.Projection.dll") -join '|';
23+
"Microsoft.Windows.Widgets.Projection.dll",
24+
"WinRT.Host.Shim.dll") -join '|';
2425
$nullVersionExceptions = @(
2526
"codicon.ttf",
2627
"e_sqlite3.dll",

Directory.Packages.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,4 @@
9797
<PackageVersion Include="Microsoft.VariantAssignment.Client" Version="2.4.17140001" />
9898
<PackageVersion Include="Microsoft.VariantAssignment.Contract" Version="3.0.16990001" />
9999
</ItemGroup>
100-
</Project>
100+
</Project>

PowerToys.sln

+48-3
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MeasureToolUI", "src\module
448448
EndProject
449449
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PowerAccentKeyboardService", "src\modules\poweraccent\PowerAccentKeyboardService\PowerAccentKeyboardService.vcxproj", "{C97D9A5D-206C-454E-997E-009E227D7F02}"
450450
EndProject
451-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hosts", "src\modules\Hosts\Hosts\Hosts.csproj", "{31D1C81D-765F-4446-AA62-E743F6325049}"
451+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HostsUILib", "src\modules\Hosts\HostsUILib\HostsUILib.csproj", "{31D1C81D-765F-4446-AA62-E743F6325049}"
452452
EndProject
453453
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Hosts", "Hosts", "{F05E590D-AD46-42BE-9C25-6A63ADD2E3EA}"
454454
EndProject
@@ -518,7 +518,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PastePlainModuleInterface",
518518
EndProject
519519
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AllExperiments", "src\common\AllExperiments\AllExperiments.csproj", "{9CE59ED5-7087-4353-88EB-788038A73CEC}"
520520
EndProject
521-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RegistryPreviewUI", "src\modules\registrypreview\RegistryPreviewUI\RegistryPreviewUI.csproj", "{FD86C06A-FB54-4D5E-9831-1CDADF60D45F}"
521+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RegistryPreviewUILib", "src\modules\registrypreview\RegistryPreviewUILib\RegistryPreviewUILib.csproj", "{FD86C06A-FB54-4D5E-9831-1CDADF60D45F}"
522522
EndProject
523523
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RegistryPreviewExt", "src\modules\registrypreview\RegistryPreviewExt\RegistryPreviewExt.vcxproj", "{697C6AF9-0A48-49A9-866C-67DA12384015}"
524524
EndProject
@@ -546,7 +546,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTests-FancyZonesEditor"
546546
EndProject
547547
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EnvironmentVariables", "EnvironmentVariables", "{538ED0BB-B863-4B20-98CC-BCDF7FA0B68A}"
548548
EndProject
549-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EnvironmentVariables", "src\modules\EnvironmentVariables\EnvironmentVariables\EnvironmentVariables.csproj", "{51465DA1-C18B-4B99-93E1-ECF8E0FA0CBA}"
549+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EnvironmentVariablesUILib", "src\modules\EnvironmentVariables\EnvironmentVariablesUILib\EnvironmentVariablesUILib.csproj", "{51465DA1-C18B-4B99-93E1-ECF8E0FA0CBA}"
550550
EndProject
551551
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EnvironmentVariablesModuleInterface", "src\modules\EnvironmentVariables\EnvironmentVariablesModuleInterface\EnvironmentVariablesModuleInterface.vcxproj", "{B9420661-B0E4-4241-ABD4-4A27A1F64250}"
552552
EndProject
@@ -568,6 +568,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FileLocksmithContextMenu",
568568
EndProject
569569
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FileLocksmithLib", "src\modules\FileLocksmith\FileLocksmithLib\FileLocksmithLib.vcxproj", "{9D52FD25-EF90-4F9A-A015-91EFC5DAF54F}"
570570
EndProject
571+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hosts", "src\modules\Hosts\Hosts\Hosts.csproj", "{02DD46D3-F761-47D9-8894-2D6DA0124650}"
572+
EndProject
573+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RegistryPreview", "src\modules\registrypreview\RegistryPreview\RegistryPreview.csproj", "{8E23E173-7127-4A5F-9F93-3049F2B68047}"
574+
EndProject
575+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EnvironmentVariables", "src\modules\EnvironmentVariables\EnvironmentVariables\EnvironmentVariables.csproj", "{DFF88D16-D36F-40A4-A955-CDCAA76EF7B8}"
576+
EndProject
571577
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UITests-FancyZones", "src\modules\fancyzones\UITests-FancyZones\UITests-FancyZones.csproj", "{FE38FC07-1C05-4B57-ADA3-2FE2F53C6A52}"
572578
EndProject
573579
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UITests-FancyZonesEditor", "src\modules\fancyzones\UITests-FancyZonesEditor\UITests-FancyZonesEditor.csproj", "{3A9A791E-94A9-49F8-8401-C11CE288D5FB}"
@@ -2507,6 +2513,42 @@ Global
25072513
{9D52FD25-EF90-4F9A-A015-91EFC5DAF54F}.Release|x64.Build.0 = Release|x64
25082514
{9D52FD25-EF90-4F9A-A015-91EFC5DAF54F}.Release|x86.ActiveCfg = Release|x64
25092515
{9D52FD25-EF90-4F9A-A015-91EFC5DAF54F}.Release|x86.Build.0 = Release|x64
2516+
{02DD46D3-F761-47D9-8894-2D6DA0124650}.Debug|ARM64.ActiveCfg = Debug|ARM64
2517+
{02DD46D3-F761-47D9-8894-2D6DA0124650}.Debug|ARM64.Build.0 = Debug|ARM64
2518+
{02DD46D3-F761-47D9-8894-2D6DA0124650}.Debug|x64.ActiveCfg = Debug|x64
2519+
{02DD46D3-F761-47D9-8894-2D6DA0124650}.Debug|x64.Build.0 = Debug|x64
2520+
{02DD46D3-F761-47D9-8894-2D6DA0124650}.Debug|x86.ActiveCfg = Debug|x64
2521+
{02DD46D3-F761-47D9-8894-2D6DA0124650}.Debug|x86.Build.0 = Debug|x64
2522+
{02DD46D3-F761-47D9-8894-2D6DA0124650}.Release|ARM64.ActiveCfg = Release|ARM64
2523+
{02DD46D3-F761-47D9-8894-2D6DA0124650}.Release|ARM64.Build.0 = Release|ARM64
2524+
{02DD46D3-F761-47D9-8894-2D6DA0124650}.Release|x64.ActiveCfg = Release|x64
2525+
{02DD46D3-F761-47D9-8894-2D6DA0124650}.Release|x64.Build.0 = Release|x64
2526+
{02DD46D3-F761-47D9-8894-2D6DA0124650}.Release|x86.ActiveCfg = Release|x64
2527+
{02DD46D3-F761-47D9-8894-2D6DA0124650}.Release|x86.Build.0 = Release|x64
2528+
{8E23E173-7127-4A5F-9F93-3049F2B68047}.Debug|ARM64.ActiveCfg = Debug|ARM64
2529+
{8E23E173-7127-4A5F-9F93-3049F2B68047}.Debug|ARM64.Build.0 = Debug|ARM64
2530+
{8E23E173-7127-4A5F-9F93-3049F2B68047}.Debug|x64.ActiveCfg = Debug|x64
2531+
{8E23E173-7127-4A5F-9F93-3049F2B68047}.Debug|x64.Build.0 = Debug|x64
2532+
{8E23E173-7127-4A5F-9F93-3049F2B68047}.Debug|x86.ActiveCfg = Debug|x64
2533+
{8E23E173-7127-4A5F-9F93-3049F2B68047}.Debug|x86.Build.0 = Debug|x64
2534+
{8E23E173-7127-4A5F-9F93-3049F2B68047}.Release|ARM64.ActiveCfg = Release|ARM64
2535+
{8E23E173-7127-4A5F-9F93-3049F2B68047}.Release|ARM64.Build.0 = Release|ARM64
2536+
{8E23E173-7127-4A5F-9F93-3049F2B68047}.Release|x64.ActiveCfg = Release|x64
2537+
{8E23E173-7127-4A5F-9F93-3049F2B68047}.Release|x64.Build.0 = Release|x64
2538+
{8E23E173-7127-4A5F-9F93-3049F2B68047}.Release|x86.ActiveCfg = Release|x64
2539+
{8E23E173-7127-4A5F-9F93-3049F2B68047}.Release|x86.Build.0 = Release|x64
2540+
{DFF88D16-D36F-40A4-A955-CDCAA76EF7B8}.Debug|ARM64.ActiveCfg = Debug|ARM64
2541+
{DFF88D16-D36F-40A4-A955-CDCAA76EF7B8}.Debug|ARM64.Build.0 = Debug|ARM64
2542+
{DFF88D16-D36F-40A4-A955-CDCAA76EF7B8}.Debug|x64.ActiveCfg = Debug|x64
2543+
{DFF88D16-D36F-40A4-A955-CDCAA76EF7B8}.Debug|x64.Build.0 = Debug|x64
2544+
{DFF88D16-D36F-40A4-A955-CDCAA76EF7B8}.Debug|x86.ActiveCfg = Debug|x64
2545+
{DFF88D16-D36F-40A4-A955-CDCAA76EF7B8}.Debug|x86.Build.0 = Debug|x64
2546+
{DFF88D16-D36F-40A4-A955-CDCAA76EF7B8}.Release|ARM64.ActiveCfg = Release|ARM64
2547+
{DFF88D16-D36F-40A4-A955-CDCAA76EF7B8}.Release|ARM64.Build.0 = Release|ARM64
2548+
{DFF88D16-D36F-40A4-A955-CDCAA76EF7B8}.Release|x64.ActiveCfg = Release|x64
2549+
{DFF88D16-D36F-40A4-A955-CDCAA76EF7B8}.Release|x64.Build.0 = Release|x64
2550+
{DFF88D16-D36F-40A4-A955-CDCAA76EF7B8}.Release|x86.ActiveCfg = Release|x64
2551+
{DFF88D16-D36F-40A4-A955-CDCAA76EF7B8}.Release|x86.Build.0 = Release|x64
25102552
{FE38FC07-1C05-4B57-ADA3-2FE2F53C6A52}.Debug|ARM64.ActiveCfg = Debug|ARM64
25112553
{FE38FC07-1C05-4B57-ADA3-2FE2F53C6A52}.Debug|ARM64.Build.0 = Debug|ARM64
25122554
{FE38FC07-1C05-4B57-ADA3-2FE2F53C6A52}.Debug|x64.ActiveCfg = Debug|x64
@@ -2764,6 +2806,9 @@ Global
27642806
{0014D652-901F-4456-8D65-06FC5F997FB0} = {4C0D0746-BE5B-49EE-BD5D-A7811628AE8B}
27652807
{799A50D8-DE89-4ED1-8FF8-AD5A9ED8C0CA} = {AB82E5DD-C32D-4F28-9746-2C780846188E}
27662808
{9D52FD25-EF90-4F9A-A015-91EFC5DAF54F} = {AB82E5DD-C32D-4F28-9746-2C780846188E}
2809+
{02DD46D3-F761-47D9-8894-2D6DA0124650} = {F05E590D-AD46-42BE-9C25-6A63ADD2E3EA}
2810+
{8E23E173-7127-4A5F-9F93-3049F2B68047} = {929C1324-22E8-4412-A9A8-80E85F3985A5}
2811+
{DFF88D16-D36F-40A4-A955-CDCAA76EF7B8} = {538ED0BB-B863-4B20-98CC-BCDF7FA0B68A}
27672812
{FE38FC07-1C05-4B57-ADA3-2FE2F53C6A52} = {D1D6BC88-09AE-4FB4-AD24-5DED46A791DD}
27682813
{3A9A791E-94A9-49F8-8401-C11CE288D5FB} = {D1D6BC88-09AE-4FB4-AD24-5DED46A791DD}
27692814
{C0974915-8A1D-4BF0-977B-9587D3807AB7} = {D1D6BC88-09AE-4FB4-AD24-5DED46A791DD}

nuget.config

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
12
<configuration>
23
<packageSources>
34
<clear />

src/common/utils/modulesRegistry.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ inline registry::ChangeSet getRegistryPreviewChangeSet(const std::wstring instal
262262
changes.push_back({ scope, L"Software\\Classes\\regfile\\shell\\preview\\command", std::nullopt, command });
263263

264264
std::wstring icon_path = installationDir;
265-
icon_path.append(L"\\WinUI3Apps\\Assets\\RegistryPreview\\app.ico");
265+
icon_path.append(L"\\WinUI3Apps\\Assets\\RegistryPreview\\RegistryPreview.ico");
266266
changes.push_back({ scope, L"Software\\Classes\\regfile\\shell\\preview", L"icon", icon_path });
267267

268268
return { changes };
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<Import Project="..\..\..\Version.props" />
3-
43
<PropertyGroup>
54
<OutputType>WinExe</OutputType>
65
<TargetFramework>net8.0-windows10.0.20348.0</TargetFramework>
76
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
87
<SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
98
<RootNamespace>EnvironmentVariables</RootNamespace>
109
<ApplicationManifest>app.manifest</ApplicationManifest>
10+
<Platforms>x86;x64;ARM64</Platforms>
1111
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
1212
<UseWinUI>true</UseWinUI>
1313
<EnableMsixTooling>true</EnableMsixTooling>
@@ -16,22 +16,37 @@
1616
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
1717
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
1818
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
19+
<SelfContained>true</SelfContained>
20+
<DefineConstants>DISABLE_XAML_GENERATED_MAIN,TRACE</DefineConstants>
1921
<OutputPath>..\..\..\..\$(Platform)\$(Configuration)\WinUI3Apps</OutputPath>
2022
<AssemblyName>PowerToys.EnvironmentVariables</AssemblyName>
21-
<DefineConstants>DISABLE_XAML_GENERATED_MAIN,TRACE</DefineConstants>
22-
<ApplicationIcon>Assets/EnvironmentVariables/EnvironmentVariables.ico</ApplicationIcon>
23-
<SelfContained>true</SelfContained>
23+
<ApplicationIcon>Assets\EnvironmentVariables\EnvironmentVariables.ico</ApplicationIcon>
2424
<!-- MRT from windows app sdk will search for a pri file with the same name of the module before defaulting to resources.pri -->
2525
<ProjectPriFileName>PowerToys.EnvironmentVariables.pri</ProjectPriFileName>
2626
</PropertyGroup>
2727

2828
<ItemGroup>
29-
<Compile Remove="Styles\**" />
30-
<EmbeddedResource Remove="Styles\**" />
31-
<None Remove="Styles\**" />
32-
<Page Remove="Styles\**" />
29+
<Page Remove="EnvironmentVariablesXAML\App.xaml" />
30+
</ItemGroup>
31+
<ItemGroup>
32+
<ApplicationDefinition Include="EnvironmentVariablesXAML\App.xaml" />
33+
</ItemGroup>
34+
<ItemGroup>
35+
<Folder Include="EnvironmentVariablesXAML\" />
3336
</ItemGroup>
3437

38+
<Target Name="CopyPRIFileToOutputDir" AfterTargets="Build">
39+
<Message Text="Executing CopyPRIFileToOutputDir task" Importance="High" />
40+
41+
<ItemGroup>
42+
<PRIFile Include="$(OutDir)**\PowerToys.EnvironmentVariablesUILib.pri" />
43+
</ItemGroup>
44+
45+
<Copy SourceFiles="@(PRIFile)" DestinationFolder="$(OutDir)" />
46+
47+
<Message Text="Copied CopyPRIFileToOutputDir files" Importance="High" />
48+
</Target>
49+
3550
<!-- SelfContained=true requires RuntimeIdentifier to be set -->
3651
<PropertyGroup Condition="'$(Platform)'=='x64'">
3752
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
@@ -48,48 +63,22 @@
4863
</PropertyGroup>
4964

5065
<ItemGroup>
51-
<None Remove="EnvironmentVariablesXAML\Views\MainPage.xaml" />
52-
</ItemGroup>
53-
54-
<ItemGroup>
55-
<Page Remove="EnvironmentVariablesXAML\App.xaml" />
56-
</ItemGroup>
57-
<ItemGroup>
58-
<ApplicationDefinition Include="EnvironmentVariablesXAML\App.xaml" />
59-
</ItemGroup>
60-
61-
<ItemGroup>
62-
<Content Include="Assets\EnvironmentVariables\SplashScreen.scale-200.png" />
63-
<Content Include="Assets\EnvironmentVariables\LockScreenLogo.scale-200.png" />
64-
<Content Include="Assets\EnvironmentVariables\Square150x150Logo.scale-200.png" />
65-
<Content Include="Assets\EnvironmentVariables\Square44x44Logo.scale-200.png" />
66-
<Content Include="Assets\EnvironmentVariables\Square44x44Logo.targetsize-24_altform-unplated.png" />
67-
<Content Include="Assets\EnvironmentVariables\StoreLogo.png" />
68-
<Content Include="Assets\EnvironmentVariables\Wide310x150Logo.scale-200.png" />
66+
<!-- HACK: Common.UI is referenced, even if it is not used, to force dll versions to be the same as in other projects that use it. It's still unclear why this is the case, but this is need for flattening the install directory. -->
67+
<ProjectReference Include="..\..\..\common\Common.UI\Common.UI.csproj" />
68+
<ProjectReference Include="..\..\..\common\ManagedCommon\ManagedCommon.csproj" />
69+
<ProjectReference Include="..\..\..\common\GPOWrapper\GPOWrapper.vcxproj" />
70+
<ProjectReference Include="..\EnvironmentVariablesUILib\EnvironmentVariablesUILib.csproj" />
6971
</ItemGroup>
7072

7173
<ItemGroup>
7274
<PackageReference Include="Microsoft.Windows.CsWinRT" />
7375
<PackageReference Include="Microsoft.Extensions.Hosting" />
7476
<PackageReference Include="Microsoft.WindowsAppSDK" />
7577
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" />
76-
<PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" />
77-
<PackageReference Include="CommunityToolkit.Mvvm" />
78-
<PackageReference Include="CommunityToolkit.WinUI.Controls.SettingsControls" />
79-
<PackageReference Include="CommunityToolkit.WinUI.Controls.Segmented" />
80-
<PackageReference Include="CommunityToolkit.WinUI.Controls.Primitives" />
81-
<PackageReference Include="CommunityToolkit.WinUI.Converters" />
82-
<PackageReference Include="CommunityToolkit.WinUI.Controls.Sizers" />
8378
<PackageReference Include="WinUIEx" />
8479
<Manifest Include="$(ApplicationManifest)" />
8580
</ItemGroup>
8681

87-
<ItemGroup>
88-
<!-- HACK: Common.UI is referenced, even if it is not used, to force dll versions to be the same as in other projects that use it. It's still unclear why this is the case, but this is need for flattening the install directory. -->
89-
<ProjectReference Include="..\..\..\common\Common.UI\Common.UI.csproj" />
90-
<ProjectReference Include="..\..\..\common\GPOWrapper\GPOWrapper.vcxproj" />
91-
</ItemGroup>
92-
9382
<!--
9483
Defining the "Msix" ProjectCapability here allows the Single-project MSIX Packaging
9584
Tools extension to be activated for this project even if the Windows App SDK Nuget
@@ -98,12 +87,13 @@
9887
<ItemGroup Condition="'$(DisableMsixProjectCapabilityAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
9988
<ProjectCapability Include="Msix" />
10089
</ItemGroup>
101-
<ItemGroup>
102-
<Page Update="EnvironmentVariablesXAML\Views\MainPage.xaml">
103-
<Generator>MSBuild:Compile</Generator>
104-
</Page>
105-
</ItemGroup>
106-
<ItemGroup>
107-
<PRIResource Remove="Styles\**" />
108-
</ItemGroup>
90+
91+
<!--
92+
Defining the "HasPackageAndPublishMenuAddedByProject" property here allows the Solution
93+
Explorer "Package and Publish" context menu entry to be enabled for this project even if
94+
the Windows App SDK Nuget package has not yet been restored.
95+
-->
96+
<PropertyGroup Condition="'$(DisableHasPackageAndPublishMenuAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
97+
<HasPackageAndPublishMenu>true</HasPackageAndPublishMenu>
98+
</PropertyGroup>
10999
</Project>

0 commit comments

Comments
 (0)