Log to appdata folder from the bootstrapper and the msi (#11828)

This commit is contained in:
Mykhailo Pylyp 2021-06-23 18:46:17 +03:00 committed by GitHub
parent 2dc82f31b3
commit f0b94453f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 23 deletions

View File

@ -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;

View File

@ -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_"};