mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-15 03:07:56 +01:00
[Setup] Use custom prefix for WiX bootstrapper logs and collect them via BugReportTool (#17062)
This commit is contained in:
@@ -27,6 +27,8 @@
|
|||||||
|
|
||||||
<Variable Name="InstallFolder" Type="string" Value="[ProgramFiles64Folder]PowerToys" bal:Overridable="yes"/>
|
<Variable Name="InstallFolder" Type="string" Value="[ProgramFiles64Folder]PowerToys" bal:Overridable="yes"/>
|
||||||
|
|
||||||
|
<Variable Name="MsiLogFolder" Type="string" Value="[LocalAppDataFolder]\Microsoft\PowerToys\" />
|
||||||
|
<Log Disable="no" Prefix='powertoys-bootstrapper-msi-$(var.Version)' Extension=".log" />
|
||||||
|
|
||||||
<!-- Only install/upgrade if the version is greater or equal than the currently installed version of PowerToys, to handle the case in which PowerToys was installed from old MSI (before WiX bootstrapper was used) -->
|
<!-- Only install/upgrade if the version is greater or equal than the currently installed version of PowerToys, to handle the case in which PowerToys was installed from old MSI (before WiX bootstrapper was used) -->
|
||||||
<!-- If the previous installation is a bundle installation, just let WiX run its logic. -->
|
<!-- If the previous installation is a bundle installation, just let WiX run its logic. -->
|
||||||
|
|||||||
@@ -221,7 +221,6 @@ void ReportWindowsSettings(const filesystem::path& tmpDir)
|
|||||||
{
|
{
|
||||||
printf("Failed to write windows settings\n");
|
printf("Failed to write windows settings\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReportDotNetInstallationInfo(const filesystem::path& tmpDir)
|
void ReportDotNetInstallationInfo(const filesystem::path& tmpDir)
|
||||||
@@ -253,6 +252,27 @@ void ReportVCMLogs(const filesystem::path& tmpDir, const filesystem::path& repor
|
|||||||
copy(tmpDir / "PowerToysVideoConference_x64.log", reportDir, ec);
|
copy(tmpDir / "PowerToysVideoConference_x64.log", reportDir, ec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ReportInstallerLogs(const filesystem::path& tmpDir, const filesystem::path& reportDir)
|
||||||
|
{
|
||||||
|
const char* logFilePrefix = "powertoys-bootstrapper-msi-";
|
||||||
|
|
||||||
|
for (auto& entry : directory_iterator{ tmpDir })
|
||||||
|
{
|
||||||
|
std::error_code ec;
|
||||||
|
if (entry.is_directory(ec) || !entry.path().has_filename())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto fileName = entry.path().filename().string();
|
||||||
|
if (!fileName.starts_with(logFilePrefix))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
copy(entry.path(), reportDir / fileName, ec);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
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
|
||||||
@@ -329,6 +349,8 @@ int wmain(int argc, wchar_t* argv[], wchar_t*)
|
|||||||
|
|
||||||
ReportVCMLogs(tempDir, reportDir);
|
ReportVCMLogs(tempDir, reportDir);
|
||||||
|
|
||||||
|
ReportInstallerLogs(tempDir, reportDir);
|
||||||
|
|
||||||
// Zip folder
|
// Zip folder
|
||||||
auto zipPath = path::path(saveZipPath);
|
auto zipPath = path::path(saveZipPath);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user