mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
Upgrade .NET Core 3.1 to .NET 5 (#15591)
* Common.UI * ColorPicker * PT Run * File Explorer Add-ons * Awake * FZ Editor * ImageResizer * Interop * Docs * Installer * Fix test not being run - Downgrade MSTest.TestAdapter & MSTest.TestFramework * Update expect.txt * Test run fix
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\..\..\Version.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
<ProjectGuid>{BB23A474-5058-4F75-8FA3-5FE3DE53CDF4}</ProjectGuid>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Community.PowerToys.Run.Plugin.UnitConverter</RootNamespace>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\..\..\Version.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
<ProjectGuid>{4D971245-7A70-41D5-BAA0-DDB5684CAF51}</ProjectGuid>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Community.PowerToys.Run.Plugin.VSCodeWorkspaces</RootNamespace>
|
||||
@@ -71,12 +71,6 @@
|
||||
<PackageReference Include="System.Runtime" Version="4.3.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="Windows.Foundation.UniversalApiContract">
|
||||
<HintPath>C:\Program Files (x86)\Windows Kits\10\References\10.0.18362.0\Windows.Foundation.UniversalApiContract\8.0.0.0\Windows.Foundation.UniversalApiContract.winmd</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Properties\Resources.Designer.cs">
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\..\..\Version.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
<ProjectGuid>{9F94B303-5E21-4364-9362-64426F8DB932}</ProjectGuid>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Community.PowerToys.Run.Plugin.WebSearch</RootNamespace>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
<Platforms>x64</Platforms>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\..\..\Version.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
<ProjectGuid>{787B8AA6-CA93-4C84-96FE-DF31110AD1C4}</ProjectGuid>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Microsoft.Plugin.Folder</RootNamespace>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\..\..\Version.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
<ProjectGuid>{F8B870EB-D5F5-45BA-9CF7-A5C459818820}</ProjectGuid>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Microsoft.Plugin.Indexer</RootNamespace>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows10.0.18362.0</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Moq" Version="4.16.1" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.5" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.5" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.3" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.3" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\..\..\Version.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows10.0.18362.0</TargetFramework>
|
||||
<ProjectGuid>{FDB3555B-58EF-4AE6-B5F1-904719637AB4}</ProjectGuid>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Microsoft.Plugin.Program</RootNamespace>
|
||||
@@ -57,10 +57,10 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Wox.Infrastructure\Wox.Infrastructure.csproj" >
|
||||
<ProjectReference Include="..\..\Wox.Infrastructure\Wox.Infrastructure.csproj">
|
||||
<Private>false</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Wox.Plugin\Wox.Plugin.csproj" >
|
||||
<ProjectReference Include="..\..\Wox.Plugin\Wox.Plugin.csproj">
|
||||
<Private>false</Private>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
@@ -71,7 +71,6 @@
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.1" />
|
||||
<PackageReference Include="System.Runtime" Version="4.3.1" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace Microsoft.Plugin.Program.Programs
|
||||
}
|
||||
|
||||
private static readonly Lazy<bool> IsPackageDotInstallationPathAvailable = new Lazy<bool>(() =>
|
||||
ApiInformation.IsPropertyPresent(typeof(Package).FullName, nameof(Package.InstalledPath)));
|
||||
ApiInformation.IsPropertyPresent(typeof(Package).FullName, nameof(Package.InstalledLocation.Path)));
|
||||
|
||||
public static PackageWrapper GetWrapperFromPackage(Package package)
|
||||
{
|
||||
@@ -77,6 +77,6 @@ namespace Microsoft.Plugin.Program.Programs
|
||||
|
||||
// This is a separate method so the reference to .InstalledPath won't be loaded in API versions which do not support this API (e.g. older then Build 19041)
|
||||
private static string GetInstalledPath(Package package)
|
||||
=> package.InstalledPath;
|
||||
=> package.InstalledLocation.Path;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\..\..\Version.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
<ProjectGuid>{C21BFF9C-2C99-4B5F-B7C9-A5E6DDDB37B0}</ProjectGuid>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Microsoft.Plugin.Shell</RootNamespace>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
<Platforms>x64</Platforms>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\..\..\Version.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
<ProjectGuid>{03276a39-d4e9-417c-8ffd-200b0ee5e871}</ProjectGuid>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Microsoft.Plugin.Uri</RootNamespace>
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
|
||||
public uint ProcessID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets returns the name of the process
|
||||
/// Gets the name of the process
|
||||
/// </summary>
|
||||
public string ProcessName
|
||||
{
|
||||
@@ -128,7 +128,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets returns the name of the class for the window represented
|
||||
/// Gets the name of the class for the window represented
|
||||
/// </summary>
|
||||
public string ClassName
|
||||
{
|
||||
@@ -147,7 +147,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether is the window visible (might return false if it is a hidden IE tab)
|
||||
/// Gets a value indicating whether the window is visible (might return false if it is a hidden IE tab)
|
||||
/// </summary>
|
||||
public bool Visible
|
||||
{
|
||||
@@ -158,7 +158,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether determines whether the specified window handle identifies an existing window.
|
||||
/// Gets a value indicating whether the specified window handle identifies an existing window.
|
||||
/// </summary>
|
||||
public bool IsWindow
|
||||
{
|
||||
@@ -169,7 +169,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether get a value indicating whether is the window GWL_EX_STYLE is a toolwindow
|
||||
/// Gets a value indicating whether the window is a toolwindow
|
||||
/// </summary>
|
||||
public bool IsToolWindow
|
||||
{
|
||||
@@ -182,7 +182,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether get a value indicating whether the window GWL_EX_STYLE is an appwindow
|
||||
/// Gets a value indicating whether the window is an appwindow
|
||||
/// </summary>
|
||||
public bool IsAppWindow
|
||||
{
|
||||
@@ -195,7 +195,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether get a value indicating whether the window has ITaskList_Deleted property
|
||||
/// Gets a value indicating whether the window has ITaskList_Deleted property
|
||||
/// </summary>
|
||||
public bool TaskListDeleted
|
||||
{
|
||||
@@ -206,18 +206,18 @@ namespace Microsoft.Plugin.WindowWalker.Components
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether determines whether the specified windows is the owner
|
||||
/// Gets a value indicating whether the specified windows is the owner (i.e. doesn't have an owner)
|
||||
/// </summary>
|
||||
public bool IsOwner
|
||||
{
|
||||
get
|
||||
{
|
||||
return NativeMethods.GetWindow(Hwnd, NativeMethods.GetWindowCmd.GW_OWNER) != null;
|
||||
return NativeMethods.GetWindow(Hwnd, NativeMethods.GetWindowCmd.GW_OWNER) == IntPtr.Zero;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether returns true if the window is minimized
|
||||
/// Gets a value indicating whether the window is minimized
|
||||
/// </summary>
|
||||
public bool Minimized
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\..\..\Version.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
<ProjectGuid>{74F1B9ED-F59C-4FE7-B473-7B453E30837E}</ProjectGuid>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Microsoft.Plugin.WindowWalker</RootNamespace>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
<Platforms>x64</Platforms>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\..\..\Version.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
<ProjectGuid>{59BD9891-3837-438A-958D-ADC7F91F6F7E}</ProjectGuid>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Microsoft.PowerToys.Run.Plugin.Calculator</RootNamespace>
|
||||
|
||||
@@ -22,8 +22,9 @@ namespace Microsoft.PowerToys.Run.Plugin.Registry.UnitTest.Helper
|
||||
public void GetRegistryBaseKeyTestOnlyOneBaseKey(string query, string expectedBaseKey)
|
||||
{
|
||||
var (baseKeyList, _) = RegistryHelper.GetRegistryBaseKey(query);
|
||||
Assert.IsNotNull(baseKeyList);
|
||||
Assert.IsTrue(baseKeyList.Count() == 1);
|
||||
Assert.AreEqual(expectedBaseKey, baseKeyList.FirstOrDefault().Name);
|
||||
Assert.AreEqual(expectedBaseKey, baseKeyList.First().Name);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@@ -31,6 +32,7 @@ namespace Microsoft.PowerToys.Run.Plugin.Registry.UnitTest.Helper
|
||||
{
|
||||
var (baseKeyList, _) = RegistryHelper.GetRegistryBaseKey("HKC\\Control Panel\\Accessibility"); /* #no-spell-check-line */
|
||||
|
||||
Assert.IsNotNull(baseKeyList);
|
||||
Assert.IsTrue(baseKeyList.Count() > 1);
|
||||
|
||||
var list = baseKeyList.Select(found => found.Name);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
<Platforms>x64</Platforms>
|
||||
<NeutralLanguage>en-US</NeutralLanguage>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
|
||||
@@ -50,8 +50,8 @@ namespace Microsoft.PowerToys.Run.Plugin.Registry.Helper
|
||||
|
||||
var querySplit = query.Split(QuerySplitCharacter);
|
||||
|
||||
queryKey = querySplit.FirstOrDefault();
|
||||
queryValueName = querySplit.LastOrDefault();
|
||||
queryKey = querySplit.First();
|
||||
queryValueName = querySplit.Last();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Microsoft.PowerToys.Run.Plugin.Registry.Helper
|
||||
return (null, string.Empty);
|
||||
}
|
||||
|
||||
var baseKey = query.Split('\\').FirstOrDefault();
|
||||
var baseKey = query.Split('\\').FirstOrDefault() ?? string.Empty;
|
||||
var subKey = query.Replace(baseKey, string.Empty, StringComparison.InvariantCultureIgnoreCase).TrimStart('\\');
|
||||
|
||||
var baseKeyResult = _baseKeys
|
||||
@@ -100,7 +100,7 @@ namespace Microsoft.PowerToys.Run.Plugin.Registry.Helper
|
||||
|
||||
do
|
||||
{
|
||||
result = FindSubKey(subKey, subKeysNames.ElementAtOrDefault(index));
|
||||
result = FindSubKey(subKey, subKeysNames.ElementAtOrDefault(index) ?? string.Empty);
|
||||
|
||||
if (result.Count == 0)
|
||||
{
|
||||
@@ -169,13 +169,22 @@ namespace Microsoft.PowerToys.Run.Plugin.Registry.Helper
|
||||
|
||||
if (string.Equals(subKey, searchSubKey, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
list.Add(new RegistryEntry(parentKey.OpenSubKey(subKey, RegistryKeyPermissionCheck.ReadSubTree)));
|
||||
var key = parentKey.OpenSubKey(subKey, RegistryKeyPermissionCheck.ReadSubTree);
|
||||
if (key != null)
|
||||
{
|
||||
list.Add(new RegistryEntry(key));
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
list.Add(new RegistryEntry(parentKey.OpenSubKey(subKey, RegistryKeyPermissionCheck.ReadSubTree)));
|
||||
var key = parentKey.OpenSubKey(subKey, RegistryKeyPermissionCheck.ReadSubTree);
|
||||
if (key != null)
|
||||
{
|
||||
list.Add(new RegistryEntry(key));
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
|
||||
@@ -94,7 +94,11 @@ namespace Microsoft.PowerToys.Run.Plugin.Registry.Helper
|
||||
{
|
||||
foreach (var valueName in valueNames)
|
||||
{
|
||||
valueList.Add(KeyValuePair.Create(valueName, key.GetValue(valueName)));
|
||||
var value = key.GetValue(valueName);
|
||||
if (value != null)
|
||||
{
|
||||
valueList.Add(KeyValuePair.Create(valueName, value));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception valueException)
|
||||
|
||||
@@ -25,11 +25,18 @@ namespace Microsoft.PowerToys.Run.Plugin.Registry.Helper
|
||||
{
|
||||
var unformattedValue = key.GetValue(valueName);
|
||||
|
||||
if (unformattedValue == null)
|
||||
{
|
||||
throw new NullReferenceException(nameof(unformattedValue));
|
||||
}
|
||||
|
||||
var valueData = key.GetValueKind(valueName) switch
|
||||
{
|
||||
RegistryValueKind.DWord => $"0x{unformattedValue:X8} ({(uint)(int)unformattedValue})",
|
||||
RegistryValueKind.QWord => $"0x{unformattedValue:X16} ({(ulong)(long)unformattedValue})",
|
||||
#pragma warning disable CS8604 // Possible null reference argument.
|
||||
RegistryValueKind.Binary => (unformattedValue as byte[]).Aggregate(string.Empty, (current, singleByte) => $"{current} {singleByte:X2}"),
|
||||
#pragma warning restore CS8604 // Possible null reference argument.
|
||||
_ => $"{unformattedValue}",
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\..\..\Version.props" />
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
<RootNamespace>Microsoft.PowerToys.Run.Plugin.Registry</RootNamespace>
|
||||
<AssemblyName>Microsoft.PowerToys.Run.Plugin.Registry</AssemblyName>
|
||||
<Version>$(Version).0</Version>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<Import Project="..\..\..\..\Version.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
<RootNamespace>Microsoft.PowerToys.Run.Plugin.Service</RootNamespace>
|
||||
<AssemblyName>Microsoft.PowerToys.Run.Plugin.Service</AssemblyName>
|
||||
<Version>$(Version).0</Version>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
<Platforms>x64</Platforms>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\..\..\Version.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Library</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Microsoft.PowerToys.Run.Plugin.System</RootNamespace>
|
||||
<AssemblyName>Microsoft.PowerToys.Run.Plugin.System</AssemblyName>
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace Microsoft.PowerToys.Run.Plugin.WindowsSettings.Helper
|
||||
if (command.Contains(' '))
|
||||
{
|
||||
var commandSplit = command.Split(' ');
|
||||
var file = commandSplit.FirstOrDefault();
|
||||
var file = commandSplit.FirstOrDefault() ?? string.Empty;
|
||||
var arguments = command[file.Length..].TrimStart();
|
||||
|
||||
processStartInfo = new ProcessStartInfo(file, arguments)
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace Microsoft.PowerToys.Run.Plugin.WindowsSettings.Helper
|
||||
/// <returns>A registry value or <see cref="uint.MinValue"/> on error.</returns>
|
||||
private static uint GetNumericRegistryValue(in string registryKey, in string valueName)
|
||||
{
|
||||
object registryValueData;
|
||||
object? registryValueData;
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\..\..\Version.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
<ProjectGuid>{5043CECE-E6A7-4867-9CBE-02D27D83747A}</ProjectGuid>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Microsoft.PowerToys.Run.Plugin.WindowsSettings</RootNamespace>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows10.0.18362.0</TargetFramework>
|
||||
<Platforms>x64</Platforms>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<IsPackable>false</IsPackable>
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.5" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.5" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.3" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -8,6 +8,8 @@ using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Security.Principal;
|
||||
using System.Threading;
|
||||
using Windows.Foundation;
|
||||
using Windows.Management.Deployment;
|
||||
|
||||
namespace Microsoft.PowerToys.Run.Plugin.WindowsTerminal.Helpers
|
||||
@@ -54,7 +56,13 @@ namespace Microsoft.PowerToys.Run.Plugin.WindowsTerminal.Helpers
|
||||
|
||||
foreach (var p in _packageManager.FindPackagesForUser(user.Value).Where(p => Packages.Contains(p.Id.Name)))
|
||||
{
|
||||
var aumid = p.GetAppListEntries().Single().AppUserModelId;
|
||||
var appListEntries = p.GetAppListEntriesAsync();
|
||||
while (appListEntries.Status != AsyncStatus.Completed)
|
||||
{
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
|
||||
var aumid = appListEntries.GetResults().Single().AppUserModelId;
|
||||
var version = new Version(p.Id.Version.Major, p.Id.Version.Minor, p.Id.Version.Build, p.Id.Version.Revision);
|
||||
var settingsPath = Path.Combine(localAppDataPath, "Packages", p.Id.FamilyName, "LocalState", "settings.json");
|
||||
yield return new TerminalPackage(aumid, version, p.DisplayName, settingsPath, p.Logo.LocalPath);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<Import Project="..\..\..\..\Version.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows10.0.18362.0</TargetFramework>
|
||||
<RootNamespace>Microsoft.PowerToys.Run.Plugin.WindowsTerminal</RootNamespace>
|
||||
<AssemblyName>Microsoft.PowerToys.Run.Plugin.WindowsTerminal</AssemblyName>
|
||||
<Version>$(Version).0</Version>
|
||||
@@ -38,10 +38,6 @@
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Wox.Infrastructure\Wox.Infrastructure.csproj" />
|
||||
<ProjectReference Include="..\..\Wox.Plugin\Wox.Plugin.csproj" />
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace PowerLauncher
|
||||
[STAThread]
|
||||
public static void Main()
|
||||
{
|
||||
Log.Info($"Starting PowerToys Run with PID={Process.GetCurrentProcess().Id}", typeof(App));
|
||||
Log.Info($"Starting PowerToys Run with PID={Environment.ProcessId}", typeof(App));
|
||||
int powerToysPid = GetPowerToysPId();
|
||||
if (powerToysPid != 0)
|
||||
{
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using Microsoft.Toolkit.Uwp.Notifications;
|
||||
|
||||
namespace PowerLauncher.Helper
|
||||
{
|
||||
[ClassInterface(ClassInterfaceType.None)]
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
[ComSourceInterfaces(typeof(INotificationActivationCallback))]
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
[Guid("DD5CACDA-7C2E-4997-A62A-04A597B58F76")]
|
||||
[ComVisible(true)]
|
||||
public class LauncherNotificationActivator : NotificationActivator
|
||||
{
|
||||
public override void OnActivated(string invokedArgs, NotificationUserInput userInput, string appUserModelId)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -116,7 +116,7 @@ namespace PowerLauncher.Helper
|
||||
// get current active window
|
||||
IntPtr hWnd = NativeMethods.GetForegroundWindow();
|
||||
|
||||
if (hWnd != null && !hWnd.Equals(IntPtr.Zero))
|
||||
if (hWnd != IntPtr.Zero && !hWnd.Equals(IntPtr.Zero))
|
||||
{
|
||||
// if current active window is NOT desktop or shell
|
||||
if (!(hWnd.Equals(HWND_DESKTOP) || hWnd.Equals(HWND_SHELL)))
|
||||
@@ -144,7 +144,7 @@ namespace PowerLauncher.Helper
|
||||
{
|
||||
IntPtr hWndDesktop = NativeMethods.FindWindowEx(hWnd, IntPtr.Zero, "SHELLDLL_DefView", null);
|
||||
hWndDesktop = NativeMethods.FindWindowEx(hWndDesktop, IntPtr.Zero, "SysListView32", "FolderView");
|
||||
if (hWndDesktop != null && !hWndDesktop.Equals(IntPtr.Zero))
|
||||
if (hWndDesktop != IntPtr.Zero && !hWndDesktop.Equals(IntPtr.Zero))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\..\Version.props" />
|
||||
<PropertyGroup>
|
||||
<AssemblyTitle>PowerToys.Run</AssemblyTitle>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows10.0.18362.0</TargetFramework>
|
||||
<UseWPF>true</UseWPF>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<StartupObject>PowerLauncher.App</StartupObject>
|
||||
@@ -100,7 +100,7 @@
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Data.Sqlite" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="6.1.1" />
|
||||
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.2" />
|
||||
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.19" />
|
||||
<PackageReference Include="ModernWpfUI" Version="0.9.4" />
|
||||
<PackageReference Include="SharpZipLib" Version="1.2.0" />
|
||||
|
||||
@@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<PublishProtocol>FileSystem</PublishProtocol>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows10.0.18362.0</TargetFramework>
|
||||
<PublishDir>$(PowerToysRoot)\$(Platform)\$(Configuration)\modules\launcher</PublishDir>
|
||||
<RuntimeIdentifier>win-$(Platform)</RuntimeIdentifier>
|
||||
<SelfContained>false</SelfContained>
|
||||
|
||||
@@ -38,15 +38,9 @@ namespace Wox
|
||||
_themeManager.ThemeChanged += OnThemeChanged;
|
||||
WebRequest.RegisterPrefix("data", new DataWebRequestFactory());
|
||||
|
||||
DesktopNotificationManagerCompat.RegisterActivator<LauncherNotificationActivator>();
|
||||
try
|
||||
ToastNotificationManagerCompat.OnActivated += args =>
|
||||
{
|
||||
DesktopNotificationManagerCompat.RegisterAumidAndComServer<LauncherNotificationActivator>("PowerToysRun");
|
||||
}
|
||||
catch (System.UnauthorizedAccessException ex)
|
||||
{
|
||||
Log.Exception("Exception calling RegisterAumidAndComServer. Notifications not available.", ex, MethodBase.GetCurrentMethod().DeclaringType);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public void ChangeQuery(string query, bool requery = false)
|
||||
@@ -105,7 +99,7 @@ namespace Wox
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
var toast = new ToastNotification(builder.GetToastContent().GetXml());
|
||||
DesktopNotificationManagerCompat.CreateToastNotifier().Show(toast);
|
||||
ToastNotificationManagerCompat.CreateToastNotifier().Show(toast);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -88,7 +88,10 @@ namespace Wox.Infrastructure.Exception
|
||||
sb.AppendLine();
|
||||
sb.AppendLine("## Assemblies - " + AppDomain.CurrentDomain.FriendlyName);
|
||||
sb.AppendLine();
|
||||
foreach (var ass in AppDomain.CurrentDomain.GetAssemblies().OrderBy(o => o.GlobalAssemblyCache ? 50 : 0))
|
||||
|
||||
// GlobalAssemblyCache - .NET Core and .NET 5 and later: false in all cases.
|
||||
// Source https://docs.microsoft.com/en-us/dotnet/api/system.reflection.assembly.globalassemblycache?view=net-6.0
|
||||
foreach (var ass in AppDomain.CurrentDomain.GetAssemblies())
|
||||
{
|
||||
sb.Append("* ");
|
||||
sb.Append(ass.FullName);
|
||||
|
||||
@@ -98,7 +98,10 @@ namespace Wox.Infrastructure.Storage
|
||||
|
||||
try
|
||||
{
|
||||
#pragma warning disable SYSLIB0011 // Type or member is obsolete
|
||||
// See https://docs.microsoft.com/en-us/dotnet/standard/serialization/binaryformatter-security-guide to fix this
|
||||
var t = ((T)binaryFormatter.Deserialize(stream)).NonNull();
|
||||
#pragma warning restore SYSLIB0011 // Type or member is obsolete
|
||||
return t;
|
||||
}
|
||||
catch (System.Exception e)
|
||||
@@ -141,7 +144,10 @@ namespace Wox.Infrastructure.Storage
|
||||
|
||||
try
|
||||
{
|
||||
#pragma warning disable SYSLIB0011 // Type or member is obsolete
|
||||
// See https://docs.microsoft.com/en-us/dotnet/standard/serialization/binaryformatter-security-guide to fix this
|
||||
binaryFormatter.Serialize(stream, data);
|
||||
#pragma warning restore SYSLIB0011 // Type or member is obsolete
|
||||
}
|
||||
catch (SerializationException e)
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\..\Version.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
<ProjectGuid>{4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<UseWpf>true</UseWpf>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\..\Version.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
<ProjectGuid>{8451ECDD-2EA4-4966-BB0A-7BBC40138E80}</ProjectGuid>
|
||||
<UseWPF>true</UseWPF>
|
||||
<OutputType>Library</OutputType>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\..\Version.props" />
|
||||
|
||||
<Import Project="..\..\..\Version.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows10.0.18362.0</TargetFramework>
|
||||
<ProjectGuid>{FF742965-9A80-41A5-B042-D6C7D3A21708}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
@@ -61,8 +61,8 @@
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Moq" Version="4.16.1" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.5" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.5" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.3" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.3" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -80,4 +80,4 @@
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user