From 6556b32e2731368364acb48c1d6d096633b8c03d Mon Sep 17 00:00:00 2001 From: Nir Bar Date: Thu, 5 Sep 2024 17:33:15 +0300 Subject: [PATCH] Add informational verbose logging for cab creation failures --- Readme.md | 3 ++- src/tools/wix/CabinetBuilder.cs | 11 ++++++++++- src/tools/wix/Data/messages.xml | 17 +++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/Readme.md b/Readme.md index b95639961..78683e84b 100644 --- a/Readme.md +++ b/Readme.md @@ -22,7 +22,7 @@ - [6450](https://github.com/wixtoolset/issues/issues/6450): Support multiple firewall rules with the same name. - [6472](https://github.com/wixtoolset/issues/issues/6472): Bundle can install multi-instance MSI packages. See [Authoring Multiple Instances with Instance Transforms](https://docs.microsoft.com/en-us/windows/win32/msi/authoring-multiple-instances-with-instance-transforms). - [5220](https://github.com/wixtoolset/issues/issues/5220): Automatically add logging flag for any burn ExePackage and related bundles -- [1488](https://github.com/wixtoolset/issues/issues/1488): Add -inc "**.pat1;**.pat2" and -exc "**.pat3;**.pat4" options to heat dir to include and exclude files matching widlcard patterns +- [1488](https://github.com/wixtoolset/issues/issues/1488): Add -inc "**.pat1;**.pat2" and -exc "**.pat3;**.pat4" options to heat dir to include and exclude files matching wildcard patterns - [5783](https://github.com/wixtoolset/issues/issues/5783): Allow MSMQ Windows Feature to be enabled during the installation. - [4676](https://github.com/wixtoolset/issues/issues/4676): bafunctions can implement IBootstrapperApplication or IBootstrapperBAFunction - Add -ssub flag to heat dir to harvest files in top folder only and skip subfolders @@ -37,6 +37,7 @@ - Not overwriting log files when retrying to execute a package - Support sending custom messages on embedded pipe - Best effort to log premature termination of companion process +- Add informational verbose logging for cab creation failures # WiX Toolset on GitHub The WiX Toolset builds Windows installation packages from XML source code. The toolset supports a command-line environment that developers may integrate into their build processes to build Windows Installer (MSI) packages and executable bundles. The WiX GitHub project hosts the WiX source code Git repositories. The following links will take you to more details: diff --git a/src/tools/wix/CabinetBuilder.cs b/src/tools/wix/CabinetBuilder.cs index 3eca11efd..c51126281 100644 --- a/src/tools/wix/CabinetBuilder.cs +++ b/src/tools/wix/CabinetBuilder.cs @@ -100,11 +100,12 @@ public int CreateQueuedCabinets() /// private void ProcessWorkItems() { + CabinetWorkItem cabinetWorkItem = null; try { while (true) { - CabinetWorkItem cabinetWorkItem; + cabinetWorkItem = null; lock (this.cabinetWorkItems) { @@ -124,6 +125,14 @@ private void ProcessWorkItems() catch (WixException we) { this.OnMessage(we.Error); + if (cabinetWorkItem != null) + { + this.OnMessage(WixVerboses.CabinetFailureInfo(null, cabinetWorkItem.CabinetFile, cabinetWorkItem.FileRows.Count, cabinetWorkItem.CompressionLevel.ToString(), cabinetWorkItem.MaxThreshold)); + foreach (FileRow fileRow in cabinetWorkItem.FileRows) + { + this.OnMessage(WixVerboses.CabinetFailureFileInfo(fileRow.SourceLineNumbers, fileRow.File, fileRow.Source, fileRow.FileSize)); + } + } } catch (Exception e) { diff --git a/src/tools/wix/Data/messages.xml b/src/tools/wix/Data/messages.xml index 5427b721c..293a1c981 100644 --- a/src/tools/wix/Data/messages.xml +++ b/src/tools/wix/Data/messages.xml @@ -4082,5 +4082,22 @@ + + + Additional info on cab creation failure: cabinet '{0}', file count {1}, compression level '{2}', max threshold {3}. + + + + + + + + + Additional file info on cab creation failure: file key '{0}', source path '{1}', size {2}. + + + + +