Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
afde579
test bug_report.yml modifications
donlaci Mar 5, 2025
c19ef09
test
donlaci Mar 5, 2025
75161ec
test
donlaci Mar 5, 2025
6928a06
test
donlaci Mar 5, 2025
7ef237a
Update bug_report.yml
donlaci Mar 5, 2025
1d57c53
Update bug_report.yml
donlaci Mar 5, 2025
9eaa173
Update bug_report.yml
donlaci Mar 5, 2025
e5f5b30
Update bug_report.yml
donlaci Mar 5, 2025
056f1da
Update bug_report.yml
donlaci Mar 5, 2025
8c6bf28
Update bug_report.yml
donlaci Mar 5, 2025
0c635f3
Update bug_report.yml
donlaci Mar 5, 2025
75f9d84
Update bug_report.yml
donlaci Mar 5, 2025
e07c6b0
Update bug_report.yml
donlaci Mar 5, 2025
c076fc6
Update bug_report.yml
donlaci Mar 10, 2025
875c808
Update bug_report.yml
donlaci Mar 10, 2025
7e4a9de
test link
donlaci Mar 10, 2025
9566067
Merge branch 'BugReport' of https://github.com/donlaci/PowerToys into…
donlaci Mar 10, 2025
895174d
link
donlaci Mar 10, 2025
85928e1
Update general view page
donlaci Mar 17, 2025
520d5b4
update bugreport yaml
donlaci Mar 17, 2025
137c830
update bugreport
donlaci Mar 17, 2025
af694b6
update bug report link
donlaci Mar 17, 2025
448ad54
spell checker
donlaci Mar 17, 2025
57d5fb2
update bugreport yaml
donlaci Mar 17, 2025
4d99aae
Update bug_report.yml
donlaci Mar 18, 2025
7337651
Update bug_report.yml
donlaci Mar 19, 2025
5fdfc5a
extending info auto filled
donlaci Mar 20, 2025
c9591d6
Merge branch 'BugReport' of https://github.com/donlaci/PowerToys into…
donlaci Mar 21, 2025
930358c
Merge remote-tracking branch 'origin/main' into BugReport
vanzue Apr 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 19 additions & 12 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
name: "🕷️ Bug report"
description: Report errors or unexpected behavior
type: Bug
labels:
- Issue-Bug
- Needs-Triage
body:
- type: markdown
attributes:
value: Please make sure to [search for existing issues](https://github.com/microsoft/PowerToys/issues) before filing a new one!
- type: input
- id: version
type: input
attributes:
label: Microsoft PowerToys version
placeholder: 0.70.0
description: Hover over system tray icon or look at Settings
validations:
required: true

- type: dropdown
- id: installed
type: dropdown
attributes:
label: Installation method
description: How / Where was PowerToys installed from?
Expand All @@ -33,14 +34,6 @@ body:
validations:
required: true

- type: dropdown
attributes:
label: Running as admin
description: Are you running PowerToys as Admin?
options:
- "Yes"
- "No"

- type: dropdown
attributes:
label: Area(s) with issue?
Expand All @@ -67,7 +60,7 @@ body:
- Keyboard Manager
- Mouse Utilities
- Mouse Without Borders
- New+
- New+
- Peek
- PowerRename
- PowerToys Run
Expand Down Expand Up @@ -106,6 +99,19 @@ body:
validations:
required: false

- id: additionalInfo
type: textarea
attributes:
label: Additional Information
placeholder: |
OS version
.Net version
System Language
User or System Installation
Running as admin
validations:
required: false

- type: textarea
attributes:
label: Other Software
Expand All @@ -116,3 +122,4 @@ body:
My Cool Application v0.3 (include a code snippet if it would help!)
validations:
required: false

Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@
<controls:SettingsPageControl.PrimaryLinks>
<controls:PageLink x:Uid="GeneralPage_Documentation" Link="https://aka.ms/PowerToysOverview" />
<controls:PageLink x:Uid="General_Repository" Link="https://aka.ms/powertoys" />
<controls:PageLink x:Uid="GeneralPage_ReportAbug" Link="https://aka.ms/powerToysReportBug" />
<controls:PageLink x:Uid="GeneralPage_ReportAbug" Link="{x:Bind ViewModel.ReportBugLink, Mode=OneWay}" />
<controls:PageLink x:Uid="GeneralPage_RequestAFeature_URL" Link="https://aka.ms/powerToysRequestFeature" />
</controls:SettingsPageControl.PrimaryLinks>
<controls:SettingsPageControl.SecondaryLinks>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ public GeneralPage()

DataContext = ViewModel;

ViewModel.InitializeReportBugLink();

doRefreshBackupRestoreStatus(100);
}

Expand Down
78 changes: 78 additions & 0 deletions src/settings-ui/Settings.UI/ViewModels/GeneralViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using System.Globalization;
using System.IO;
using System.IO.Abstractions;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text.Json;
Expand All @@ -25,11 +26,19 @@
using Microsoft.PowerToys.Settings.UI.Library.ViewModels.Commands;
using Microsoft.PowerToys.Settings.UI.SerializationContext;
using Microsoft.PowerToys.Telemetry;
using Microsoft.Win32;
using Windows.System.Profile;

namespace Microsoft.PowerToys.Settings.UI.ViewModels
{
public partial class GeneralViewModel : Observable
{
public enum InstallScope
{
PerMachine = 0,
PerUser,
}

private GeneralSettings GeneralSettingsConfig { get; set; }

private UpdatingSettings UpdatingSettingsConfig { get; set; }
Expand Down Expand Up @@ -72,6 +81,8 @@ public partial class GeneralViewModel : Observable

private SettingsBackupAndRestoreUtils settingsBackupAndRestoreUtils = SettingsBackupAndRestoreUtils.Instance;

private const string InstallScopeRegKey = @"Software\Classes\powertoys\";

public GeneralViewModel(ISettingsRepository<GeneralSettings> settingsRepository, string runAsAdminText, string runAsUserText, bool isElevated, bool isAdmin, Func<string, int> ipcMSGCallBackFunc, Func<string, int> ipcMSGRestartAsAdminMSGCallBackFunc, Func<string, int> ipcMSGCheckForUpdatesCallBackFunc, string configFileSubfolder = "", Action dispatcherAction = null, Action hideBackupAndRestoreMessageAreaAction = null, Action<int> doBackupAndRestoreDryRun = null, Func<Task<string>> pickSingleFolderDialog = null, Windows.ApplicationModel.Resources.ResourceLoader resourceLoader = null)
{
CheckForUpdatesEventHandler = new ButtonClickCommand(CheckForUpdatesClick);
Expand Down Expand Up @@ -256,6 +267,73 @@ public GeneralViewModel(ISettingsRepository<GeneralSettings> settingsRepository,
private int _initLanguagesIndex;
private bool _languageChanged;

private string reportBugLink;

// Gets or sets a value indicating whether run powertoys on start-up.
public string ReportBugLink
{
get => reportBugLink;
set
{
reportBugLink = value;
OnPropertyChanged(nameof(ReportBugLink));
}
}

public void InitializeReportBugLink()
{
var version = GetPowerToysVersion();

string isElevatedString = "PowerToys is running " + (IsElevated ? "as admin (elevated)" : "as user (non-elevated)");

string installScope = GetCurrentInstallScope() == InstallScope.PerMachine ? "per machine (system)" : "per user";

var info = $"OS Version: {GetOSVersion()} \n.NET Version: {GetDotNetVersion()}\n{isElevatedString}\nInstall scope: {installScope}\nOperating System Language: {CultureInfo.InstalledUICulture.DisplayName}\nSystem locale: {CultureInfo.InstalledUICulture.Name}";

var gitHubURL = "https://github.com/microsoft/PowerToys/issues/new?template=bug_report.yml&labels=Issue-Bug%2CTriage-Needed" +
"&version=" + version + "&additionalInfo=" + System.Web.HttpUtility.UrlEncode(info);

ReportBugLink = gitHubURL;
}

private string GetPowerToysVersion()
{
return Helper.GetProductVersion().TrimStart('v');
}

private string GetOSVersion()
{
return Environment.OSVersion.VersionString;
}

public static string GetDotNetVersion()
{
return $".NET {Environment.Version}";
}

public static InstallScope GetCurrentInstallScope()
{
// Check HKLM first
if (Registry.LocalMachine.OpenSubKey(InstallScopeRegKey) != null)
{
return InstallScope.PerMachine;
}

// If not found, check HKCU
var userKey = Registry.CurrentUser.OpenSubKey(InstallScopeRegKey);
if (userKey != null)
{
var installScope = userKey.GetValue("InstallScope") as string;
userKey.Close();
if (!string.IsNullOrEmpty(installScope) && installScope.Contains("perUser"))
{
return InstallScope.PerUser;
}
}

return InstallScope.PerMachine; // Default if no specific registry key found
}

// Gets or sets a value indicating whether run powertoys on start-up.
public bool Startup
{
Expand Down
Loading