PowerToys/doc/devdocs/modules/launcher/plugins/registry.md
Stefan Markovic e637902892
[PowerRename][ImageResizer] Tier1 Win11 Context menu (#19000)
* Test win11 tier1 context menu

* Try to test signing

* Cleanup

* Cleanup project file

* Sign dll
Add PowerToys preffix
Add assets to installer

* expect.txt

* Switch to named pipes
Unregister package on uninstall
Remove unneeded files
Cleanup

* Bring back check if package registered but use per-user method

* Fix win11 check

* expect.txt

* Check if package already registered

* Revert "Check if package already registered"

FindPackages() method needs admin privileges.

This reverts commit 5af584fed4.

* Fix PowerRename args checking

* Cleanup assets

* Tier1 context menu ImageResizer
Minor cleanups
Move logic to package.h

* [WIP] Signing and installer
Expect.txt

* Localized context menu title

* Retarget everything 10.0.18362.0 -> 10.0.19041.0

* Address PR comments
 - check if selection renamable
 - minor cleanup
 - struct initialization

* Fix ImageResizerLib project configuration

* More Windows version updates

* Remove unneeded file & try fix resource build error

* Add Microsoft.PowerToys prefix to packages

* Test

* Fix convert-resx-to-rc.ps1 script issue causing resource files compile error

Don't generate empty STRINGTABLE for resx files without data

* Avoid duplicate context menu items

* [BugReportTool] Report installed context menu packages
2022-06-30 22:10:14 +02:00

102 lines
5.7 KiB
Markdown

# Registry Plugin
The registry plugin allows users to search the Windows registry.
## Special functions (differ from the regular functions)
* Support full base keys and short base keys (e.g. `HKLM` for `HKEY_LOCALE_MACHINE`).
* Show count of subkeys and count of values in the second result line.
* Search for value names and value data inside a registry key (syntax: `[RegistryKey]\\[ValueName]` and `[RegistryKey]\\[ValueData]`)
## The Windows Registry
The registry contains all settings for the Windows operating system and many settings of the installed (Windows only) programs.
*Note: Linux and macOS program ports typical store the settings in it's own configuration files and not in the Windows registry.*
For more information about the Windows registry, see [the official documentation](https://docs.microsoft.com/en-us/windows/win32/sysinfo/registry).
For advanced information about the Windows registry, see [Windows registry information for advanced users](https://docs.microsoft.com/en-us/troubleshoot/windows-server/performance/windows-registry-advanced-users).
## Score
The score is currently not set on the results.
## Important for developers
### General
* The assembly name is cached into `_assemblyName` (to avoid to many calls of `Assembly.GetExecutingAssembly()`)
### Results
* All results override the visible search result via `QueryTextDisplay` to avoid problems with short registry base keys (e.g. `HKLM`).
* The length of a `Title` and `Subtitle` is automatic truncated, when it is to long.
## Microsoft.Plugin.Registry project
### Important plugin values (meta-data)
| Name | Value |
| --------------- | --------------------------------------------- |
| ActionKeyword | `:` |
| ExecuteFileName | `Microsoft.PowerToys.Run.Plugin.Registry.dll` |
| ID | `303417D927BF4C97BCFFC78A123BE0C8` |
### Interfaces used by this plugin
The plugin use only these interfaces (all inside the `Main.cs`):
* `Wox.Plugin.IPlugin`
* `Wox.Plugin.IContextMenu`
* `Wox.Plugin.IPluginI18n`
* `System.IDisposable`
### Program files
| File | Content |
| ------------------------------------ | ------------------------------------------------------------------------ |
| `Classes\RegistryEntry.cs` | Wrapper class for a registry key with a possible exception on access |
| `Constants\KeyName.cs` | Static used short registry key names (to avoid code and string doubling) |
| `Constants\MaxTextLength.cs` | Contain all maximum text lengths (for truncating) |
| `Enumeration\TruncateSide.cs` | Contain the possible truncate sides |
| `Helper\ContextMenuHelper.cs` | All functions to build the context menu (for each result entry) |
| `Helper\QueryHelper.cs` | All functions to analyze the search query |
| `Helper\RegistryHelper.cs` | All functions to search into the Windows registry (via `Win32.Registry`) |
| `Helper\ResultHelper.cs` | All functions to convert internal results into WOX results |
| `Helper\ValueHelper.cs` | All functions to convert values into human readable values |
| `Images\reg.dark.png` | Symbol for the results for the dark theme |
| `Images\reg.light.png` | Symbol for the results for the light theme |
| `Properties\Resources.Designer.resx` | File that contain all translatable keys |
| `Properties\Resources.resx` | File that contain all translatable strings in the neutral language |
| `GlobalSuppressions.cs` | Code suppressions (no real file, linked via *.csproj) |
| `Main.cs` | Main class, the only place that implement the WOX interfaces |
| `plugin.json` | All meta-data for this plugin |
| `StyleCop.json` | Code style (no real file, linked via *.csproj) |
### Important project values (*.csproj)
| Name | Value |
| --------------- | ------------------------------------------------------------------------------ |
| TargetFramework | `net6.0-windows` (.NET 5) or `net6.0-windows10.0.19041.0` (OS version specific)|
| LangVersion | `8.0` (mean C# 8.0) |
| Platforms | `x64` |
| Nullable | `true` |
| Output | `..\..\..\..\..\x64\Debug\modules\launcher\Plugins\Microsoft.Plugin.Registry\` |
| RootNamespace | `Microsoft.PowerToys.Run.Plugin.Registry` |
| AssemblyName | `Microsoft.PowerToys.Run.Plugin.Registry` |
### Project dependencies
#### Packages
| Package | Version |
| ------------------------------------------------------------------------------------- | ------- |
| [`Microsoft.CodeAnalysis.FxCopAnalyzers`](https://github.com/dotnet/roslyn-analyzers) | 3.3.0 |
| [`StyleCop.Analyzers`](https://github.com/DotNetAnalyzers/StyleCopAnalyzers) | 1.1.118 |
#### Projects
* `Wox.Infrastructure`
* `Wox.Plugin`