mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-13 02:39:22 +08:00
0314b570cd
* Architecture and (#7267) * Added debugging steps for PT Run * Updated architecture markdown for launcher * updated project architecture markdown for launcher * Added telemetry docs for launcher * Added the basic folder structure and files * Added a basic overview of all common functionalities of the plugins * Added information about the functioning of the calculator plugin * update score section of overview * added information about the uri plugin * added info about the indexer plugin * Added the documentation for the indexer plugin * Added information about the program plugin * Added info about the shell plugin * updated some plugin info and added information about the ww plugin * documenting the folder plugin * updated window walker docs * dev docs for the folder plugin * added images to each of the plugins * Added link to pt run documents * fix typos and some minor corrections * Add table of contents for pt run dev docs * Fix image path and project link for Wox.plugin Co-authored-by: Divyansh Srivastava <somm14divi@gmail.com>
3.1 KiB
3.1 KiB
Program Plugin
The program plugin as the name suggests is used to search for programs installed on the system.
There are broadly two different categories of applications:
- Packaged applications
- Win32 applications
UWP
- The logic for indexing Packaged applications is present within the
UWP.cs
file. - There can be multiple applications present within a package. The
UWPApplication.cs
file encapsulates the properties of a packaged application. - To index packaged applications, the
PackageManager
retrives all the packages for the current user and indexes all the applications. - To retrieve the app icon for packaged applications, the assets path is retrieved from the
Application Manifest
file. There are multiple icons corresponding to each scale, target size and theme. The best icon is chosen given the theme of powerToys Run.
Win32Program
- Win32 programs in the following locations are indexed by PT Run-
- Desktop
- Public Desktop (Applications present on the desktop of all the users)
- Registry (Some programs)
- Start Menu
- Common start menu (Applications which are common to all users)
- Locations pointed to by the PATH environment variable.
- To prevent applications and shortcuts present in multiple locations from showing up as duplicate results, we consider apps with the same name, executable name and full path to be the same.
- The subtitle of the application result is set based on it's application type. It could be one of the following:
- Lnk Shortcuts
- Appref files
- Internet shortcut - steam and epic games
- PWAs
- Run commands - these are indexed by the PATH environment variable
Score
- The score for each application result is based on the how many letters are matched, how close the matched letters are to the actual word and the index of the matched characters.
- There is a threshold score to decide the apps which are to be displayed and applications which have a lower score are not displayed by PT Run.
Update Program List in Runtime
- Packaged and Win32 app helpers exist to reflect changes in the list of indexed apps when applications are installed on the system while PT Run is executing.
- Packaged applications trigger events when the package is being installed and uninstalled. PT Run listens to those events to index applications which are newly installed or to delete an app which no longer exists from the database.
- No such events exist for Win32 applications. We therefore use FileSystem Watchers to monitor the locations that we index for newly created, deleted or renamed application files and update the indexed Win32 catalog accordingly.
Additional Notes
- Arguments can be provided to the program plugin by entering them after
--
(a double dash).