Skip to content
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

Bringing Project Ironsides into Dev Home #2887

Merged
merged 13 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions DevHome.sln
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevSetupAgent.Test", "exten
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HyperVExtension.HostGuestCommunication", "extensions\HyperVExtension\src\HyperVExtension.HostGuestCommunication\HyperVExtension.HostGuestCommunication.csproj", "{D759CD66-494C-4A00-8075-8B65A9891349}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevHome.PI", "tools\PI\DevHome.PI\DevHome.PI.csproj", "{CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PI", "PI", "{DB3D0F2C-1A7F-44B4-B408-B21A56212985}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Customization", "Customization", "{623998FD-B0A6-4980-95D5-A5072301CA10}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevHome.Customization", "tools\Customization\DevHome.Customization\DevHome.Customization.csproj", "{AF527EA4-6A24-4BD6-BC6E-A5863DC3489C}"
Expand Down Expand Up @@ -614,6 +618,18 @@ Global
{D759CD66-494C-4A00-8075-8B65A9891349}.Release|x64.Build.0 = Release|x64
{D759CD66-494C-4A00-8075-8B65A9891349}.Release|x86.ActiveCfg = Release|x86
{D759CD66-494C-4A00-8075-8B65A9891349}.Release|x86.Build.0 = Release|x86
{CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Debug|arm64.ActiveCfg = Debug|ARM64
{CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Debug|arm64.Build.0 = Debug|ARM64
{CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Debug|x64.ActiveCfg = Debug|x64
{CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Debug|x64.Build.0 = Debug|x64
{CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Debug|x86.ActiveCfg = Debug|x86
{CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Debug|x86.Build.0 = Debug|x86
{CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Release|arm64.ActiveCfg = Release|ARM64
{CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Release|arm64.Build.0 = Release|ARM64
{CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Release|x64.ActiveCfg = Release|x64
{CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Release|x64.Build.0 = Release|x64
{CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Release|x86.ActiveCfg = Release|x86
{CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725}.Release|x86.Build.0 = Release|x86
{AF527EA4-6A24-4BD6-BC6E-A5863DC3489C}.Debug|arm64.ActiveCfg = Debug|arm64
{AF527EA4-6A24-4BD6-BC6E-A5863DC3489C}.Debug|arm64.Build.0 = Debug|arm64
{AF527EA4-6A24-4BD6-BC6E-A5863DC3489C}.Debug|x64.ActiveCfg = Debug|x64
Expand Down Expand Up @@ -745,6 +761,8 @@ Global
{F4095FD3-6A3F-490B-966D-E63059612EE6} = {3E3791DF-070D-4ADE-96E8-93D6FBD53953}
{0E05A442-BDC7-43D4-A000-F8C986826716} = {3E3791DF-070D-4ADE-96E8-93D6FBD53953}
{D759CD66-494C-4A00-8075-8B65A9891349} = {81AACED5-CFB5-47A6-AFD6-4625AADCFFA3}
{CAAC0CDF-9AB8-4F43-A3EB-38D785AF5725} = {DB3D0F2C-1A7F-44B4-B408-B21A56212985}
{DB3D0F2C-1A7F-44B4-B408-B21A56212985} = {A972EC5B-FC61-4964-A6FF-F9633EB75DFD}
{623998FD-B0A6-4980-95D5-A5072301CA10} = {A972EC5B-FC61-4964-A6FF-F9633EB75DFD}
{AF527EA4-6A24-4BD6-BC6E-A5863DC3489C} = {623998FD-B0A6-4980-95D5-A5072301CA10}
{FAB6FAA7-ADF4-4B65-9831-0C819915E6E1} = {A972EC5B-FC61-4964-A6FF-F9633EB75DFD}
Expand Down
116 changes: 116 additions & 0 deletions Packaging/Packaging.wapproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(SolutionDir)ToolingVersions.props" />
<PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '15.0'">
<VisualStudioVersion>15.0</VisualStudioVersion>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x86">
<Configuration>Debug</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x86">
<Configuration>Release</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup>
<WapProjPath Condition="'$(WapProjPath)'==''">$(MSBuildExtensionsPath)\Microsoft\DesktopBridge\</WapProjPath>
</PropertyGroup>
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.props" />
<PropertyGroup>
<ProjectGuid>05d4c6e5-d33d-4c15-91fe-3dd2b6a5d61c</ProjectGuid>
<!-- ToolingVersions.props included above does not seem to affect WAPProj, so repeat them here -->
<TargetPlatformVersion>10.0.22621.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<DefaultLanguage>en-US</DefaultLanguage>
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
<NoWarn>$(NoWarn);NU1702</NoWarn>
<EntryPointProjectUniqueName>..\src\DevHome.csproj</EntryPointProjectUniqueName>
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
<GenerateTestArtifacts>True</GenerateTestArtifacts>
<AppxBundlePlatforms>x86|x64</AppxBundlePlatforms>
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
<BuildRing Condition="'$(BuildRing)'==''">Dev</BuildRing>
<AppxPackageSigningEnabled>False</AppxPackageSigningEnabled>
</PropertyGroup>
<!-- Default asset scale is 200% but DEV only has 100% scaling images available-->
<PropertyGroup Condition="'$(BuildRing)' == 'Dev'">
<UapDefaultAssetScale>100</UapDefaultAssetScale>
</PropertyGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
</ItemGroup>
<!-- To build with the correct logo assets, only include the ones for the current build ring.
Place them in a common location, so references to them don't need to adjust for build ring. -->
<ItemGroup>
<Content Include="..\src\Assets\*" />
<Content Remove="..\src\Assets\Preview\*" />
<Content Remove="..\src\Assets\Canary\*" />
<Content Remove="..\src\Assets\Dev\*" />
</ItemGroup>
<ItemGroup Condition="'$(BuildRing)' == 'Dev'">
jaholme marked this conversation as resolved.
Show resolved Hide resolved
<Content Include="..\src\Assets\Dev\**" Link="Assets\Logos\%(Filename)%(Extension)" CopyToOutputDirectory="Always" />
<Content Include="..\src\Assets\Dev\DevHome_Dev.ico" Link="Assets\DevHome.ico" CopyToOutputDirectory="Always" />
</ItemGroup>
<ItemGroup Condition="'$(BuildRing)' == 'Canary'">
<Content Include="..\src\Assets\Canary\**" Link="Assets\Logos\%(Filename)%(Extension)" CopyToOutputDirectory="Always" />
<Content Include="..\src\Assets\Canary\DevHome_Canary.ico" Link="Assets\DevHome.ico" CopyToOutputDirectory="Always" />
</ItemGroup>
<ItemGroup Condition="'$(BuildRing)' == 'Stable'">
<Content Include="..\src\Assets\Preview\**" Link="Assets\Logos\%(Filename)%(Extension)" CopyToOutputDirectory="Always" />
<Content Include="..\src\Assets\Preview\DevHome_Preview.ico" Link="Assets\DevHome.ico" CopyToOutputDirectory="Always" />
</ItemGroup>
<ItemGroup>
<None Remove="..\src\Assets\WhatsNewPage\DarkTheme\Extensions.png" />
<None Remove="..\src\Assets\WhatsNewPage\DarkTheme\ExtensionsBig.png" />
<None Remove="..\src\Assets\WhatsNewPage\LightTheme\Extensions.png" />
<None Remove="..\src\Assets\WhatsNewPage\LightTheme\ExtensionsBig.png" />
<None Remove="..\src\Styles\WindowTitleBar_ThemeResources.xaml" />
</ItemGroup>
<ItemGroup>
<PRIResource Include="..\src\Strings\en-us\Resources.resw" />
</ItemGroup>
<ItemGroup>
<None Include="Packaging_TemporaryKey.pfx" />
</ItemGroup>
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />
<ItemGroup>
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.2428" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\src\DevHome.csproj" />
<ProjectReference Include="..\tools\PI\DevHome.PI\DevHome.PI.csproj" />
<ProjectReference Include="..\tools\Utilities\HostsUtility\DevHome.HostsFileEditor.csproj" />
<ProjectReference Include="..\tools\Utilities\RegPreviewUtility\DevHome.RegistryPreview.csproj" />
<ProjectReference Include="..\tools\Utilities\EnvVariablesUtility\DevHome.EnvironmentVariables.csproj" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion common/DevHome.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<PackageReference Include="Serilog.Sinks.Debug" Version="2.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="System.Management.Automation" Version="7.4.0" />
<PackageReference Include="WinUIEx" Version="1.8.0" />
<PackageReference Include="WinUIEx" Version="2.3.4" />
</ItemGroup>

<ItemGroup>
Expand Down
7 changes: 7 additions & 0 deletions common/Helpers/RuntimeHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT License.

using System;
using System.Security.Principal;
using Windows.Win32;
using Windows.Win32.Foundation;

Expand All @@ -27,4 +28,10 @@ public static bool IsOnWindows11
return version.Major >= 10 && version.Build >= 22000;
}
}

public static bool IsCurrentProcessRunningAsAdmin()
{
var identity = WindowsIdentity.GetCurrent();
return identity.Owner?.IsWellKnown(WellKnownSidType.BuiltinAdministratorsSid) ?? false;
}
}
7 changes: 6 additions & 1 deletion common/Services/StringResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ public string GetLocalized(string key, params object[] args)
try
{
value = _resourceLoader.GetString(key);
value = string.Format(CultureInfo.CurrentCulture, value, args);

// only replace the placeholders if args is not empty
if (args.Length > 0)
{
value = string.Format(CultureInfo.CurrentCulture, value, args);
}
}
catch
{
Expand Down
66 changes: 37 additions & 29 deletions settings/DevHome.Settings/Strings/en-us/Resources.resw
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
<!--
Microsoft ResX Schema

Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes

The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.

Example:

... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
Expand All @@ -26,36 +26,36 @@
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple

There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the

Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not

The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can

Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.

mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
Expand Down Expand Up @@ -547,11 +547,19 @@
</data>
<data name="QuietBackgroundProcessesExperiment_Name" xml:space="preserve">
<value>Quiet background processes</value>
<comment>Name of experimental feature 'Quiet background processes' on the 'Settings -> Experiments' page where you enable it.</comment>
<comment>Name of experimental feature 'Quiet background processes' on the 'Settings -&gt; Experiments' page where you enable it.</comment>
</data>
<data name="QuietBackgroundProcessesExperiment_Description" xml:space="preserve">
<value>Quiet background processes allows you to free up resources while developing</value>
<comment>Inline description of the Quiet background processes experimental feature on the 'Settings -> Experiments' page where you enable it.</comment>
<comment>Inline description of the Quiet background processes experimental feature on the 'Settings -&gt; Experiments' page where you enable it.</comment>
</data>
<data name="ProjectIronsidesExperiment_Name" xml:space="preserve">
<value>Project Ironsides</value>
<comment>Name of experimental feature 'Project Ironsides' on the 'Settings -&gt; Experiments' page where you enable it.</comment>
</data>
<data name="ProjectIronsidesExperiment_Description" xml:space="preserve">
<value>Project Ironsides is a utlity to provide deeper insights into your applications</value>
<comment>Inline description of the Project Ironsides experimental feature on the 'Settings -&gt; Experiments' page where you enable it.</comment>
</data>
<data name="QuickstartPlayground_Name" xml:space="preserve">
<value>Quickstart Playground</value>
Expand Down
2 changes: 2 additions & 0 deletions src/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ protected async override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventA

private async void OnActivated(object? sender, AppActivationArguments args)
{
ShowMainWindow();
jaholme marked this conversation as resolved.
Show resolved Hide resolved

// Note: Keep the reference to 'args.Data' object, as 'args' may be
// disposed before the async operation completes (RpcCallFailed: 0x800706be)
var localArgsDataReference = args.Data;
Expand Down
3 changes: 2 additions & 1 deletion src/DevHome.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
<PackageReference Include="Serilog.Sinks.Debug" Version="2.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="WinUIEx" Version="1.8.0" />
<PackageReference Include="WinUIEx" Version="2.3.4" />
</ItemGroup>

<ItemGroup>
Expand All @@ -86,6 +86,7 @@
<ProjectReference Include="..\settings\DevHome.Settings\DevHome.Settings.csproj" />
<ProjectReference Include="..\tools\Dashboard\DevHome.Dashboard\DevHome.Dashboard.csproj" />
<ProjectReference Include="..\tools\Experiments\src\DevHome.Experiments.csproj" />
<ProjectReference Include="..\tools\PI\DevHome.PI\DevHome.PI.csproj" />
<ProjectReference Include="..\tools\QuietBackgroundProcesses\DevHome.QuietBackgroundProcesses.ElevatedServer.Projection\DevHome.QuietBackgroundProcesses.ElevatedServer.Projection.csproj" />
<ProjectReference Include="..\tools\QuietBackgroundProcesses\DevHome.QuietBackgroundProcesses.ElevatedServer\DevHome.QuietBackgroundProcesses.ElevatedServer.vcxproj" />
<ProjectReference Include="..\tools\QuietBackgroundProcesses\DevHome.QuietBackgroundProcesses.Server\DevHome.QuietBackgroundProcesses.Server.vcxproj" />
Expand Down
21 changes: 21 additions & 0 deletions src/NavConfig.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,27 @@
"visible": true
}
]
},
{
"identity": "ProjectIronsidesExperiment",
"enabledByDefault": false,
"buildTypeOverrides": [
{
"buildType": "dev",
"enabledByDefault": true,
"visible": true
},
{
"buildType": "canary",
"enabledByDefault": true,
"visible": true
},
{
"buildType": "stable",
"enabledByDefault": false,
"visible": true
}
]
}
]
}