Reputation: 6510
I read and run sample from here.
Some questions:
4. How I can get (set) from MSI file INSTALLFOLDER, TARGETDIR and other values?
Upvotes: 0
Views: 2942
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
Reputation: 1832
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>
!(bind.packageVersion.PackageName)
assuming one of your <MsiPackage>
elements is called PackageName. Binder variables referenceUpvotes: 2