mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 20:27:36 +02:00
[AOT] Clean up AOT build issue in Common.UI (#36376)
* init commit * Use path.combine * Add useWPF and useWindowsForms back --------- Co-authored-by: Yu Leng (from Dev Box) <yuleng@microsoft.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<!-- Look at Directory.Build.props in root for common stuff as well -->
|
<!-- Look at Directory.Build.props in root for common stuff as well -->
|
||||||
<Import Project="..\..\Common.Dotnet.CsWinRT.props" />
|
<Import Project="..\..\Common.Dotnet.CsWinRT.props" />
|
||||||
|
<Import Project="..\..\Common.Dotnet.AotCompatibility.props" />
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<UseWPF>true</UseWPF>
|
<UseWPF>true</UseWPF>
|
||||||
|
|||||||
@@ -91,20 +91,20 @@ namespace Common.UI
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var assemblyPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
|
var directoryPath = System.AppContext.BaseDirectory;
|
||||||
var fullPath = new DirectoryInfo(assemblyPath).FullName;
|
|
||||||
if (mainExecutableIsOnTheParentFolder)
|
if (mainExecutableIsOnTheParentFolder)
|
||||||
{
|
{
|
||||||
// Need to go into parent folder for PowerToys.exe. Likely a WinUI3 App SDK application.
|
// Need to go into parent folder for PowerToys.exe. Likely a WinUI3 App SDK application.
|
||||||
fullPath = fullPath + "\\..\\PowerToys.exe";
|
directoryPath = Path.Combine(directoryPath, "..");
|
||||||
|
directoryPath = Path.Combine(directoryPath, "PowerToys.exe");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// PowerToys.exe is in the same path as the application.
|
// PowerToys.exe is in the same path as the application.
|
||||||
fullPath = fullPath + "\\PowerToys.exe";
|
directoryPath = Path.Combine(directoryPath, "PowerToys.exe");
|
||||||
}
|
}
|
||||||
|
|
||||||
Process.Start(new ProcessStartInfo(fullPath) { Arguments = "--open-settings=" + SettingsWindowNameToString(window) });
|
Process.Start(new ProcessStartInfo(directoryPath) { Arguments = "--open-settings=" + SettingsWindowNameToString(window) });
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ using Microsoft.Win32;
|
|||||||
|
|
||||||
namespace Common.UI
|
namespace Common.UI
|
||||||
{
|
{
|
||||||
public class ThemeManager : IDisposable
|
public partial class ThemeManager : IDisposable
|
||||||
{
|
{
|
||||||
private readonly Application _app;
|
private readonly Application _app;
|
||||||
private const string LightTheme = "Light.Accent1";
|
private const string LightTheme = "Light.Accent1";
|
||||||
|
|||||||
Reference in New Issue
Block a user