ZedZip
ZedZip

Reputation: 6510

WiX Bootstrapper WPF custom UI

I read and run sample from here.

Some questions:

  1. How I can get actions names during the install/uninstall/remove process?
  2. How I can pass variables and parameters to embedded MSI?
  3. Is any way to get additional information from the embedded MSI (product version, company name etc) as it is done in WixSharp (WpfSetup sample)?

4. How I can get (set) from MSI file INSTALLFOLDER, TARGETDIR and other values?

Upvotes: 0

Views: 2942

Answers (2)

Cole W
Cole W

Reputation: 15313

For question 4 look at this: http://www.wrightfully.com/allowing-the-user-to-select-the-install-folder/

You can also look at the Wix managed bootstrapper as I believe it does this as well. You can download the source code here: https://github.com/wixtoolset/wix3

Upvotes: 0

Patrick Allwood
Patrick Allwood

Reputation: 1832

  1. I'm not sure you can or not. Microsoft.Tools.WindowsInstallerXml.Bootstrapper.BootstrapperApplication will tell you what msi package it is planning or executing, you may also be able to get information about which install action it is executing, check the events that get raised by this during your install process.

2.

In your bootstapper WPF app

//ba is an instance of BootstrapperApplication
this.ba.Engine.StringVariables["ServerInstallLoc"] = "YOUR DATA"

Bundle.wxs

<!-- Install paths provided by the managed bootstrapper interface -->
<Variable Name="ServerInstallLoc" bal:Overridable="yes" Type="string" Value=""></Variable>

And later reference this variable

<MsiPackage Id="MyInstaller" SourceFile="$(var.MyInstallerMsiProjectName.TargetPath)" Compressed="yes" DisplayInternalUI="no">
    <!-- Pass wix bundle variable to MSI property -->
    <MsiProperty Name="SERVER_INSTALL_OVERRIDE" Value="[ServerInstallLoc]"/>
  </MsiPackage>
  1. In your bootstrapper, you can reference properties of the bundled installers. the syntax is: !(bind.packageVersion.PackageName) assuming one of your <MsiPackage> elements is called PackageName. Binder variables reference

Upvotes: 2

Related Questions