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

Some PowerToys utilities in DevHome #2795

Merged
merged 12 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ Try {
& $msbuildPath $msbuildArgs

if (-not($IsAzurePipelineBuild) -And $isAdmin) {
Invoke-SignPackage "$appxPackageDir\DevHome-$platform.msix"
Invoke-SignPackage "$appxPackageDir\DevHome\DevHome-$platform.msix"
}
}
}
Expand Down
75 changes: 75 additions & 0 deletions DevHome.sln
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevHome.Customization", "to
{54082587-A435-423F-AE1B-01B906FFA7C5} = {54082587-A435-423F-AE1B-01B906FFA7C5}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utilities", "Utilities", "{FAB6FAA7-ADF4-4B65-9831-0C819915E6E1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevHome.Utilities", "tools\Utilities\src\DevHome.Utilities.csproj", "{19C08C57-7C22-48C9-9B6C-FAAF1FCC65E7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevHome.HostsFileEditor", "tools\Utilities\HostsUtility\DevHome.HostsFileEditor.csproj", "{1317314E-9BDD-4F1C-A76F-22121637A091}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevHome.RegistryPreview", "tools\Utilities\RegPreviewUtility\DevHome.RegistryPreview.csproj", "{2E5629CA-0D1B-42B1-8D6E-934A6E1E18D9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevHome.EnvironmentVariables", "tools\Utilities\EnvVariablesUtility\DevHome.EnvironmentVariables.csproj", "{5F9749BC-F34E-4F45-933F-61E0F3ED521F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DevHome.Telemetry.Native", "telemetry\DevHome.Telemetry.Native\DevHome.Telemetry.Native.vcxproj", "{8EB52F7D-D216-49FF-BF16-DE06E4695950}"
EndProject
Global
Expand Down Expand Up @@ -638,6 +648,66 @@ Global
{AF527EA4-6A24-4BD6-BC6E-A5863DC3489C}.Release|x64.Build.0 = Release|x64
{AF527EA4-6A24-4BD6-BC6E-A5863DC3489C}.Release|x86.ActiveCfg = Release|x86
{AF527EA4-6A24-4BD6-BC6E-A5863DC3489C}.Release|x86.Build.0 = Release|x86
{19C08C57-7C22-48C9-9B6C-FAAF1FCC65E7}.Debug|arm64.ActiveCfg = Debug|arm64
{19C08C57-7C22-48C9-9B6C-FAAF1FCC65E7}.Debug|arm64.Build.0 = Debug|arm64
{19C08C57-7C22-48C9-9B6C-FAAF1FCC65E7}.Debug|x64.ActiveCfg = Debug|x64
{19C08C57-7C22-48C9-9B6C-FAAF1FCC65E7}.Debug|x64.Build.0 = Debug|x64
{19C08C57-7C22-48C9-9B6C-FAAF1FCC65E7}.Debug|x86.ActiveCfg = Debug|x86
{19C08C57-7C22-48C9-9B6C-FAAF1FCC65E7}.Debug|x86.Build.0 = Debug|x86
{19C08C57-7C22-48C9-9B6C-FAAF1FCC65E7}.Release|arm64.ActiveCfg = Release|arm64
{19C08C57-7C22-48C9-9B6C-FAAF1FCC65E7}.Release|arm64.Build.0 = Release|arm64
{19C08C57-7C22-48C9-9B6C-FAAF1FCC65E7}.Release|x64.ActiveCfg = Release|x64
{19C08C57-7C22-48C9-9B6C-FAAF1FCC65E7}.Release|x64.Build.0 = Release|x64
{19C08C57-7C22-48C9-9B6C-FAAF1FCC65E7}.Release|x86.ActiveCfg = Release|x86
{19C08C57-7C22-48C9-9B6C-FAAF1FCC65E7}.Release|x86.Build.0 = Release|x86
{1317314E-9BDD-4F1C-A76F-22121637A091}.Debug|arm64.ActiveCfg = Debug|ARM64
{1317314E-9BDD-4F1C-A76F-22121637A091}.Debug|arm64.Build.0 = Debug|ARM64
{1317314E-9BDD-4F1C-A76F-22121637A091}.Debug|arm64.Deploy.0 = Debug|ARM64
{1317314E-9BDD-4F1C-A76F-22121637A091}.Debug|x64.ActiveCfg = Debug|x64
{1317314E-9BDD-4F1C-A76F-22121637A091}.Debug|x64.Build.0 = Debug|x64
{1317314E-9BDD-4F1C-A76F-22121637A091}.Debug|x64.Deploy.0 = Debug|x64
{1317314E-9BDD-4F1C-A76F-22121637A091}.Debug|x86.ActiveCfg = Debug|x86
{1317314E-9BDD-4F1C-A76F-22121637A091}.Debug|x86.Build.0 = Debug|x86
{1317314E-9BDD-4F1C-A76F-22121637A091}.Debug|x86.Deploy.0 = Debug|x86
{1317314E-9BDD-4F1C-A76F-22121637A091}.Release|arm64.ActiveCfg = Release|ARM64
{1317314E-9BDD-4F1C-A76F-22121637A091}.Release|arm64.Build.0 = Release|ARM64
{1317314E-9BDD-4F1C-A76F-22121637A091}.Release|arm64.Deploy.0 = Release|ARM64
{1317314E-9BDD-4F1C-A76F-22121637A091}.Release|x64.ActiveCfg = Release|x64
{1317314E-9BDD-4F1C-A76F-22121637A091}.Release|x64.Build.0 = Release|x64
{1317314E-9BDD-4F1C-A76F-22121637A091}.Release|x64.Deploy.0 = Release|x64
{1317314E-9BDD-4F1C-A76F-22121637A091}.Release|x86.ActiveCfg = Release|x86
{1317314E-9BDD-4F1C-A76F-22121637A091}.Release|x86.Build.0 = Release|x86
{1317314E-9BDD-4F1C-A76F-22121637A091}.Release|x86.Deploy.0 = Release|x86
{2E5629CA-0D1B-42B1-8D6E-934A6E1E18D9}.Debug|arm64.ActiveCfg = Debug|ARM64
{2E5629CA-0D1B-42B1-8D6E-934A6E1E18D9}.Debug|arm64.Build.0 = Debug|ARM64
{2E5629CA-0D1B-42B1-8D6E-934A6E1E18D9}.Debug|arm64.Deploy.0 = Debug|ARM64
{2E5629CA-0D1B-42B1-8D6E-934A6E1E18D9}.Debug|x64.ActiveCfg = Debug|x64
{2E5629CA-0D1B-42B1-8D6E-934A6E1E18D9}.Debug|x64.Build.0 = Debug|x64
{2E5629CA-0D1B-42B1-8D6E-934A6E1E18D9}.Debug|x64.Deploy.0 = Debug|x64
{2E5629CA-0D1B-42B1-8D6E-934A6E1E18D9}.Debug|x86.ActiveCfg = Debug|x86
{2E5629CA-0D1B-42B1-8D6E-934A6E1E18D9}.Debug|x86.Build.0 = Debug|x86
{2E5629CA-0D1B-42B1-8D6E-934A6E1E18D9}.Debug|x86.Deploy.0 = Debug|x86
{2E5629CA-0D1B-42B1-8D6E-934A6E1E18D9}.Release|arm64.ActiveCfg = Release|ARM64
{2E5629CA-0D1B-42B1-8D6E-934A6E1E18D9}.Release|arm64.Build.0 = Release|ARM64
{2E5629CA-0D1B-42B1-8D6E-934A6E1E18D9}.Release|arm64.Deploy.0 = Release|ARM64
{2E5629CA-0D1B-42B1-8D6E-934A6E1E18D9}.Release|x64.ActiveCfg = Release|x64
{2E5629CA-0D1B-42B1-8D6E-934A6E1E18D9}.Release|x64.Build.0 = Release|x64
{2E5629CA-0D1B-42B1-8D6E-934A6E1E18D9}.Release|x64.Deploy.0 = Release|x64
{2E5629CA-0D1B-42B1-8D6E-934A6E1E18D9}.Release|x86.ActiveCfg = Release|x86
{2E5629CA-0D1B-42B1-8D6E-934A6E1E18D9}.Release|x86.Build.0 = Release|x86
{2E5629CA-0D1B-42B1-8D6E-934A6E1E18D9}.Release|x86.Deploy.0 = Release|x86
{5F9749BC-F34E-4F45-933F-61E0F3ED521F}.Debug|arm64.ActiveCfg = Debug|arm64
{5F9749BC-F34E-4F45-933F-61E0F3ED521F}.Debug|arm64.Build.0 = Debug|arm64
{5F9749BC-F34E-4F45-933F-61E0F3ED521F}.Debug|x64.ActiveCfg = Debug|x64
{5F9749BC-F34E-4F45-933F-61E0F3ED521F}.Debug|x64.Build.0 = Debug|x64
{5F9749BC-F34E-4F45-933F-61E0F3ED521F}.Debug|x86.ActiveCfg = Debug|x86
{5F9749BC-F34E-4F45-933F-61E0F3ED521F}.Debug|x86.Build.0 = Debug|x86
{5F9749BC-F34E-4F45-933F-61E0F3ED521F}.Release|arm64.ActiveCfg = Release|arm64
{5F9749BC-F34E-4F45-933F-61E0F3ED521F}.Release|arm64.Build.0 = Release|arm64
{5F9749BC-F34E-4F45-933F-61E0F3ED521F}.Release|x64.ActiveCfg = Release|x64
{5F9749BC-F34E-4F45-933F-61E0F3ED521F}.Release|x64.Build.0 = Release|x64
{5F9749BC-F34E-4F45-933F-61E0F3ED521F}.Release|x86.ActiveCfg = Release|x86
{5F9749BC-F34E-4F45-933F-61E0F3ED521F}.Release|x86.Build.0 = Release|x86
{8EB52F7D-D216-49FF-BF16-DE06E4695950}.Debug|arm64.ActiveCfg = Debug|x64
{8EB52F7D-D216-49FF-BF16-DE06E4695950}.Debug|arm64.Build.0 = Debug|x64
{8EB52F7D-D216-49FF-BF16-DE06E4695950}.Debug|x64.ActiveCfg = Debug|x64
Expand Down Expand Up @@ -699,6 +769,11 @@ Global
{D759CD66-494C-4A00-8075-8B65A9891349} = {81AACED5-CFB5-47A6-AFD6-4625AADCFFA3}
{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}
{19C08C57-7C22-48C9-9B6C-FAAF1FCC65E7} = {FAB6FAA7-ADF4-4B65-9831-0C819915E6E1}
{1317314E-9BDD-4F1C-A76F-22121637A091} = {FAB6FAA7-ADF4-4B65-9831-0C819915E6E1}
{2E5629CA-0D1B-42B1-8D6E-934A6E1E18D9} = {FAB6FAA7-ADF4-4B65-9831-0C819915E6E1}
{5F9749BC-F34E-4F45-933F-61E0F3ED521F} = {FAB6FAA7-ADF4-4B65-9831-0C819915E6E1}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {030B5641-B206-46BB-BF71-36FF009088FA}
Expand Down
39 changes: 39 additions & 0 deletions Packaging/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,45 @@
</uap:Extension>
</Extensions>
</Application>
<Application Id="DevHome.HostsFileEditor" Executable="DevHome.HostsFileEditor\DevHome.HostsFileEditor.exe" EntryPoint="Windows.FullTrustApplication">
dkbennett marked this conversation as resolved.
Show resolved Hide resolved
<uap:VisualElements DisplayName="ms-resource:HostsFileEditorAppDisplayName" Description="ms-resource:HostsFileEditorAppDescription" BackgroundColor="transparent" Square150x150Logo="Assets\HostsFileEditor\Square150x150Logo.png" Square44x44Logo="Assets\HostsFileEditor\Square44x44Logo.png" AppListEntry="none">
<uap:DefaultTile Wide310x150Logo="Assets\HostsFileEditor\Wide310x150Logo.png" />
<uap:SplashScreen Image="Assets\HostsFileEditor\SplashScreen.png" />
</uap:VisualElements>
<Extensions>
<uap3:Extension Category="windows.appExecutionAlias" EntryPoint="Windows.FullTrustApplication">
<uap3:AppExecutionAlias>
<desktop:ExecutionAlias Alias="DevHome.HostsFileEditorApp.exe" />
timkur marked this conversation as resolved.
Show resolved Hide resolved
</uap3:AppExecutionAlias>
</uap3:Extension>
</Extensions>
</Application>
<Application Id="DevHome.RegistryPreview" Executable="DevHome.RegistryPreview\DevHome.RegistryPreview.exe" EntryPoint="Windows.FullTrustApplication">
<uap:VisualElements DisplayName="ms-resource:RegistryPreviewAppDisplayName" Description="ms-resource:RegistryPreviewAppDescription" BackgroundColor="transparent" Square150x150Logo="Assets\RegistryPreview\Square150x150Logo.png" Square44x44Logo="Assets\RegistryPreview\Square44x44Logo.png" AppListEntry="none">
<uap:DefaultTile Wide310x150Logo="Assets\RegistryPreview\Wide310x150Logo.png" />
<uap:SplashScreen Image="Assets\RegistryPreview\SplashScreen.png" />
</uap:VisualElements>
<Extensions>
<uap3:Extension Category="windows.appExecutionAlias" EntryPoint="Windows.FullTrustApplication">
<uap3:AppExecutionAlias>
<desktop:ExecutionAlias Alias="DevHome.RegistryPreviewApp.exe" />
</uap3:AppExecutionAlias>
</uap3:Extension>
</Extensions>
</Application>
<Application Id="DevHome.EnvironmentVariables" Executable="DevHome.EnvironmentVariables\DevHome.EnvironmentVariables.exe" EntryPoint="Windows.FullTrustApplication">
<uap:VisualElements DisplayName="ms-resource:EnvironmentVariablesAppDisplayName" Description="ms-resource:EnvironmentVariablesAppDescription" BackgroundColor="transparent" Square150x150Logo="Assets\EnvironmentVariables\Square150x150Logo.png" Square44x44Logo="Assets\EnvironmentVariables\Square44x44Logo.png" AppListEntry="none">
<uap:DefaultTile Wide310x150Logo="Assets\EnvironmentVariables\Wide310x150Logo.png" />
<uap:SplashScreen Image="Assets\EnvironmentVariables\SplashScreen.png" />
</uap:VisualElements>
<Extensions>
<uap3:Extension Category="windows.appExecutionAlias" EntryPoint="Windows.FullTrustApplication">
<uap3:AppExecutionAlias>
<desktop:ExecutionAlias Alias="DevHome.EnvironmentVariablesApp.exe" />
</uap3:AppExecutionAlias>
</uap3:Extension>
</Extensions>
</Application>
</Applications>
<Capabilities>
<rescap:Capability Name="runFullTrust" />
Expand Down
13 changes: 5 additions & 8 deletions Packaging/Packaging.wapproj
Original file line number Diff line number Diff line change
Expand Up @@ -69,31 +69,26 @@
<SubType>Designer</SubType>
</AppxManifest>
</ItemGroup>

<!-- To build with the correct logo assets, only include the ones for the current build ring.
<!-- 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 Include="..\src\Assets\*" />
<Content Remove="..\src\Assets\Preview\*" />
<Content Remove="..\src\Assets\Canary\*" />
<Content Remove="..\src\Assets\Dev\*" />
</ItemGroup>

<ItemGroup Condition="'$(BuildRing)' == 'Dev'">
<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" />
Expand All @@ -104,7 +99,6 @@
<ItemGroup>
<PRIResource Include="..\src\Strings\en-us\Resources.resw" />
</ItemGroup>

<ItemGroup>
<None Include="Packaging_TemporaryKey.pfx" />
</ItemGroup>
Expand All @@ -114,5 +108,8 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\src\DevHome.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>
15 changes: 14 additions & 1 deletion common/Helpers/Logging.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

using System;
using System.IO;
using Microsoft.Extensions.Configuration;
using Serilog;
using Windows.Storage;

namespace DevHome.Common;
Expand All @@ -17,5 +19,16 @@ public class Logging

private static readonly Lazy<string> _logFolderRoot = new(() => Path.Combine(ApplicationData.Current.TemporaryFolder.Path, LogFolderName));

public static readonly string LogFolderRoot = _logFolderRoot.Value;
public static readonly string LogFolderRoot = _logFolderRoot.Value;

public static void SetupLogging(string jsonFileName, string appName)
{
Environment.SetEnvironmentVariable("DEVHOME_LOGS_ROOT", Path.Join(LogFolderRoot, appName));
var configuration = new ConfigurationBuilder()
.AddJsonFile(jsonFileName)
.Build();
Log.Logger = new LoggerConfiguration()
.ReadFrom.Configuration(configuration)
.CreateLogger();
}
}
Loading
Loading