diff options
-rw-r--r-- | src/wix/WixToolset.Core.Native/WindowsInstallerValidator.cs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/wix/WixToolset.Core.Native/WindowsInstallerValidator.cs b/src/wix/WixToolset.Core.Native/WindowsInstallerValidator.cs index 8f2adf54..39242577 100644 --- a/src/wix/WixToolset.Core.Native/WindowsInstallerValidator.cs +++ b/src/wix/WixToolset.Core.Native/WindowsInstallerValidator.cs | |||
@@ -18,6 +18,8 @@ namespace WixToolset.Core.Native | |||
18 | { | 18 | { |
19 | private const string CubesFolder = "cubes"; | 19 | private const string CubesFolder = "cubes"; |
20 | 20 | ||
21 | private readonly InstallUIHandler validationUIHandlerDelegate; | ||
22 | |||
21 | /// <summary> | 23 | /// <summary> |
22 | /// Creates a new Windows Installer validator. | 24 | /// Creates a new Windows Installer validator. |
23 | /// </summary> | 25 | /// </summary> |
@@ -33,6 +35,9 @@ namespace WixToolset.Core.Native | |||
33 | this.CubeFiles = cubeFiles; | 35 | this.CubeFiles = cubeFiles; |
34 | this.Ices = new SortedSet<string>(ices); | 36 | this.Ices = new SortedSet<string>(ices); |
35 | this.SuppressedIces = new SortedSet<string>(suppressedIces); | 37 | this.SuppressedIces = new SortedSet<string>(suppressedIces); |
38 | |||
39 | // Hold a reference to our callback beyond when the external UI handler is reset. | ||
40 | this.validationUIHandlerDelegate = new InstallUIHandler(this.ValidationUIHandler); | ||
36 | } | 41 | } |
37 | 42 | ||
38 | private IWindowsInstallerValidatorCallback Callback { get; } | 43 | private IWindowsInstallerValidatorCallback Callback { get; } |
@@ -175,7 +180,7 @@ namespace WixToolset.Core.Native | |||
175 | 180 | ||
176 | // Disable the internal UI handler and set an external UI handler. | 181 | // Disable the internal UI handler and set an external UI handler. |
177 | previousUILevel = Installer.SetInternalUI((int)InstallUILevels.None, ref previousHwnd); | 182 | previousUILevel = Installer.SetInternalUI((int)InstallUILevels.None, ref previousHwnd); |
178 | previousUIHandler = Installer.SetExternalUI(this.ValidationUIHandler, (int)InstallLogModes.Error | (int)InstallLogModes.Warning | (int)InstallLogModes.User, IntPtr.Zero); | 183 | previousUIHandler = Installer.SetExternalUI(this.validationUIHandlerDelegate, (int)InstallLogModes.Error | (int)InstallLogModes.Warning | (int)InstallLogModes.User, IntPtr.Zero); |
179 | 184 | ||
180 | // Create a session for running the ICEs. | 185 | // Create a session for running the ICEs. |
181 | this.ValidationSessionInProgress = true; | 186 | this.ValidationSessionInProgress = true; |