0

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?

ZedZip
  • 5,794
  • 15
  • 66
  • 119

2 Answers2

2
  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
Patrick Allwood
  • 1,822
  • 17
  • 21
  • Sorry - this is all Wix rather than Wix#. – Patrick Allwood Feb 01 '16 at 14:31
  • Its ok, we are talking about WiX. How I can read msi file from WixAttachedContainer in my c# Bootstrapper UI? – ZedZip Feb 01 '16 at 16:04
  • I'm not familiar with this, if you're having an error it might be worth asking a separate question. Previously I've used `ba.Engine.Plan(LaunchAction.Install)` and then `Engine.Apply()` in the PlanComplete event, and the bootstrapper engine handles extraction for you. – Patrick Allwood Feb 01 '16 at 16:41
  • I have added question 4. – ZedZip Feb 01 '16 at 17:23
0

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

Cole W
  • 15,123
  • 6
  • 51
  • 85