mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-03 19:39:07 +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;
|
||||
}
|
||||
|
||||
fs::path logDir = ".";
|
||||
fs::path logDir = PTSettingsHelper::get_root_save_folder_location();
|
||||
try
|
||||
{
|
||||
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*)
|
||||
{
|
||||
// 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
|
||||
EventViewer::ReportEventViewerInfo(tmpDir);
|
||||
|
||||
ReportBootstrapperLog(tmpDir);
|
||||
|
||||
// Zip folder
|
||||
auto zipPath = path::path(saveZipPath);
|
||||
std::string reportFilename{"PowerToysReport_"};
|
||||
|
Loading…
Reference in New Issue
Block a user