WiX 引导程序 WPF 自定义 UI



我从这里阅读并运行示例。

一些问题:

  1. 如何在安装/卸载/删除过程中获取操作名称?
  2. 如何将变量和参数传递给嵌入式 MSI?
  3. 有没有办法从嵌入式MSI(产品版本,公司名称等)中获取其他信息,就像在WixSharp(WpfSetup示例)中所做的那样?

4. 如何从MSI文件INSTALLFOLDER,TARGETDIR和其他值中获取(设置)?

  1. 我不确定你能不能。 Microsoft.Tools.WindowsInstallerXml.Bootstrapper.BootstrapperApplication会告诉您它正在计划或执行的 MSI 包,您还可以获取有关它正在执行的安装操作的信息,检查在安装过程中由此引发的事件。

阿拉伯数字。

在引导器 WPF 应用中

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

捆绑.wxs

<!-- Install paths provided by the managed bootstrapper interface -->
<Variable Name="ServerInstallLoc" bal:Overridable="yes" Type="string" Value=""></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. 在引导程序中,可以引用捆绑安装程序的属性。 语法为:!(bind.packageVersion.PackageName)假设您的<MsiPackage>元素之一称为 PackageName。活页夹变量参考

对于问题 4,请看这个:http://www.wrightfully.com/allowing-the-user-to-select-the-install-folder/

您还可以查看Wix托管引导程序,因为我相信它也可以做到这一点。 您可以在此处下载源代码:https://github.com/wixtoolset/wix3

最新更新