mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-06-11 12:14:53 +08:00
Log to appdata folder from the bootstrapper and the msi (#11828)
This commit is contained in:
parent
2dc82f31b3
commit
f0b94453f2
@ -232,7 +232,7 @@ int Bootstrapper(HINSTANCE hInstance)
|
|||||||
installFolderProp = L"INSTALLFOLDER=" + installFolderProp;
|
installFolderProp = L"INSTALLFOLDER=" + installFolderProp;
|
||||||
}
|
}
|
||||||
|
|
||||||
fs::path logDir = ".";
|
fs::path logDir = PTSettingsHelper::get_root_save_folder_location();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
fs::path logDirArgPath = logDirArg;
|
fs::path logDirArgPath = logDirArg;
|
||||||
|
@ -245,26 +245,6 @@ void ReportDotNetInstallationInfo(const filesystem::path& tmpDir)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReportBootstrapperLog(const filesystem::path& targetDir)
|
|
||||||
{
|
|
||||||
for (const auto entry : filesystem::directory_iterator{temp_directory_path()})
|
|
||||||
{
|
|
||||||
if (!entry.is_regular_file() || !entry.path().has_filename())
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::wstring filename = entry.path().filename().native();
|
|
||||||
if (!filename.starts_with(L"powertoys-bootstrapper-") || !filename.ends_with(L".log"))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::error_code _;
|
|
||||||
copy(entry.path(), targetDir, _);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int wmain(int argc, wchar_t* argv[], wchar_t*)
|
int wmain(int argc, wchar_t* argv[], wchar_t*)
|
||||||
{
|
{
|
||||||
// Get path to save zip
|
// Get path to save zip
|
||||||
@ -336,8 +316,6 @@ int wmain(int argc, wchar_t* argv[], wchar_t*)
|
|||||||
// Write event viewer logs info to the temporary folder
|
// Write event viewer logs info to the temporary folder
|
||||||
EventViewer::ReportEventViewerInfo(tmpDir);
|
EventViewer::ReportEventViewerInfo(tmpDir);
|
||||||
|
|
||||||
ReportBootstrapperLog(tmpDir);
|
|
||||||
|
|
||||||
// Zip folder
|
// Zip folder
|
||||||
auto zipPath = path::path(saveZipPath);
|
auto zipPath = path::path(saveZipPath);
|
||||||
std::string reportFilename{"PowerToysReport_"};
|
std::string reportFilename{"PowerToysReport_"};
|
||||||
|
Loading…
Reference in New Issue
Block a user