Move runnerv2 to appropriate location and remove old runner

This commit is contained in:
Noraa Junker
2026-02-12 02:40:54 +01:00
parent c6e7dfd5cd
commit fc1195dc9c
109 changed files with 10 additions and 6377 deletions

View File

@@ -0,0 +1,41 @@
// 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.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using Microsoft.PowerToys.Settings.UI.Library;
using PowerToys.GPOWrapper;
using RunnerV2.Helpers;
using RunnerV2.Models;
namespace RunnerV2.ModuleInterfaces
{
internal sealed partial class PowerRenameModuleInterface : IPowerToysModule
{
public string Name => "PowerRename";
public bool Enabled => SettingsUtils.Default.GetSettings<GeneralSettings>().Enabled.PowerRename;
public GpoRuleConfigured GpoRuleConfigured => GPOWrapper.GetConfiguredPowerRenameEnabledValue();
public void Disable()
{
UpdatePowerRenameRegistrationWin10(false);
}
public void Enable()
{
UpdatePowerRenameRegistrationWin10(true);
if (Environment.OSVersion.Version.Build >= 22000)
{
PackageHelper.InstallPackage(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "WinUI3Apps", "PowerRenameContextMenuPackage.msix"), [], true);
}
}
[LibraryImport("WinUI3Apps/PowerToys.PowerRenameExt.dll")]
private static partial void UpdatePowerRenameRegistrationWin10([MarshalAs(UnmanagedType.Bool)]bool enabled);
}
}