diff --git a/PowerToys.slnx b/PowerToys.slnx
index e0bbf9820d..53eb43de15 100644
--- a/PowerToys.slnx
+++ b/PowerToys.slnx
@@ -1028,25 +1028,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/src/RunnerV2/RunnerV2/Assets/PowerToysDark.ico b/src/Runner/Assets/PowerToysDark.ico
similarity index 100%
rename from src/RunnerV2/RunnerV2/Assets/PowerToysDark.ico
rename to src/Runner/Assets/PowerToysDark.ico
diff --git a/src/RunnerV2/RunnerV2/Assets/PowerToysLight.ico b/src/Runner/Assets/PowerToysLight.ico
similarity index 100%
rename from src/RunnerV2/RunnerV2/Assets/PowerToysLight.ico
rename to src/Runner/Assets/PowerToysLight.ico
diff --git a/src/RunnerV2/RunnerV2/Extensions/PackageVersionExtensions.cs b/src/Runner/Extensions/PackageVersionExtensions.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/Extensions/PackageVersionExtensions.cs
rename to src/Runner/Extensions/PackageVersionExtensions.cs
diff --git a/src/RunnerV2/RunnerV2/Helpers/AIHelper.cs b/src/Runner/Helpers/AIHelper.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/Helpers/AIHelper.cs
rename to src/Runner/Helpers/AIHelper.cs
diff --git a/src/RunnerV2/RunnerV2/Helpers/AutoStartHelper.cs b/src/Runner/Helpers/AutoStartHelper.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/Helpers/AutoStartHelper.cs
rename to src/Runner/Helpers/AutoStartHelper.cs
diff --git a/src/RunnerV2/RunnerV2/Helpers/COMUtils.cs b/src/Runner/Helpers/COMUtils.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/Helpers/COMUtils.cs
rename to src/Runner/Helpers/COMUtils.cs
diff --git a/src/RunnerV2/RunnerV2/Helpers/CentralizedKeyboardHookManager.cs b/src/Runner/Helpers/CentralizedKeyboardHookManager.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/Helpers/CentralizedKeyboardHookManager.cs
rename to src/Runner/Helpers/CentralizedKeyboardHookManager.cs
diff --git a/src/RunnerV2/RunnerV2/Helpers/ElevationHelper.cs b/src/Runner/Helpers/ElevationHelper.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/Helpers/ElevationHelper.cs
rename to src/Runner/Helpers/ElevationHelper.cs
diff --git a/src/RunnerV2/RunnerV2/Helpers/HotkeyConflictsManager.cs b/src/Runner/Helpers/HotkeyConflictsManager.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/Helpers/HotkeyConflictsManager.cs
rename to src/Runner/Helpers/HotkeyConflictsManager.cs
diff --git a/src/RunnerV2/RunnerV2/Helpers/NotificationHelper.cs b/src/Runner/Helpers/NotificationHelper.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/Helpers/NotificationHelper.cs
rename to src/Runner/Helpers/NotificationHelper.cs
diff --git a/src/RunnerV2/RunnerV2/Helpers/PackageHelper.cs b/src/Runner/Helpers/PackageHelper.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/Helpers/PackageHelper.cs
rename to src/Runner/Helpers/PackageHelper.cs
diff --git a/src/RunnerV2/RunnerV2/Helpers/ProcessHelper.cs b/src/Runner/Helpers/ProcessHelper.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/Helpers/ProcessHelper.cs
rename to src/Runner/Helpers/ProcessHelper.cs
diff --git a/src/RunnerV2/RunnerV2/Helpers/QuickAccessHelper.cs b/src/Runner/Helpers/QuickAccessHelper.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/Helpers/QuickAccessHelper.cs
rename to src/Runner/Helpers/QuickAccessHelper.cs
diff --git a/src/RunnerV2/RunnerV2/Helpers/SettingsHelper.cs b/src/Runner/Helpers/SettingsHelper.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/Helpers/SettingsHelper.cs
rename to src/Runner/Helpers/SettingsHelper.cs
diff --git a/src/RunnerV2/RunnerV2/Helpers/TrayIconManager.cs b/src/Runner/Helpers/TrayIconManager.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/Helpers/TrayIconManager.cs
rename to src/Runner/Helpers/TrayIconManager.cs
diff --git a/src/RunnerV2/RunnerV2/Models/IPowerToysModule.cs b/src/Runner/Models/IPowerToysModule.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/Models/IPowerToysModule.cs
rename to src/Runner/Models/IPowerToysModule.cs
diff --git a/src/RunnerV2/RunnerV2/Models/IPowerToysModuleCustomActionsProvider.cs b/src/Runner/Models/IPowerToysModuleCustomActionsProvider.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/Models/IPowerToysModuleCustomActionsProvider.cs
rename to src/Runner/Models/IPowerToysModuleCustomActionsProvider.cs
diff --git a/src/RunnerV2/RunnerV2/Models/IPowerToysModuleSettingsChangedSubscriber.cs b/src/Runner/Models/IPowerToysModuleSettingsChangedSubscriber.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/Models/IPowerToysModuleSettingsChangedSubscriber.cs
rename to src/Runner/Models/IPowerToysModuleSettingsChangedSubscriber.cs
diff --git a/src/RunnerV2/RunnerV2/Models/IPowerToysModuleShortcutsProvider.cs b/src/Runner/Models/IPowerToysModuleShortcutsProvider.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/Models/IPowerToysModuleShortcutsProvider.cs
rename to src/Runner/Models/IPowerToysModuleShortcutsProvider.cs
diff --git a/src/RunnerV2/RunnerV2/Models/ProcessModuleAbstractClass.cs b/src/Runner/Models/ProcessModuleAbstractClass.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/Models/ProcessModuleAbstractClass.cs
rename to src/Runner/Models/ProcessModuleAbstractClass.cs
diff --git a/src/RunnerV2/RunnerV2/Models/RegistryChangeSet.cs b/src/Runner/Models/RegistryChangeSet.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/Models/RegistryChangeSet.cs
rename to src/Runner/Models/RegistryChangeSet.cs
diff --git a/src/RunnerV2/RunnerV2/Models/RegistryValueChange.cs b/src/Runner/Models/RegistryValueChange.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/Models/RegistryValueChange.cs
rename to src/Runner/Models/RegistryValueChange.cs
diff --git a/src/RunnerV2/RunnerV2/Models/SpecialMode.cs b/src/Runner/Models/SpecialMode.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/Models/SpecialMode.cs
rename to src/Runner/Models/SpecialMode.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/AdvancedPasteModuleInterface.cs b/src/Runner/ModuleInterfaces/AdvancedPasteModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/AdvancedPasteModuleInterface.cs
rename to src/Runner/ModuleInterfaces/AdvancedPasteModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/AlwaysOnTopModuleInterface.cs b/src/Runner/ModuleInterfaces/AlwaysOnTopModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/AlwaysOnTopModuleInterface.cs
rename to src/Runner/ModuleInterfaces/AlwaysOnTopModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/AwakeModuleInterface.cs b/src/Runner/ModuleInterfaces/AwakeModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/AwakeModuleInterface.cs
rename to src/Runner/ModuleInterfaces/AwakeModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/CmdNotFoundModuleInterface.cs b/src/Runner/ModuleInterfaces/CmdNotFoundModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/CmdNotFoundModuleInterface.cs
rename to src/Runner/ModuleInterfaces/CmdNotFoundModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/ColorPickerModuleInterface.cs b/src/Runner/ModuleInterfaces/ColorPickerModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/ColorPickerModuleInterface.cs
rename to src/Runner/ModuleInterfaces/ColorPickerModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/CommandPaletteModuleInterface.cs b/src/Runner/ModuleInterfaces/CommandPaletteModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/CommandPaletteModuleInterface.cs
rename to src/Runner/ModuleInterfaces/CommandPaletteModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/CropAndLockModuleInterface.cs b/src/Runner/ModuleInterfaces/CropAndLockModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/CropAndLockModuleInterface.cs
rename to src/Runner/ModuleInterfaces/CropAndLockModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/CursorWrapModuleInterface.cs b/src/Runner/ModuleInterfaces/CursorWrapModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/CursorWrapModuleInterface.cs
rename to src/Runner/ModuleInterfaces/CursorWrapModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/EnvironmentVariablesModuleInterface.cs b/src/Runner/ModuleInterfaces/EnvironmentVariablesModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/EnvironmentVariablesModuleInterface.cs
rename to src/Runner/ModuleInterfaces/EnvironmentVariablesModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/FancyZonesModuleInterface.cs b/src/Runner/ModuleInterfaces/FancyZonesModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/FancyZonesModuleInterface.cs
rename to src/Runner/ModuleInterfaces/FancyZonesModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/FileExplorerModuleInterface.cs b/src/Runner/ModuleInterfaces/FileExplorerModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/FileExplorerModuleInterface.cs
rename to src/Runner/ModuleInterfaces/FileExplorerModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/FileLocksmithModuleInterface.cs b/src/Runner/ModuleInterfaces/FileLocksmithModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/FileLocksmithModuleInterface.cs
rename to src/Runner/ModuleInterfaces/FileLocksmithModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/FindMyMouseModuleInterface.cs b/src/Runner/ModuleInterfaces/FindMyMouseModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/FindMyMouseModuleInterface.cs
rename to src/Runner/ModuleInterfaces/FindMyMouseModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/HostsModuleInterface.cs b/src/Runner/ModuleInterfaces/HostsModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/HostsModuleInterface.cs
rename to src/Runner/ModuleInterfaces/HostsModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/ImageResizerModuleInterface.cs b/src/Runner/ModuleInterfaces/ImageResizerModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/ImageResizerModuleInterface.cs
rename to src/Runner/ModuleInterfaces/ImageResizerModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/KeyboardManagerModuleInterface.cs b/src/Runner/ModuleInterfaces/KeyboardManagerModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/KeyboardManagerModuleInterface.cs
rename to src/Runner/ModuleInterfaces/KeyboardManagerModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/LightSwitchModuleInterface.cs b/src/Runner/ModuleInterfaces/LightSwitchModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/LightSwitchModuleInterface.cs
rename to src/Runner/ModuleInterfaces/LightSwitchModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/MeasureToolModuleInterface.cs b/src/Runner/ModuleInterfaces/MeasureToolModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/MeasureToolModuleInterface.cs
rename to src/Runner/ModuleInterfaces/MeasureToolModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/MouseHighlighterModuleInterface.cs b/src/Runner/ModuleInterfaces/MouseHighlighterModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/MouseHighlighterModuleInterface.cs
rename to src/Runner/ModuleInterfaces/MouseHighlighterModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/MouseJumpModuleInterface.cs b/src/Runner/ModuleInterfaces/MouseJumpModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/MouseJumpModuleInterface.cs
rename to src/Runner/ModuleInterfaces/MouseJumpModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/MousePointerCrosshairsModuleInterface.cs b/src/Runner/ModuleInterfaces/MousePointerCrosshairsModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/MousePointerCrosshairsModuleInterface.cs
rename to src/Runner/ModuleInterfaces/MousePointerCrosshairsModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/MouseWithoutBordersModuleInterface.cs b/src/Runner/ModuleInterfaces/MouseWithoutBordersModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/MouseWithoutBordersModuleInterface.cs
rename to src/Runner/ModuleInterfaces/MouseWithoutBordersModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/NewPlusModuleInterface.cs b/src/Runner/ModuleInterfaces/NewPlusModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/NewPlusModuleInterface.cs
rename to src/Runner/ModuleInterfaces/NewPlusModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/PeekModuleInterface.cs b/src/Runner/ModuleInterfaces/PeekModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/PeekModuleInterface.cs
rename to src/Runner/ModuleInterfaces/PeekModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/PowerAccentModuleInterface.cs b/src/Runner/ModuleInterfaces/PowerAccentModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/PowerAccentModuleInterface.cs
rename to src/Runner/ModuleInterfaces/PowerAccentModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/PowerDisplayModuleInterface.cs b/src/Runner/ModuleInterfaces/PowerDisplayModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/PowerDisplayModuleInterface.cs
rename to src/Runner/ModuleInterfaces/PowerDisplayModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/PowerOCRModuleInterface.cs b/src/Runner/ModuleInterfaces/PowerOCRModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/PowerOCRModuleInterface.cs
rename to src/Runner/ModuleInterfaces/PowerOCRModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/PowerRenameModuleInterface.cs b/src/Runner/ModuleInterfaces/PowerRenameModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/PowerRenameModuleInterface.cs
rename to src/Runner/ModuleInterfaces/PowerRenameModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/PowerToysRunModuleInterface.cs b/src/Runner/ModuleInterfaces/PowerToysRunModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/PowerToysRunModuleInterface.cs
rename to src/Runner/ModuleInterfaces/PowerToysRunModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/RegistryPreviewModuleInterface.cs b/src/Runner/ModuleInterfaces/RegistryPreviewModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/RegistryPreviewModuleInterface.cs
rename to src/Runner/ModuleInterfaces/RegistryPreviewModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/ShortcutGuideModuleInterface.cs b/src/Runner/ModuleInterfaces/ShortcutGuideModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/ShortcutGuideModuleInterface.cs
rename to src/Runner/ModuleInterfaces/ShortcutGuideModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/WorkspacesModuleInterface.cs b/src/Runner/ModuleInterfaces/WorkspacesModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/WorkspacesModuleInterface.cs
rename to src/Runner/ModuleInterfaces/WorkspacesModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/ModuleInterfaces/ZoomItModuleInterface.cs b/src/Runner/ModuleInterfaces/ZoomItModuleInterface.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/ModuleInterfaces/ZoomItModuleInterface.cs
rename to src/Runner/ModuleInterfaces/ZoomItModuleInterface.cs
diff --git a/src/RunnerV2/RunnerV2/NativeMethods.cs b/src/Runner/NativeMethods.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/NativeMethods.cs
rename to src/Runner/NativeMethods.cs
diff --git a/src/RunnerV2/RunnerV2/Program.cs b/src/Runner/Program.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/Program.cs
rename to src/Runner/Program.cs
diff --git a/src/RunnerV2/RunnerV2/Runner.cs b/src/Runner/Runner.cs
similarity index 100%
rename from src/RunnerV2/RunnerV2/Runner.cs
rename to src/Runner/Runner.cs
diff --git a/src/RunnerV2/RunnerV2/RunnerV2.csproj b/src/Runner/RunnerV2.csproj
similarity index 54%
rename from src/RunnerV2/RunnerV2/RunnerV2.csproj
rename to src/Runner/RunnerV2.csproj
index 47b57bf1de..3dea14f5a2 100644
--- a/src/RunnerV2/RunnerV2/RunnerV2.csproj
+++ b/src/Runner/RunnerV2.csproj
@@ -1,11 +1,11 @@
-
-
+
+
WinExe
PowerToys Runner
PowerToys
- ..\..\..\$(Platform)\$(Configuration)
+ ..\..\$(Platform)\$(Configuration)
enable
false
false
@@ -14,12 +14,12 @@
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/src/RunnerV2/RunnerV2/app.manifest b/src/Runner/app.manifest
similarity index 100%
rename from src/RunnerV2/RunnerV2/app.manifest
rename to src/Runner/app.manifest
diff --git a/src/RunnerV2/RunnerV2/icon.ico b/src/Runner/icon.ico
similarity index 100%
rename from src/RunnerV2/RunnerV2/icon.ico
rename to src/Runner/icon.ico
diff --git a/src/runner/ActionRunnerUtils.h b/src/runner/ActionRunnerUtils.h
deleted file mode 100644
index a0c59761c6..0000000000
--- a/src/runner/ActionRunnerUtils.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN
-#include
-
-namespace cmdArg
-{
- const inline wchar_t* RUN_NONELEVATED = L"-run-non-elevated";
-}
diff --git a/src/runner/PowerToys.exe.manifest b/src/runner/PowerToys.exe.manifest
deleted file mode 100644
index ce82aa752f..0000000000
--- a/src/runner/PowerToys.exe.manifest
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- true/PM
- PerMonitorV2
-
-
-
diff --git a/src/runner/Resources.resx b/src/runner/Resources.resx
deleted file mode 100644
index b94f84714e..0000000000
--- a/src/runner/Resources.resx
+++ /dev/null
@@ -1,200 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- PowerToys Error
-
-
- Could not start PowerToys as a user!
-
-
- Could not start PowerToys as an administrator!
-
-
- PowerToys is already running.
-
-
- PowerToys was successfully updated!
-
-
- An older version of PowerToys is already running.
-
-
- Couldn't download PowerToys update! Please report the issue on GitHub.
-
-
- An older MSIX version of PowerToys was uninstalled.
-
-
- PowerToys was updated successfully!
-
-
- This setting has been disabled by your administrator.
-
-
- This setting has been disabled manually via <a href="https://ms_settings_startupapps" target="_blank">Startup Settings</a>.
-
-
- An update to PowerToys is available.
-
-
- Update now
-
-
- An update to PowerToys is available. Visit our GitHub page to update.
-
-
- More info...
-
-
- PowerToys Update
-
-
- Quick access\tLeft-click
- Don't localize "\t" as that is what separates the click portion to be right aligned in the menu.
-
-
- Settings\tDouble-click
- Don't localize "\t" as that is what separates the click portion to be right aligned in the menu.
-
-
- Settings\tLeft-click
- Don't localize "\t" as that is what separates the click portion to be right aligned in the menu. This is shown when Quick Access is disabled.
-
-
- Documentation
-
-
- Report bug
-
-
- Bug report .zip file has been created on your Desktop.
-
-
- A new PowerToys version has been installed. Please restart the computer, when possible, to fully reload File Explorer extensions.
- File Explorer refers to the Windows File Explorer application.
-
-
- Administrator
-
-
- Close
- Close as a verb, as in Close the application
-
-
\ No newline at end of file
diff --git a/src/runner/RestartManagement.cpp b/src/runner/RestartManagement.cpp
deleted file mode 100644
index 8fc11338fc..0000000000
--- a/src/runner/RestartManagement.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-#include "pch.h"
-#include "RestartManagement.h"
-
-#include
-#include
-
-#include
-
-void RestartProcess(const std::wstring& processName)
-{
- DWORD sessionHandle{};
- WCHAR sessionKey[CCH_RM_SESSION_KEY + 1];
- if (RmStartSession(&sessionHandle, 0, sessionKey) != ERROR_SUCCESS)
- {
- return;
- }
- auto processHandles = getProcessHandlesByName(processName, PROCESS_QUERY_INFORMATION);
- std::vector pInfo;
- for (const auto& hProcess : processHandles)
- {
- FILETIME creationTime{};
- FILETIME _{};
- if (GetProcessTimes(hProcess.get(), &creationTime, &_, &_, &_))
- {
- pInfo.emplace_back(RM_UNIQUE_PROCESS{ GetProcessId(hProcess.get()), creationTime });
- }
- }
-
- if (pInfo.empty() ||
- RmRegisterResources(sessionHandle, 0, nullptr, sizeof(pInfo), pInfo.data(), 0, nullptr) != ERROR_SUCCESS)
- {
- return;
- }
- RmShutdown(sessionHandle, RmForceShutdown, nullptr);
- RmRestart(sessionHandle, 0, nullptr);
- RmEndSession(sessionHandle);
-}
diff --git a/src/runner/RestartManagement.h b/src/runner/RestartManagement.h
deleted file mode 100644
index 92c60004c8..0000000000
--- a/src/runner/RestartManagement.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#pragma once
-
-#include
-
-void RestartProcess(const std::wstring& processName);
diff --git a/src/runner/UpdateUtils.cpp b/src/runner/UpdateUtils.cpp
deleted file mode 100644
index 820b926984..0000000000
--- a/src/runner/UpdateUtils.cpp
+++ /dev/null
@@ -1,308 +0,0 @@
-#include "pch.h"
-
-#include "Generated Files/resource.h"
-
-#include "ActionRunnerUtils.h"
-#include "general_settings.h"
-#include "trace.h"
-#include "UpdateUtils.h"
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-namespace
-{
- constexpr int64_t UPDATE_CHECK_INTERVAL_MINUTES = 60 * 24;
- constexpr int64_t UPDATE_CHECK_AFTER_FAILED_INTERVAL_MINUTES = 60 * 2;
-
- // How many minor versions to suspend the toast notification (example: installed=0.60.0, suspend=2, next notification=0.63.*)
- // Attention: When changing this value please update the ADML file to.
- const int UPDATE_NOTIFICATION_TOAST_SUSPEND_MINOR_VERSION_COUNT = 2;
-}
-using namespace notifications;
-using namespace updating;
-
-std::wstring CurrentVersionToNextVersion(const new_version_download_info& info)
-{
- auto result = VersionHelper{ VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION }.toWstring();
- result += L" \u2192 "; // Right arrow
- result += info.version.toWstring();
- return result;
-}
-
-void ShowNewVersionAvailable(const new_version_download_info& info)
-{
- remove_toasts_by_tag(UPDATING_PROCESS_TOAST_TAG);
-
- toast_params toast_params{ UPDATING_PROCESS_TOAST_TAG, false };
- std::wstring contents = GET_RESOURCE_STRING(IDS_GITHUB_NEW_VERSION_AVAILABLE);
- contents += L'\n';
- contents += CurrentVersionToNextVersion(info);
-
- show_toast_with_activations(std::move(contents),
- GET_RESOURCE_STRING(IDS_TOAST_TITLE),
- {},
- { link_button{ GET_RESOURCE_STRING(IDS_GITHUB_NEW_VERSION_UPDATE_NOW),
- L"powertoys://update_now/" },
- link_button{ GET_RESOURCE_STRING(IDS_GITHUB_NEW_VERSION_MORE_INFO),
- L"powertoys://open_overview/" } },
- std::move(toast_params),
- L"powertoys://open_overview/");
-}
-
-void ShowOpenSettingsForUpdate()
-{
- remove_toasts_by_tag(UPDATING_PROCESS_TOAST_TAG);
-
- toast_params toast_params{ UPDATING_PROCESS_TOAST_TAG, false };
-
- std::vector actions = {
- link_button{ GET_RESOURCE_STRING(IDS_GITHUB_NEW_VERSION_MORE_INFO),
- L"powertoys://open_overview/" },
- };
- show_toast_with_activations(GET_RESOURCE_STRING(IDS_GITHUB_NEW_VERSION_AVAILABLE),
- GET_RESOURCE_STRING(IDS_TOAST_TITLE),
- {},
- std::move(actions),
- std::move(toast_params),
- L"powertoys://open_overview/");
-}
-
-SHELLEXECUTEINFOW LaunchPowerToysUpdate(const wchar_t* cmdline)
-{
- std::wstring powertoysUpdaterPath;
- powertoysUpdaterPath = get_module_folderpath();
-
- powertoysUpdaterPath += L"\\PowerToys.Update.exe";
- SHELLEXECUTEINFOW sei{ sizeof(sei) };
- sei.fMask = { SEE_MASK_FLAG_NO_UI | SEE_MASK_NOASYNC | SEE_MASK_NOCLOSEPROCESS };
- sei.lpFile = powertoysUpdaterPath.c_str();
- sei.nShow = SW_SHOWNORMAL;
- sei.lpParameters = cmdline;
- ShellExecuteExW(&sei);
- return sei;
-}
-
-bool IsMeteredConnection()
-{
- using namespace winrt::Windows::Networking::Connectivity;
- ConnectionProfile internetConnectionProfile = NetworkInformation::GetInternetConnectionProfile();
- if (!internetConnectionProfile)
- {
- return false;
- }
-
- if (internetConnectionProfile.IsWwanConnectionProfile())
- {
- return true;
- }
-
- ConnectionCost connectionCost = internetConnectionProfile.GetConnectionCost();
- if (connectionCost.Roaming()
- || connectionCost.OverDataLimit()
- || connectionCost.NetworkCostType() == NetworkCostType::Fixed
- || connectionCost.NetworkCostType() == NetworkCostType::Variable)
- {
- return true;
- }
-
- return false;
-}
-
-void ProcessNewVersionInfo(const github_version_info& version_info,
- UpdateState& state,
- const bool download_update,
- bool show_notifications)
-{
- state.githubUpdateLastCheckedDate.emplace(timeutil::now());
- if (std::holds_alternative(version_info))
- {
- state.state = UpdateState::upToDate;
- state.releasePageUrl = {};
- state.downloadedInstallerFilename = {};
- Logger::trace(L"Version is up to date");
- return;
- }
- const auto new_version_info = std::get(version_info);
- state.releasePageUrl = new_version_info.release_page_uri.ToString().c_str();
- Logger::trace(L"Discovered new version {}", new_version_info.version.toWstring());
-
- const bool already_downloaded = state.state == UpdateState::readyToInstall && state.downloadedInstallerFilename == new_version_info.installer_filename;
- if (already_downloaded)
- {
- Logger::trace(L"New version is already downloaded");
- return;
- }
-
- // Check toast notification GPOs and settings. (We check only if notifications are allowed. This is the case if we are triggered by the periodic check.)
- // Disable notification GPO or setting
- bool disable_notification_setting = get_general_settings().showNewUpdatesToastNotification == false;
- if (show_notifications && (disable_notification_setting || powertoys_gpo::getDisableNewUpdateToastValue() == powertoys_gpo::gpo_rule_configured_enabled))
- {
- Logger::info(L"There is a new update available or ready to install. But the toast notification is disabled by setting or GPO.");
- show_notifications = false;
- }
- // Suspend notification GPO
- else if (show_notifications && powertoys_gpo::getSuspendNewUpdateToastValue() == powertoys_gpo::gpo_rule_configured_enabled)
- {
- Logger::info(L"GPO to suspend new update toast notification is enabled.");
- if (new_version_info.version.major <= VERSION_MAJOR && new_version_info.version.minor - VERSION_MINOR <= UPDATE_NOTIFICATION_TOAST_SUSPEND_MINOR_VERSION_COUNT)
- {
- Logger::info(L"The difference between the installed version and the newer version is within the allowed period. The toast notification is not shown.");
- show_notifications = false;
- }
- else
- {
- Logger::info(L"The installed version is older than allowed for suspending the toast notification. The toast notification is shown.");
- }
- }
-
- if (download_update)
- {
- Logger::trace(L"Downloading installer for a new version");
-
- // Cleanup old updates before downloading the latest
- updating::cleanup_updates();
-
- if (download_new_version(new_version_info).get())
- {
- state.state = UpdateState::readyToInstall;
- state.downloadedInstallerFilename = new_version_info.installer_filename;
- Trace::UpdateDownloadCompleted(true, new_version_info.version.toWstring());
- if (show_notifications)
- {
- ShowNewVersionAvailable(new_version_info);
- }
- }
- else
- {
- state.state = UpdateState::errorDownloading;
- state.downloadedInstallerFilename = {};
- Trace::UpdateDownloadCompleted(false, new_version_info.version.toWstring());
- Logger::error("Couldn't download new installer");
- }
- }
- else
- {
- Logger::trace(L"New version is ready to download, showing notification");
- state.state = UpdateState::readyToDownload;
- state.downloadedInstallerFilename = {};
- if (show_notifications)
- {
- ShowOpenSettingsForUpdate();
- }
- }
-}
-
-void PeriodicUpdateWorker()
-{
- for (;;)
- {
- auto state = UpdateState::read();
- int64_t sleep_minutes_till_next_update = UPDATE_CHECK_AFTER_FAILED_INTERVAL_MINUTES;
- if (state.githubUpdateLastCheckedDate.has_value())
- {
- int64_t last_checked_minutes_ago = timeutil::diff::in_minutes(timeutil::now(), *state.githubUpdateLastCheckedDate);
- if (last_checked_minutes_ago < 0)
- {
- last_checked_minutes_ago = UPDATE_CHECK_INTERVAL_MINUTES;
- }
- sleep_minutes_till_next_update = max(0, UPDATE_CHECK_INTERVAL_MINUTES - last_checked_minutes_ago);
- }
-
- std::this_thread::sleep_for(std::chrono::minutes{ sleep_minutes_till_next_update });
-
- // Auto download setting.
- bool download_update = !IsMeteredConnection() && get_general_settings().downloadUpdatesAutomatically;
- if (powertoys_gpo::getDisableAutomaticUpdateDownloadValue() == powertoys_gpo::gpo_rule_configured_enabled)
- {
- Logger::info(L"Automatic download of updates is disabled by GPO.");
- download_update = false;
- }
-
- bool version_info_obtained = false;
- try
- {
- const auto new_version_info = get_github_version_info_async().get();
- if (new_version_info.has_value())
- {
- version_info_obtained = true;
- bool updateAvailable = std::holds_alternative(*new_version_info);
- std::wstring fromVersion = get_product_version();
- std::wstring toVersion = updateAvailable ? std::get(*new_version_info).version.toWstring() : L"";
- Trace::UpdateCheckCompleted(true, updateAvailable, fromVersion, toVersion);
- ProcessNewVersionInfo(*new_version_info, state, download_update, true);
- }
- else
- {
- Trace::UpdateCheckCompleted(false, false, get_product_version(), L"");
- Logger::error(L"Couldn't obtain version info from github: {}", new_version_info.error());
- }
- }
- catch (...)
- {
- Logger::error("periodic_update_worker: error while processing version info");
- }
-
- if (version_info_obtained)
- {
- UpdateState::store([&](UpdateState& v) {
- v = std::move(state);
- });
- }
- else
- {
- std::this_thread::sleep_for(std::chrono::minutes{ UPDATE_CHECK_AFTER_FAILED_INTERVAL_MINUTES });
- }
- }
-}
-
-void CheckForUpdatesCallback()
-{
- Logger::trace(L"Check for updates callback invoked");
- auto state = UpdateState::read();
- try
- {
- auto new_version_info = get_github_version_info_async().get();
- if (!new_version_info)
- {
- // We couldn't get a new version from github for some reason, log error
- state.state = UpdateState::networkError;
- Trace::UpdateCheckCompleted(false, false, get_product_version(), L"");
- Logger::error(L"Couldn't obtain version info from github: {}", new_version_info.error());
- }
- else
- {
- // Auto download setting
- bool download_update = !IsMeteredConnection() && get_general_settings().downloadUpdatesAutomatically;
- if (powertoys_gpo::getDisableAutomaticUpdateDownloadValue() == powertoys_gpo::gpo_rule_configured_enabled)
- {
- Logger::info(L"Automatic download of updates is disabled by GPO.");
- download_update = false;
- }
-
- bool updateAvailable = std::holds_alternative(*new_version_info);
- std::wstring fromVersion = get_product_version();
- std::wstring toVersion = updateAvailable ? std::get(*new_version_info).version.toWstring() : L"";
- Trace::UpdateCheckCompleted(true, updateAvailable, fromVersion, toVersion);
- ProcessNewVersionInfo(*new_version_info, state, download_update, false);
- }
-
- UpdateState::store([&](UpdateState& v) {
- v = std::move(state);
- });
- }
- catch (...)
- {
- Logger::error("CheckForUpdatesCallback: error while processing version info");
- }
-}
diff --git a/src/runner/UpdateUtils.h b/src/runner/UpdateUtils.h
deleted file mode 100644
index 83437c8f80..0000000000
--- a/src/runner/UpdateUtils.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#pragma once
-
-void PeriodicUpdateWorker();
-void CheckForUpdatesCallback();
-
-namespace cmdArg
-{
- // Starts first stage of the PowerToys auto-update process, which involves copying action runner to a temp path and
- // restarting it from there, so it doesn't interfere with the installation process.
- const inline wchar_t* UPDATE_NOW_LAUNCH_STAGE1 = L"-update_now";
- // Stage 2 consists of starting the installer and optionally launching newly installed PowerToys binary.
- // That's indicated by the following 2 flags.
- const inline wchar_t* UPDATE_NOW_LAUNCH_STAGE2 = L"-update_now_stage_2";
- const inline wchar_t* UPDATE_STAGE2_RESTART_PT = L"restart";
- const inline wchar_t* UPDATE_STAGE2_DONT_START_PT = L"dont_start";
-
- const inline wchar_t* UPDATE_REPORT_SUCCESS = L"-report_update_success";
-}
-
-SHELLEXECUTEINFOW LaunchPowerToysUpdate(const wchar_t* cmdline);
\ No newline at end of file
diff --git a/src/runner/ai_detection.h b/src/runner/ai_detection.h
deleted file mode 100644
index 41aa1dc328..0000000000
--- a/src/runner/ai_detection.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#pragma once
-
-// Detect AI capabilities by calling ImageResizer in detection mode.
-// This runs in a background thread to avoid blocking.
-// ImageResizer writes the result to a cache file that it reads on normal startup.
-//
-// Parameters:
-// skipSettingsCheck - If true, skip checking if ImageResizer is enabled in settings.
-// Use this when called from apply_general_settings where we know
-// ImageResizer is being enabled but settings file may not be saved yet.
-void DetectAiCapabilitiesAsync(bool skipSettingsCheck = false);
diff --git a/src/runner/auto_start_helper.cpp b/src/runner/auto_start_helper.cpp
deleted file mode 100644
index ac1ae45afe..0000000000
--- a/src/runner/auto_start_helper.cpp
+++ /dev/null
@@ -1,397 +0,0 @@
-#include "pch.h"
-#include "auto_start_helper.h"
-
-#include
-
-#include
-#include
-#include
-
-// Helper macros from wix.
-#define ExitOnFailure(x, s, ...) \
- if (FAILED(x)) \
- { \
- Logger::error(s, ##__VA_ARGS__); \
- goto LExit; \
- }
-#define ExitWithLastError(x, s, ...) \
- { \
- DWORD util_err = ::GetLastError(); \
- x = HRESULT_FROM_WIN32(util_err); \
- if (!FAILED(x)) \
- { \
- x = E_FAIL; \
- } \
- Logger::error(s, ##__VA_ARGS__); \
- goto LExit; \
- }
-#define ExitFunction() \
- { \
- goto LExit; \
- }
-
-const DWORD USERNAME_DOMAIN_LEN = DNLEN + UNLEN + 2; // Domain Name + '\' + User Name + '\0'
-const DWORD USERNAME_LEN = UNLEN + 1; // User Name + '\0'
-
-bool create_auto_start_task_for_this_user(bool runElevated)
-{
- HRESULT hr = S_OK;
-
- WCHAR username_domain[USERNAME_DOMAIN_LEN];
- WCHAR username[USERNAME_LEN];
-
- std::wstring wstrTaskName;
-
- ITaskService* pService = NULL;
- ITaskFolder* pTaskFolder = NULL;
- ITaskDefinition* pTask = NULL;
- IRegistrationInfo* pRegInfo = NULL;
- ITaskSettings* pSettings = NULL;
- ITriggerCollection* pTriggerCollection = NULL;
- IRegisteredTask* pRegisteredTask = NULL;
-
- // ------------------------------------------------------
- // Get the Domain/Username for the trigger.
- if (!GetEnvironmentVariable(L"USERNAME", username, USERNAME_LEN))
- {
- ExitWithLastError(hr, "Getting username failed: {:x}", hr);
- }
- if (!GetEnvironmentVariable(L"USERDOMAIN", username_domain, USERNAME_DOMAIN_LEN))
- {
- ExitWithLastError(hr, "Getting the user's domain failed: {:x}", hr);
- }
- wcscat_s(username_domain, L"\\");
- wcscat_s(username_domain, username);
-
- // Task Name.
- wstrTaskName = L"Autorun for ";
- wstrTaskName += username;
-
- // Get the executable path passed to the custom action.
- WCHAR wszExecutablePath[MAX_PATH];
- GetModuleFileName(NULL, wszExecutablePath, MAX_PATH);
-
- // ------------------------------------------------------
- // Create an instance of the Task Service.
- hr = CoCreateInstance(CLSID_TaskScheduler,
- NULL,
- CLSCTX_INPROC_SERVER,
- IID_ITaskService,
- reinterpret_cast(&pService));
- ExitOnFailure(hr, "Failed to create an instance of ITaskService: {:x}", hr);
-
- // Connect to the task service.
- hr = pService->Connect(_variant_t(), _variant_t(), _variant_t(), _variant_t());
- ExitOnFailure(hr, "ITaskService::Connect failed: {:x}", hr);
-
- // ------------------------------------------------------
- // Get the PowerToys task folder. Creates it if it doesn't exist.
- hr = pService->GetFolder(_bstr_t(L"\\PowerToys"), &pTaskFolder);
- if (FAILED(hr))
- {
- // Folder doesn't exist. Get the Root folder and create the PowerToys subfolder.
- ITaskFolder* pRootFolder = NULL;
- hr = pService->GetFolder(_bstr_t(L"\\"), &pRootFolder);
- ExitOnFailure(hr, "Cannot get Root Folder pointer: {:x}", hr);
- hr = pRootFolder->CreateFolder(_bstr_t(L"\\PowerToys"), _variant_t(L""), &pTaskFolder);
- if (FAILED(hr))
- {
- pRootFolder->Release();
- ExitOnFailure(hr, "Cannot create PowerToys task folder: {:x}", hr);
- }
- }
-
- // If the task exists, just enable it.
- {
- IRegisteredTask* pExistingRegisteredTask = NULL;
- hr = pTaskFolder->GetTask(_bstr_t(wstrTaskName.c_str()), &pExistingRegisteredTask);
- if (SUCCEEDED(hr))
- {
- // Task exists, try enabling it.
- hr = pExistingRegisteredTask->put_Enabled(VARIANT_TRUE);
- pExistingRegisteredTask->Release();
- if (SUCCEEDED(hr))
- {
- // Function enable. Sounds like a success.
- ExitFunction();
- }
- }
- }
-
- // Create the task builder object to create the task.
- hr = pService->NewTask(0, &pTask);
- ExitOnFailure(hr, "Failed to create a task definition: {:x}", hr);
-
- // ------------------------------------------------------
- // Get the registration info for setting the identification.
- hr = pTask->get_RegistrationInfo(&pRegInfo);
- ExitOnFailure(hr, "Cannot get identification pointer: {:x}", hr);
- hr = pRegInfo->put_Author(_bstr_t(username_domain));
- ExitOnFailure(hr, "Cannot put identification info: {:x}", hr);
-
- // ------------------------------------------------------
- // Create the settings for the task
- hr = pTask->get_Settings(&pSettings);
- ExitOnFailure(hr, "Cannot get settings pointer: {:x}", hr);
-
- hr = pSettings->put_StartWhenAvailable(VARIANT_FALSE);
- ExitOnFailure(hr, "Cannot put_StartWhenAvailable setting info: {:x}", hr);
- hr = pSettings->put_StopIfGoingOnBatteries(VARIANT_FALSE);
- ExitOnFailure(hr, "Cannot put_StopIfGoingOnBatteries setting info: {:x}", hr);
- hr = pSettings->put_ExecutionTimeLimit(_bstr_t(L"PT0S")); //Unlimited
- ExitOnFailure(hr, "Cannot put_ExecutionTimeLimit setting info: {:x}", hr);
- hr = pSettings->put_DisallowStartIfOnBatteries(VARIANT_FALSE);
- ExitOnFailure(hr, "Cannot put_DisallowStartIfOnBatteries setting info: {:x}", hr);
- hr = pSettings->put_Priority(4);
- ExitOnFailure(hr, "Cannot put_Priority setting info : {:x}", hr);
-
- // ------------------------------------------------------
- // Get the trigger collection to insert the logon trigger.
- hr = pTask->get_Triggers(&pTriggerCollection);
- ExitOnFailure(hr, "Cannot get trigger collection: {:x}", hr);
-
- // Add the logon trigger to the task.
- {
- ITrigger* pTrigger = NULL;
- ILogonTrigger* pLogonTrigger = NULL;
- hr = pTriggerCollection->Create(TASK_TRIGGER_LOGON, &pTrigger);
- ExitOnFailure(hr, "Cannot create the trigger: {:x}", hr);
-
- hr = pTrigger->QueryInterface(
- IID_ILogonTrigger, reinterpret_cast(&pLogonTrigger));
- pTrigger->Release();
- ExitOnFailure(hr, "QueryInterface call failed for ILogonTrigger: {:x}", hr);
-
- hr = pLogonTrigger->put_Id(_bstr_t(L"Trigger1"));
-
- // Timing issues may make explorer not be started when the task runs.
- // Add a little delay to mitigate this.
- hr = pLogonTrigger->put_Delay(_bstr_t(L"PT03S"));
-
- // Define the user. The task will execute when the user logs on.
- // The specified user must be a user on this computer.
- hr = pLogonTrigger->put_UserId(_bstr_t(username_domain));
- pLogonTrigger->Release();
- ExitOnFailure(hr, "Cannot add user ID to logon trigger: {:x}", hr);
- }
-
- // ------------------------------------------------------
- // Add an Action to the task. This task will execute the path passed to this custom action.
- {
- IActionCollection* pActionCollection = NULL;
- IAction* pAction = NULL;
- IExecAction* pExecAction = NULL;
-
- // Get the task action collection pointer.
- hr = pTask->get_Actions(&pActionCollection);
- ExitOnFailure(hr, "Cannot get Task collection pointer: {:x}", hr);
-
- // Create the action, specifying that it is an executable action.
- hr = pActionCollection->Create(TASK_ACTION_EXEC, &pAction);
- pActionCollection->Release();
- ExitOnFailure(hr, "Cannot create the action: {:x}", hr);
-
- // QI for the executable task pointer.
- hr = pAction->QueryInterface(
- IID_IExecAction, reinterpret_cast(&pExecAction));
- pAction->Release();
- ExitOnFailure(hr, "QueryInterface call failed for IExecAction: {:x}", hr);
-
- // Set the path of the executable to PowerToys (passed as CustomActionData).
- hr = pExecAction->put_Path(_bstr_t(wszExecutablePath));
- pExecAction->Release();
- ExitOnFailure(hr, "Cannot set path of executable: {:x}", hr);
- }
-
- // ------------------------------------------------------
- // Create the principal for the task
- {
- IPrincipal* pPrincipal = NULL;
- hr = pTask->get_Principal(&pPrincipal);
- ExitOnFailure(hr, "Cannot get principal pointer: {:x}", hr);
-
- // Set up principal information:
- hr = pPrincipal->put_Id(_bstr_t(L"Principal1"));
-
- hr = pPrincipal->put_UserId(_bstr_t(username_domain));
-
- hr = pPrincipal->put_LogonType(TASK_LOGON_INTERACTIVE_TOKEN);
-
- if (runElevated)
- {
- hr = pPrincipal->put_RunLevel(_TASK_RUNLEVEL::TASK_RUNLEVEL_HIGHEST);
- }
- else
- {
- hr = pPrincipal->put_RunLevel(_TASK_RUNLEVEL::TASK_RUNLEVEL_LUA);
- }
- pPrincipal->Release();
- ExitOnFailure(hr, "Cannot put principal run level: {:x}", hr);
- }
- // ------------------------------------------------------
- // Save the task in the PowerToys folder.
- {
- _variant_t SDDL_FULL_ACCESS_FOR_EVERYONE = L"D:(A;;FA;;;WD)";
- hr = pTaskFolder->RegisterTaskDefinition(
- _bstr_t(wstrTaskName.c_str()),
- pTask,
- TASK_CREATE_OR_UPDATE,
- _variant_t(username_domain),
- _variant_t(),
- TASK_LOGON_INTERACTIVE_TOKEN,
- SDDL_FULL_ACCESS_FOR_EVERYONE,
- &pRegisteredTask);
- ExitOnFailure(hr, "Error saving the Task : {:x}", hr);
- }
-
-LExit:
- if (pService)
- pService->Release();
- if (pTaskFolder)
- pTaskFolder->Release();
- if (pTask)
- pTask->Release();
- if (pRegInfo)
- pRegInfo->Release();
- if (pSettings)
- pSettings->Release();
- if (pTriggerCollection)
- pTriggerCollection->Release();
- if (pRegisteredTask)
- pRegisteredTask->Release();
-
- return (SUCCEEDED(hr));
-}
-
-bool delete_auto_start_task_for_this_user()
-{
- HRESULT hr = S_OK;
-
- WCHAR username[USERNAME_LEN];
- std::wstring wstrTaskName;
-
- ITaskService* pService = NULL;
- ITaskFolder* pTaskFolder = NULL;
-
- // ------------------------------------------------------
- // Get the Username for the task.
- if (!GetEnvironmentVariable(L"USERNAME", username, USERNAME_LEN))
- {
- ExitWithLastError(hr, "Getting username failed: {:x}", hr);
- }
-
- // Task Name.
- wstrTaskName = L"Autorun for ";
- wstrTaskName += username;
-
- // ------------------------------------------------------
- // Create an instance of the Task Service.
- hr = CoCreateInstance(CLSID_TaskScheduler,
- NULL,
- CLSCTX_INPROC_SERVER,
- IID_ITaskService,
- reinterpret_cast(&pService));
- ExitOnFailure(hr, "Failed to create an instance of ITaskService: {:x}", hr);
-
- // Connect to the task service.
- hr = pService->Connect(_variant_t(), _variant_t(), _variant_t(), _variant_t());
- ExitOnFailure(hr, "ITaskService::Connect failed: {:x}", hr);
-
- // ------------------------------------------------------
- // Get the PowerToys task folder.
- hr = pService->GetFolder(_bstr_t(L"\\PowerToys"), &pTaskFolder);
- if (FAILED(hr))
- {
- // Folder doesn't exist. No need to disable a non-existing task.
- hr = S_OK;
- ExitFunction();
- }
-
- // ------------------------------------------------------
- // If the task exists, disable.
- {
- IRegisteredTask* pExistingRegisteredTask = NULL;
- hr = pTaskFolder->GetTask(_bstr_t(wstrTaskName.c_str()), &pExistingRegisteredTask);
- if (SUCCEEDED(hr))
- {
- // Task exists, try disabling it.
- hr = pTaskFolder->DeleteTask(_bstr_t(wstrTaskName.c_str()), 0);
- }
- }
-
-LExit:
- if (pService)
- pService->Release();
- if (pTaskFolder)
- pTaskFolder->Release();
-
- return (SUCCEEDED(hr));
-}
-
-bool is_auto_start_task_active_for_this_user()
-{
- HRESULT hr = S_OK;
-
- WCHAR username[USERNAME_LEN];
- std::wstring wstrTaskName;
-
- ITaskService* pService = NULL;
- ITaskFolder* pTaskFolder = NULL;
-
- // ------------------------------------------------------
- // Get the Username for the task.
- if (!GetEnvironmentVariable(L"USERNAME", username, USERNAME_LEN))
- {
- ExitWithLastError(hr, "Getting username failed: {:x}", hr);
- }
-
- // Task Name.
- wstrTaskName = L"Autorun for ";
- wstrTaskName += username;
-
- // ------------------------------------------------------
- // Create an instance of the Task Service.
- hr = CoCreateInstance(CLSID_TaskScheduler,
- NULL,
- CLSCTX_INPROC_SERVER,
- IID_ITaskService,
- reinterpret_cast(&pService));
- ExitOnFailure(hr, "Failed to create an instance of ITaskService: {:x}", hr);
-
- // Connect to the task service.
- hr = pService->Connect(_variant_t(), _variant_t(), _variant_t(), _variant_t());
- ExitOnFailure(hr, "ITaskService::Connect failed: {:x}", hr);
-
- // ------------------------------------------------------
- // Get the PowerToys task folder.
- hr = pService->GetFolder(_bstr_t(L"\\PowerToys"), &pTaskFolder);
- ExitOnFailure(hr, "ITaskFolder doesn't exist: {:x}", hr);
-
- // ------------------------------------------------------
- // If the task exists, disable.
- {
- IRegisteredTask* pExistingRegisteredTask = NULL;
- hr = pTaskFolder->GetTask(_bstr_t(wstrTaskName.c_str()), &pExistingRegisteredTask);
- if (SUCCEEDED(hr))
- {
- // Task exists, get its value.
- VARIANT_BOOL is_enabled;
- hr = pExistingRegisteredTask->get_Enabled(&is_enabled);
- pExistingRegisteredTask->Release();
- if (SUCCEEDED(hr))
- {
- // Got the value. Return it.
- hr = (is_enabled == VARIANT_TRUE) ? S_OK : E_FAIL; // Fake success or fail to return the value.
- ExitFunction();
- }
- }
- }
-
-LExit:
- if (pService)
- pService->Release();
- if (pTaskFolder)
- pTaskFolder->Release();
-
- return (SUCCEEDED(hr));
-}
diff --git a/src/runner/auto_start_helper.h b/src/runner/auto_start_helper.h
deleted file mode 100644
index fb2b68fadf..0000000000
--- a/src/runner/auto_start_helper.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#pragma once
-
-bool is_auto_start_task_active_for_this_user();
-bool create_auto_start_task_for_this_user(bool runElevated);
-bool delete_auto_start_task_for_this_user();
diff --git a/src/runner/bug_report.cpp b/src/runner/bug_report.cpp
deleted file mode 100644
index 697bf518f7..0000000000
--- a/src/runner/bug_report.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-#include "pch.h"
-#include "bug_report.h"
-#include "Generated files/resource.h"
-#include
-#include
-
-BugReportManager& BugReportManager::instance()
-{
- static BugReportManager instance;
- return instance;
-}
-
-void BugReportManager::register_callback(const BugReportCallback& callback)
-{
- std::lock_guard lock(m_callbacksMutex);
- m_callbacks.push_back(callback);
-}
-
-void BugReportManager::clear_callbacks()
-{
- std::lock_guard lock(m_callbacksMutex);
- m_callbacks.clear();
-}
-
-void BugReportManager::notify_observers(bool isRunning)
-{
- std::lock_guard lock(m_callbacksMutex);
- for (const auto& callback : m_callbacks)
- {
- try
- {
- callback(isRunning);
- }
- catch (...)
- {
- // Ignore callback exceptions to prevent one bad callback from affecting others
- }
- }
-}
-
-void BugReportManager::launch_bug_report() noexcept
-{
- std::wstring bug_report_path = get_module_folderpath();
- bug_report_path += L"\\Tools\\PowerToys.BugReportTool.exe";
-
- bool expected_isBugReportRunning = false;
- if (m_isBugReportRunning.compare_exchange_strong(expected_isBugReportRunning, true))
- {
- // Notify observers that bug report is starting
- notify_observers(true);
-
- std::thread([this, bug_report_path]() {
- SHELLEXECUTEINFOW sei{ sizeof(sei) };
- sei.fMask = { SEE_MASK_FLAG_NO_UI | SEE_MASK_NOASYNC | SEE_MASK_NOCLOSEPROCESS | SEE_MASK_NO_CONSOLE };
- sei.lpFile = bug_report_path.c_str();
- sei.nShow = SW_HIDE;
- if (ShellExecuteExW(&sei))
- {
- WaitForSingleObject(sei.hProcess, INFINITE);
- CloseHandle(sei.hProcess);
- static const std::wstring bugreport_success = GET_RESOURCE_STRING(IDS_BUGREPORT_SUCCESS);
- MessageBoxW(nullptr, bugreport_success.c_str(), L"PowerToys", MB_OK);
- }
-
- m_isBugReportRunning.store(false);
- // Notify observers that bug report has finished
- notify_observers(false);
- }).detach();
- }
- else
- {
- notify_observers(false);
- }
-}
-
-bool BugReportManager::is_bug_report_running() const noexcept
-{
- return m_isBugReportRunning.load();
-}
-
-// Legacy functions for backward compatibility
-void launch_bug_report() noexcept
-{
- BugReportManager::instance().launch_bug_report();
-}
-
-bool is_bug_report_running() noexcept
-{
- return BugReportManager::instance().is_bug_report_running();
-}
diff --git a/src/runner/bug_report.h b/src/runner/bug_report.h
deleted file mode 100644
index 6edb1c6ba3..0000000000
--- a/src/runner/bug_report.h
+++ /dev/null
@@ -1,43 +0,0 @@
-#pragma once
-
-#include
-#include
-#include
-
-// Observer pattern for bug report status changes
-using BugReportCallback = std::function;
-
-class BugReportManager
-{
-public:
- static BugReportManager& instance();
-
- // Register a callback to be notified when bug report status changes
- void register_callback(const BugReportCallback& callback);
-
- // Remove all callbacks (useful for cleanup)
- void clear_callbacks();
-
- // Launch bug report and notify observers
- void launch_bug_report() noexcept;
-
- // Check if bug report is currently running
- bool is_bug_report_running() const noexcept;
-
-private:
- BugReportManager() = default;
- ~BugReportManager() = default;
- BugReportManager(const BugReportManager&) = delete;
- BugReportManager& operator=(const BugReportManager&) = delete;
-
- // Notify all registered callbacks
- void notify_observers(bool isRunning);
-
- std::atomic_bool m_isBugReportRunning = false;
- std::vector m_callbacks;
- mutable std::mutex m_callbacksMutex;
-};
-
-// Legacy functions for backward compatibility
-void launch_bug_report() noexcept;
-bool is_bug_report_running() noexcept;
\ No newline at end of file
diff --git a/src/runner/centralized_hotkeys.cpp b/src/runner/centralized_hotkeys.cpp
deleted file mode 100644
index d0ad870f52..0000000000
--- a/src/runner/centralized_hotkeys.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-#include "pch.h"
-#include "centralized_hotkeys.h"
-
-#include