@joebigelow / wix-1 / commits / 69e750b3

Fix MSI validation

Rob Mensching committed Feb 3, 2022 at 16:41 UTC 69e750b3e6cc6e91e2a24075e19d644143c852f9
4 files changed +13 -5
src/wix/WixToolset.Core.Native/Msi/Installer.cs
+2 -1
@@ -4,6 +4,7 @@ namespace WixToolset.Core.Native.Msi
4 {
5 using System;
6 using System.Diagnostics;
7 + using System.Runtime.InteropServices;
8 using System.Text;
9
10 /// <summary>
@@ -15,7 +16,7 @@ namespace WixToolset.Core.Native.Msi
16 /// one message box icon type, one default button, and one installation message type.</param>
17 /// <param name="message">Specifies the message text.</param>
18 /// <returns>-1 for an error, 0 if no action was taken, 1 if OK, 3 to abort.</returns>
18 - public delegate int InstallUIHandler(IntPtr context, uint messageType, string message);
19 + public delegate int InstallUIHandler(IntPtr context, uint messageType, [MarshalAs(UnmanagedType.LPWStr)] string message);
20
21 /// <summary>
22 /// Represents the Windows Installer, provides wrappers to
src/wix/WixToolset.Core.Native/WindowsInstallerValidator.cs
+11 -4
@@ -166,7 +166,7 @@ namespace WixToolset.Core.Native
166 {
167 var action = record.GetString(1);
168
169 - if (!this.SuppressedIces.Contains(action) && this.Ices.Contains(action))
169 + if (!this.SuppressedIces.Contains(action) && (this.Ices.Count == 0 || this.Ices.Contains(action)))
170 {
171 actions.Add(action);
172 }
@@ -281,11 +281,18 @@ namespace WixToolset.Core.Native
281
282 // If we're getting messges during the validation session, log them.
283 // Otherwise, ignore the messages.
284 - if (!this.ValidationSessionInProgress)
284 + if (this.ValidationSessionInProgress)
285 {
286 - var parsedMessage = ParseValidationMessage(message, this.CurrentIce);
286 + try
287 + {
288 + var parsedMessage = ParseValidationMessage(message, this.CurrentIce);
289
288 - continueValidation = this.Callback.ValidationMessage(parsedMessage);
290 + continueValidation = this.Callback.ValidationMessage(parsedMessage);
291 + }
292 + catch
293 + {
294 + return - 1;
295 + }
296 }
297
298 return continueValidation ? 1 : 3;
src/wix/WixToolset.Core.Native/cubes/darice.cub
Binary files a/src/wix/WixToolset.Core.Native/cubes/darice.cub and b/src/wix/WixToolset.Core.Native/cubes/darice.cub differ
src/wix/WixToolset.Core.Native/cubes/mergemod.cub
Binary files a/src/wix/WixToolset.Core.Native/cubes/mergemod.cub and b/src/wix/WixToolset.Core.Native/cubes/mergemod.cub differ