[wix-users] Custom WPF Bootstrapper problem

Vanniekerk, Tyrel (GE Healthcare) tyrel.vanniekerk at ge.com
Tue Feb 20 07:33:28 PST 2018


Hi,

I have a custom bootstrapper that for the most part works fine.  In the OnApplyBegin function I show a progress window if it's needed and then in OnApplyComplete I close the window.  It being WPF, I store a copy of the dispatcher when I start the UI, in the Run method (For some reason using the Dispatcher.CurrentDispatcher command in later commands would cause an exception) and use the Invoke method to call the UI methods.  So to close a window I call the following code:
            BootstrapperDispatcher.Invoke(delegate
            {
                try
                {
                    RootViewModel.Instance.View.Close();
                }
                catch (Exception ex)
                {
                    InstallerUtils.WriteError("Error closing current window.", ex);
                }

                RootViewModel.Instance.View = null;
            });

Which works fine for all the windows up until the point where the actual install starts.  When I step into this code to close the progress window it just skips over the Invoke.  Does burn do something odd with how it keeps your application base class in memory or something?

Thanks,
Tyrel


More information about the wix-users mailing list