wixsharp: CustomDialog ManagedUI fails to go to next screen

project.ManagedUI.InstallDialogs.Add<CustomInstallDialogs.WelcomeDialog>()
                                                     .Add<CustomInstallDialogs.LicenceDialog>()
                                                     .Add<CustomInstallDialogs.FeaturesDialog>()
                                                     .Add<CustomInstallDialogs.ProgressDialog>()
                                                     .Add<CustomInstallDialogs.ExitDialog>();

project.ManagedUI.ModifyDialogs.Add<CustomInstallDialogs.ModifyDialog>()
                                                       .Add<CustomInstallDialogs.FeaturesDialog>()
                                                       .Add<CustomInstallDialogs.ProgressDialog>()
                                                       .Add<CustomInstallDialogs.ExitDialog>();

Above is my code for my CustomManagedUI. It works fine while installing. But When run again after installation it shows up the modify dialog as expected, but the problem is that on clicking any of Repair/Remove/Change button the UI exits without any warning.

Feature dialog load started Feature dialog build feature tree started Feature dialog build feature tree completed Feature dialog load completed MSI © (80!BC) [14:28:25:395]: PROPERTY CHANGE: Adding WIXSHARP_RUNTIME_DATA property. Its value is ‘WIXSHARP_MANAGED_UI_HANDLE=11409886’. Cannot attach ManagedUI: Microsoft.Deployment.WindowsInstaller.InstallCanceledException: Exception of type ‘Microsoft.Deployment.WindowsInstaller.InstallCanceledException’ was thrown. at WixSharp.ManagedUI.Initialize(Session session, String resourcePath, InstallUIOptions& uiLevel) SFXCA: Initialization canceled by user.

above is the log section where an exception is seen.

Complete log file is attached abc.txt

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

Then your environment is OK. Good starting point.

The problem is somehow is in your setup definition. The obvious suspect is your custom UI. That’s why you need to debug it. And this is how you can do it.

  1. Place Debug.Assert(false); in your dialog constructor.
  2. Run VS as admin. Elevation is required because MSI is always elevated so if one wants to debug it it also needs elevation.
  3. Run your msi and observe assertion dialog.
  4. Attach VS to the right instance of rundll32.exe. MSI never runs the custom actions themselves but rather executes them as a separate process rundll32.exe.

You can try to do step #4 by simply selecting the VS instance from the assertion dialog but I found that sometimes it fails to attach properly. Though probably it makes sense to try it this way.

Now you are debugging. So see what throws the exception.