phoenix
phoenix

Reputation: 485

WiX Burn: MsiPackage internal UI display but behind the custom WPF UI

I am creating a custom bootstrapper which has a WPF UI.

Everything is OK, but it has a problem. The internal UI displays behind the custom WPF UI.

How do I set the internal UI to display at the top of window?

I tried to minimize the WPF UI when I click the Install button. Yes, the WPF UI will minimized, and seconds later the internal UI also... It shows with the minimized window state too.

My bundle.wxs:

    <BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost">
        <PayloadGroupRef Id="InstallerPayload"/>
    </BootstrapperApplicationRef>

    <Chain>
        <PackageGroupRef Id="NetFx40Full"/>
        <PackageGroupRef Id="InstallerPackages"></PackageGroupRef>
    </Chain>
</Bundle>

<Fragment>
    <PayloadGroup Id="InstallerPayload">
        <Payload SourceFile="..\CustomBootstrapper\bin\release\MahApps.Metro.dll"/>
        <Payload SourceFile="..\CustomBootstrapper\bin\release\System.Windows.Interactivity.dll"/>
        <Payload SourceFile ="..\CustomBootstrapper\bin\release\CustomBootstrapper.dll"/>
        <Payload SourceFile="..\CustomBootstrapper\BootstrapperCore.config" />
        <Payload SourceFile="C:\Program Files (x86)\WiX Toolset v3.7\SDK\Microsoft.Deployment.WindowsInstaller.dll"/>
    </PayloadGroup>
</Fragment>

<Fragment>
    <PackageGroup Id="InstallerPackages">
        <!-- <MsiPackage Id="CRMInstall" 
                         Vital="yes"  
                         Name="Packages\SetupProject1.msi" 
                         SourceFile="Packages\SetupProject1.msi" 
                         DisplayInternalUI="yes"> -->
        <MsiPackage Id="CRMInstall" 
                    Vital="yes"  
                    Name="Packages\StandardSetup.msi"
                    SourceFile="..\StandardSetup\bin\Release\StandardSetup.msi"
                    DisplayInternalUI="yes">
        </MsiPackage>
    </PackageGroup>
</Fragment>
..
..

Upvotes: 1

Views: 1458

Answers (1)

Rob Mensching
Rob Mensching

Reputation: 35901

When you call Engine.Apply() make sure you pass the handle to the WPF Window that is being displayed. It should go something like:

var mainWindowHandle= new WindowInteropHelper(mainWindow).EnsureHandle();
Engine.Apply(mainWindowHandle);

Where mainWindow is class that inherits from the WPF Window class.

Upvotes: 1

Related Questions