mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 10:46:33 +02:00
Bug report tool for registry (#9213)
* wip * Improved registry bug reporting * Don't use macros * Ignore spelling of NLSTEXT in macro * Various improvements * Move functions to separate files * Rename result file to registry-report-info.txt * Rename a poorly named function in ReportMonitorInfo.cpp * Restrict scope of symbols in these .cpp files Co-authored-by: Davide <davide.giacometti@outlook.it>
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include <common/utils/exec.h>
|
||||
|
||||
#include "ReportMonitorInfo.h"
|
||||
#include "ReportRegistry.h"
|
||||
using namespace std;
|
||||
using namespace std::filesystem;
|
||||
using namespace winrt::Windows::Data::Json;
|
||||
@@ -148,27 +149,6 @@ void hideUserPrivateInfo(const filesystem::path& dir)
|
||||
}
|
||||
}
|
||||
|
||||
void reportMonitorInfo(const filesystem::path& tmpDir)
|
||||
{
|
||||
auto monitorReportPath = tmpDir;
|
||||
monitorReportPath.append("monitor-report-info.txt");
|
||||
|
||||
try
|
||||
{
|
||||
wofstream monitorReport(monitorReportPath);
|
||||
monitorReport << "GetSystemMetrics = " << GetSystemMetrics(SM_CMONITORS) << '\n';
|
||||
report(monitorReport);
|
||||
}
|
||||
catch (std::exception& ex)
|
||||
{
|
||||
printf("Failed to report monitor info. %s\n", ex.what());
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
printf("Failed to report monitor info\n");
|
||||
}
|
||||
}
|
||||
|
||||
void reportWindowsVersion(const filesystem::path& tmpDir)
|
||||
{
|
||||
auto versionReportPath = tmpDir;
|
||||
@@ -285,6 +265,9 @@ int wmain(int argc, wchar_t* argv[], wchar_t*)
|
||||
// Write dotnet installation info to the temporary folder
|
||||
reportDotNetInstallationInfo(tmpDir);
|
||||
|
||||
// Write registry to the temporary folder
|
||||
reportRegistry(tmpDir);
|
||||
|
||||
// Zip folder
|
||||
auto zipPath = path::path(saveZipPath);
|
||||
std::string reportFilename{"PowerToysReport_"};
|
||||
@@ -304,4 +287,4 @@ int wmain(int argc, wchar_t* argv[], wchar_t*)
|
||||
|
||||
deleteFolder(tmpDir);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user