5

I am using Wix Burn to install per-requisites of our project, I have used ManagedBootstrapperApplicationHost to have custom UI, I have been following project available from Wix Source code to create my Managed WPF application..

Now the problem is the Progress (Message) it shows that doesn't match the progress message we have using inbuilt UI - WixStandardBootstrapperApplication.RtfLicense

Basically I am using following code from the Wix source

 private void ExecuteMsiMessage(object sender, ExecuteMsiMessageEventArgs e)
        {
            lock (this)
            {
                this.Message = e.Message;
                e.Result = this.root.Canceled ? Result.Cancel : Result.Ok;
            }
        }

How can I have the same display as the normal Progress dialog has.. Do I have to individually set Message from other methods like PlanPackage etc..

Cœur
  • 37,241
  • 25
  • 195
  • 267
Gaurav
  • 179
  • 1
  • 7

1 Answers1

6

The wixstdba does not show the action data progress messages today. There was someone talking about adding the feature on the wix-devs mailing list but that has not happened yet. It's simply a matter of adding code like you have in the managed case to the wixstdba (that doesn't have it yet).

If you just want to display the name of the package being installed the way the wixstdba does it, then you'll want to handle the Engine.OnCachePackageBegin() and Engine.ExecutePackageBegin() callbacks. Those callbacks tell you when a package begins to be downloaded and then installed respectively. As part of the args to those callbacks you'll be provided the package id.

To get the friendly display name, you can read the BootstrapperApplicationData.xml that is automatically included next to your Bootstrapper Application .dll. In there are WixPackageProperties elements that provide lots of information about the packages in the bundle, including the DisplayName.

--- Sorry, the following is an answer to a question that wasn't asked. ---

The Engine.ExecuteMsiMessage() callback is called when the Windows Installer displays a message (like action data or a request to prompt the user for input). Progress is provided via a three different callbacks.

  1. You can get the overall progress via the Engine.Progress callback. This is a very coarse grained progress that essentially moves as each package is cached and executed.

  2. You can get the overall and individual package progress via the Engine.CacheAcquireProgress. This progress moves as each package is downloaded/copied and verified to be placed in the Package Cache.

  3. You can get the overall and individual package progress via the Engine.ExecuteProgress callback. This progress moves as each package is installed/repaired/uninstalled.

So the Engine.Progress shows you the total overall progress and is very easy to use for a single progress bar but the progress bar will not move very smoothly. You can get a smoother overall progress by adding the Engine.CacheAcquireProgress to the Engine.ExecuteProgress. Note: that will give you a progress bar that goes to 200.

You can see how the WixBA handles all this in the src\Setup\WixBA\ProgressViewModel.cs file.

Rob Mensching
  • 33,834
  • 5
  • 90
  • 130
  • Thanks Rob! I am following ProgressViewModel.cs but the issue I am facing is, while installing third party components like SQL Server.. it shows me "1:2:1" message above the progress bar. I looked into what Message gives me back but it seems there is no way i can show `DisplayName="SQL Server"` from `` of bundle.. – Gaurav Apr 09 '13 at 13:03
  • Thanks Rob! Did the implementation using Engine.OnCachePackageBegin() and Engine.ExecutePackageBegin(), And it worked well, You are Great Help! – Gaurav Apr 10 '13 at 08:22
  • Thanks Rob, your answer helped a lot, however, I am facing an issue where in my progress bar and the progress text both remain blank for a significant amount of time before starting to cache the first MSI package. Will you please let me know how to handle this. @Gaurav: It would be great, if you could let me know if you have faced a smilar issue. – dhiraj suvarna Nov 10 '15 at 07:13