Skip to content

Commit

Permalink
Add informational verbose logging for cab creation failures
Browse files Browse the repository at this point in the history
  • Loading branch information
nirbar committed Sep 5, 2024
1 parent 637ab5e commit 6556b32
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
11 changes: 10 additions & 1 deletion src/tools/wix/CabinetBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,12 @@ public int CreateQueuedCabinets()
/// </summary>
private void ProcessWorkItems()
{
CabinetWorkItem cabinetWorkItem = null;
try
{
while (true)
{
CabinetWorkItem cabinetWorkItem;
cabinetWorkItem = null;

lock (this.cabinetWorkItems)
{
Expand All @@ -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)
{
Expand Down
17 changes: 17 additions & 0 deletions src/tools/wix/Data/messages.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4082,5 +4082,22 @@
<Parameter Type="System.String" Name="name" />
</Instance>
</Message>
<Message Id="CabinetFailureInfo" Number="9037">
<Instance>
Additional info on cab creation failure: cabinet '{0}', file count {1}, compression level '{2}', max threshold {3}.
<Parameter Type="System.String" Name="cabinet" />
<Parameter Type="System.Int32" Name="fileCount" />
<Parameter Type="System.String" Name="compressionLevel" />
<Parameter Type="System.Int32" Name="maxThreshold" />
</Instance>
</Message>
<Message Id="CabinetFailureFileInfo" Number="9038">
<Instance>
Additional file info on cab creation failure: file key '{0}', source path '{1}', size {2}.
<Parameter Type="System.String" Name="fileKey" />
<Parameter Type="System.String" Name="path" />
<Parameter Type="System.Int32" Name="fileSize" />
</Instance>
</Message>
</Class>
</Messages>

0 comments on commit 6556b32

Please sign in to comment.