diff options
| author | Rob Mensching <rob@firegiant.com> | 2022-02-07 22:00:43 -0800 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2022-02-08 09:42:04 -0800 |
| commit | d88d117691cf229a695307269c063f7fcc27c577 (patch) | |
| tree | c57781e437876813968ebeba377d0babad22b6f9 /src | |
| parent | 24e8f28dc9bea0a72a82abc6cafebe2364c94ef1 (diff) | |
| download | wix-d88d117691cf229a695307269c063f7fcc27c577.tar.gz wix-d88d117691cf229a695307269c063f7fcc27c577.tar.bz2 wix-d88d117691cf229a695307269c063f7fcc27c577.zip | |
Hold a reference to validation callback until the external UI resets
Diffstat (limited to 'src')
| -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; |
