From a29ff07ec03d892c877278882f07e15536db0073 Mon Sep 17 00:00:00 2001 From: Heiko <61519853+htcfreek@users.noreply.github.com> Date: Wed, 8 Jan 2025 15:03:27 +0100 Subject: [PATCH] [Settings][PTRun]Show plugin version and website (#36580) --- .../modules/launcher/new-plugin-checklist.md | 3 +- .../plugin.json | 2 +- .../plugin.json | 2 +- .../plugin.json | 2 +- .../plugin.json | 2 +- .../Microsoft.Plugin.Folder/plugin.json | 2 +- .../Microsoft.Plugin.Shell/plugin.json | 2 +- .../Plugins/Microsoft.Plugin.Uri/plugin.json | 2 +- .../Microsoft.Plugin.WindowWalker/plugin.json | 2 +- .../plugin.json | 2 +- .../plugin.json | 2 +- .../plugin.json | 2 +- .../plugin.json | 2 +- .../plugin.json | 2 +- .../plugin.json | 2 +- .../plugin.json | 2 +- .../plugin.json | 2 +- .../plugin.json | 2 +- .../plugin.json | 2 +- .../launcher/PowerLauncher/SettingsReader.cs | 5 +++ .../PowerLauncherPluginSettings.cs | 4 ++ .../SettingsXAML/Styles/TextBlock.xaml | 5 +++ .../SettingsXAML/Views/PowerLauncherPage.xaml | 45 ++++++++++++++++--- .../Settings.UI/Strings/en-us/Resources.resw | 8 +++- .../PowerLauncherPluginViewModel.cs | 14 ++++++ 25 files changed, 95 insertions(+), 25 deletions(-) diff --git a/doc/devdocs/modules/launcher/new-plugin-checklist.md b/doc/devdocs/modules/launcher/new-plugin-checklist.md index 7287e4305e..e1bb7fae09 100644 --- a/doc/devdocs/modules/launcher/new-plugin-checklist.md +++ b/doc/devdocs/modules/launcher/new-plugin-checklist.md @@ -16,7 +16,7 @@ "Author": string, "Version": "1.0.0", // For future compatibility "Language": "csharp", // So far we support only csharp - "Website": "https://aka.ms/powertoys", + "Website": "https://aka.ms/powertoys", // Has to be an absolute uri starting with "http://" or "https://". "ExecuteFileName": string, // Should be {Type}.PowerToys.Run.Plugin.{PluginName}.dll "IcoPathDark": string, // Path to dark theme icon. The path is relative to the root plugin folder "IcoPathLight": string // Path to light theme icon. The path is relative to the root plugin folder @@ -42,3 +42,4 @@ In the PR that adds a new plugin, reference a new issue to track the work for fu - [ ] Add the resource folder to https://github.com/microsoft/PowerToys/blob/21247c0bb09a1bee3d14d6efa53d0c247f7236af/installer/PowerToysSetup/Product.wxs#L825 - [ ] Add the resource files under the section https://github.com/microsoft/PowerToys/blob/21247c0bb09a1bee3d14d6efa53d0c247f7236af/installer/PowerToysSetup/Product.wxs#L882 +- [ ] Your plugin's executable file (DLL) has to have correct version informations after building it. (This version information will be shown on the settings page.) diff --git a/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.UnitConverter/plugin.json b/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.UnitConverter/plugin.json index 267dd5687b..51d639f12c 100644 --- a/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.UnitConverter/plugin.json +++ b/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.UnitConverter/plugin.json @@ -6,7 +6,7 @@ "Author": "ThiefZero", "Version": "0.0.1", "Language": "csharp", - "Website": "https://github.com/ThiefZero", + "Website": "https://aka.ms/PowerToys", "IcoPathDark": "Images\\unitconverter.dark.png", "IcoPathLight": "Images\\unitconverter.light.png", "ExecuteFileName": "Community.PowerToys.Run.Plugin.UnitConverter.dll" diff --git a/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.VSCodeWorkspaces/plugin.json b/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.VSCodeWorkspaces/plugin.json index c5f0a7b84c..9dc3bbb1ff 100644 --- a/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.VSCodeWorkspaces/plugin.json +++ b/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.VSCodeWorkspaces/plugin.json @@ -6,7 +6,7 @@ "Author": "ricardosantos9521", "Version": "1.2.0", "Language": "csharp", - "Website": "https://github.com/ricardosantos9521/PowerToys/", + "Website": "https://aka.ms/PowerToys", "ExecuteFileName": "Community.PowerToys.Run.Plugin.VSCodeWorkspaces.dll", "IsGlobal": false, "IcoPathDark": "Images\\code.dark.png", diff --git a/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.ValueGenerator/plugin.json b/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.ValueGenerator/plugin.json index 085efe787b..0e2814ebe2 100644 --- a/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.ValueGenerator/plugin.json +++ b/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.ValueGenerator/plugin.json @@ -7,7 +7,7 @@ "Author": "IHorvalds", "Version": "1.0.0", "Language": "csharp", - "Website": "https://github/com/IHorvalds", + "Website": "https://aka.ms/PowerToys", "IcoPathDark": "Images\\ValueGenerator.dark.png", "IcoPathLight": "Images\\ValueGenerator.light.png", "ExecuteFileName": "Community.PowerToys.Run.Plugin.ValueGenerator.dll" diff --git a/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.WebSearch/plugin.json b/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.WebSearch/plugin.json index 6a751c6071..5d6975ee27 100644 --- a/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.WebSearch/plugin.json +++ b/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.WebSearch/plugin.json @@ -6,7 +6,7 @@ "Author": "cyberrex5", "Version": "1.0.0", "Language": "csharp", - "Website": "https://aka.ms/powertoys", + "Website": "https://aka.ms/PowerToys", "ExecuteFileName": "Community.PowerToys.Run.Plugin.WebSearch.dll", "IcoPathDark": "Images\\WebSearch.dark.png", "IcoPathLight": "Images\\WebSearch.light.png" diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/plugin.json b/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/plugin.json index b806f82945..0e4fcc031b 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/plugin.json +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/plugin.json @@ -6,7 +6,7 @@ "Author": "qianlifeng", "Version": "1.0.0", "Language": "csharp", - "Website": "https://aka.ms/powertoys", + "Website": "https://aka.ms/PowerToys", "ExecuteFileName": "Microsoft.Plugin.Folder.dll", "IcoPathDark": "Images\\folder.dark.png", "IcoPathLight": "Images\\folder.light.png" diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Shell/plugin.json b/src/modules/launcher/Plugins/Microsoft.Plugin.Shell/plugin.json index d38d259858..a0fa25c12c 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Shell/plugin.json +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Shell/plugin.json @@ -6,7 +6,7 @@ "Author": "qianlifeng", "Version": "1.0.0", "Language": "csharp", - "Website": "https://aka.ms/powertoys", + "Website": "https://aka.ms/PowerToys", "ExecuteFileName": "Microsoft.Plugin.Shell.dll", "IcoPathDark": "Images\\shell.dark.png", "IcoPathLight": "Images\\shell.light.png" diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Uri/plugin.json b/src/modules/launcher/Plugins/Microsoft.Plugin.Uri/plugin.json index f6b619e34c..d5e17ed64a 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Uri/plugin.json +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Uri/plugin.json @@ -6,7 +6,7 @@ "Author": "Microsoft", "Version": "1.0.0", "Language": "csharp", - "Website": "http://aka.ms/PowerToys", + "Website": "https://aka.ms/PowerToys", "ExecuteFileName": "Microsoft.Plugin.Uri.dll", "IcoPathDark": "Images\\uri.dark.png", "IcoPathLight": "Images\\uri.light.png" diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/plugin.json b/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/plugin.json index c12c917325..6f3877115d 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/plugin.json +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/plugin.json @@ -6,7 +6,7 @@ "Author": "betadele", "Version": "1.0.0", "Language": "csharp", - "Website": "https://www.windowwalker.com/", + "Website": "https://aka.ms/PowerToys", "ExecuteFileName": "Microsoft.Plugin.WindowWalker.dll", "IcoPathDark": "Images\\windowwalker.dark.png", "IcoPathLight": "Images\\windowwalker.light.png" diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/plugin.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/plugin.json index 3c78e8c183..d8a6356f4b 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/plugin.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/plugin.json @@ -6,7 +6,7 @@ "Author": "cxfksword", "Version": "1.0.0", "Language": "csharp", - "Website": "https://aka.ms/powertoys", + "Website": "https://aka.ms/PowerToys", "ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.Calculator.dll", "IcoPathDark": "Images\\calculator.dark.png", "IcoPathLight": "Images\\calculator.light.png" diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.History/plugin.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.History/plugin.json index 6ef0a02b0f..1a25b9ec7a 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.History/plugin.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.History/plugin.json @@ -6,7 +6,7 @@ "Author": "jefflord", "Version": "1.0.0", "Language": "csharp", - "Website": "https://aka.ms/powertoys", + "Website": "https://aka.ms/PowerToys", "ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.History.dll", "IcoPathDark": "Images\\history.dark.png", "IcoPathLight": "Images\\history.light.png" diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.OneNote/plugin.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.OneNote/plugin.json index 94d50990a3..88874001b6 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.OneNote/plugin.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.OneNote/plugin.json @@ -7,7 +7,7 @@ "Author": "palenshus", "Version": "1.0.0", "Language": "csharp", - "Website": "https://aka.ms/powertoys", + "Website": "https://aka.ms/PowerToys", "ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.OneNote.dll", "IcoPathDark": "Images\\oneNote.dark.png", "IcoPathLight": "Images\\oneNote.light.png" diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.PowerToys/plugin.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.PowerToys/plugin.json index f6c44a4b66..ad56c9bfb2 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.PowerToys/plugin.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.PowerToys/plugin.json @@ -6,7 +6,7 @@ "Author": "davidegiacometti", "Version": "1.0.0", "Language": "csharp", - "Website": "https://aka.ms/powertoys", + "Website": "https://aka.ms/PowerToys", "ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.PowerToys.dll", "IcoPathDark": "Images\\PowerToys.dark.png", "IcoPathLight": "Images\\PowerToys.light.png" diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Registry/plugin.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Registry/plugin.json index 082e47b56f..c15a62abb5 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Registry/plugin.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Registry/plugin.json @@ -6,7 +6,7 @@ "Author": "TobiasSekan", "Version": "1.0.0", "Language": "csharp", - "Website": "https://aka.ms/powertoys", + "Website": "https://aka.ms/PowerToys", "ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.Registry.dll", "IcoPathDark": "Images\\reg.dark.png", "IcoPathLight": "Images\\reg.light.png" diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Service/plugin.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Service/plugin.json index 6833dc8a99..2d58833322 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Service/plugin.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Service/plugin.json @@ -6,7 +6,7 @@ "Author": "davidegiacometti", "Version": "1.0.0", "Language": "csharp", - "Website": "https://aka.ms/powertoys", + "Website": "https://aka.ms/PowerToys", "ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.Service.dll", "IcoPathDark": "Images\\service.dark.png", "IcoPathLight": "Images\\service.light.png" diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.System/plugin.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.System/plugin.json index 30811cbad5..0c83f63db0 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.System/plugin.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.System/plugin.json @@ -6,7 +6,7 @@ "Author": "Wox", "Version": "1.0.0", "Language": "csharp", - "Website": "https://aka.ms/powertoys", + "Website": "https://aka.ms/PowerToys", "ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.System.dll", "IcoPathDark": "Images\\lock.dark.png", "IcoPathLight": "Images\\lock.light.png" diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/plugin.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/plugin.json index 7b0a55d195..f96e13c7ff 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/plugin.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/plugin.json @@ -6,7 +6,7 @@ "Author": "htcfreek", "Version": "1.0.0", "Language": "csharp", - "Website": "https://aka.ms/powertoys", + "Website": "https://aka.ms/PowerToys", "ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.TimeDate.dll", "IcoPathDark": "Images\\timeDate.dark.png", "IcoPathLight": "Images\\timeDate.light.png" diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.WindowsSettings/plugin.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.WindowsSettings/plugin.json index 478a5d38b2..30e7308fcb 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.WindowsSettings/plugin.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.WindowsSettings/plugin.json @@ -6,7 +6,7 @@ "Author": "TobiasSekan", "Version": "1.0.0", "Language": "csharp", - "Website": "https://aka.ms/powertoys", + "Website": "https://aka.ms/PowerToys", "ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.WindowsSettings.dll", "IcoPathDark": "Images\\WindowsSettings.dark.png", "IcoPathLight": "Images\\WindowsSettings.light.png" diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.WindowsTerminal/plugin.json b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.WindowsTerminal/plugin.json index ea70b4a652..d8a0481121 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.WindowsTerminal/plugin.json +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.WindowsTerminal/plugin.json @@ -7,7 +7,7 @@ "Author": "davidegiacometti", "Version": "1.0.0", "Language": "csharp", - "Website": "https://aka.ms/powertoys", + "Website": "https://aka.ms/PowerToys", "ExecuteFileName": "Microsoft.PowerToys.Run.Plugin.WindowsTerminal.dll", "IcoPathDark": "Images\\WindowsTerminal.dark.png", "IcoPathLight": "Images\\WindowsTerminal.light.png" diff --git a/src/modules/launcher/PowerLauncher/SettingsReader.cs b/src/modules/launcher/PowerLauncher/SettingsReader.cs index d70d34a144..7d03e4cb27 100644 --- a/src/modules/launcher/PowerLauncher/SettingsReader.cs +++ b/src/modules/launcher/PowerLauncher/SettingsReader.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.IO.Abstractions; using System.Linq; @@ -251,7 +252,9 @@ namespace PowerLauncher Id = x.Metadata.ID, Name = x.Plugin == null ? x.Metadata.Name : x.Plugin.Name, Description = x.Plugin?.Description, + Version = FileVersionInfo.GetVersionInfo(x.Metadata.ExecuteFilePath).FileVersion, Author = x.Metadata.Author, + Website = x.Metadata.Website, Disabled = x.Metadata.Disabled, IsGlobal = x.Metadata.IsGlobal, ActionKeyword = x.Metadata.ActionKeyword, @@ -281,7 +284,9 @@ namespace PowerLauncher var enabledPolicyState = GPOWrapper.GetRunPluginEnabledValue(id); plugin.Name = name; plugin.Description = value.Description; + plugin.Version = value.Version; plugin.Author = value.Author; + plugin.Website = value.Website; plugin.IconPathDark = value.IconPathDark; plugin.IconPathLight = value.IconPathLight; plugin.EnabledPolicyUiState = (int)enabledPolicyState; diff --git a/src/settings-ui/Settings.UI.Library/PowerLauncherPluginSettings.cs b/src/settings-ui/Settings.UI.Library/PowerLauncherPluginSettings.cs index 2b84fe16f2..0eac24b126 100644 --- a/src/settings-ui/Settings.UI.Library/PowerLauncherPluginSettings.cs +++ b/src/settings-ui/Settings.UI.Library/PowerLauncherPluginSettings.cs @@ -14,8 +14,12 @@ namespace Microsoft.PowerToys.Settings.UI.Library public string Description { get; set; } + public string Version { get; set; } + public string Author { get; set; } + public string Website { get; set; } + public bool Disabled { get; set; } // Use to communicate the state to settings UI (Using int type because we can't reference GPOWrapper.) diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Styles/TextBlock.xaml b/src/settings-ui/Settings.UI/SettingsXAML/Styles/TextBlock.xaml index 1872581498..eea4a05401 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/Styles/TextBlock.xaml +++ b/src/settings-ui/Settings.UI/SettingsXAML/Styles/TextBlock.xaml @@ -19,6 +19,11 @@ + 12 + + 12