Wix Bootstrapper 不会打开 wpf ui

Wix Bootstrapper will not open wpf ui

我一直在尝试为将我们公司的多个 msis 链接在一起的 WiX 安装程序编写 WPF UI。

我已经按照 This Link 这样做了,但是,我根本无法打开 ui 应用程序 tp。

我已经获取到 运行 MyBootstrapper.exe 文件的命令行并将日志保存到桌面。

[1CAC:1CB0][2020-08-06T08:31:55]i001: Burn v3.11.2.4516, Windows v10.0 (Build 18362: Service Pack 0),

path: C:\Users\james\AppData\Local\Temp\{75974D4E-F6FC-4A63-8B17-9C40D549A877}\.cr\MyBootstrapper.exe
[1CAC:1CB0][2020-08-06T08:31:55]i009: Command Line: '-burn.clean.room=C:\Users\james\Desktop\MyBootstrapper.exe -burn.filehandle.attached=632 -burn.filehandle.self=688 -l log.log'
[1CAC:1CB0][2020-08-06T08:31:55]i000: Setting string variable 'WixBundleOriginalSource' to value 'C:\Users\james\Desktop\MyBootstrapper.exe'
[1CAC:1CB0][2020-08-06T08:31:55]i000: Setting string variable 'WixBundleOriginalSourceFolder' to value 'C:\Users\james\Desktop\'
[1CAC:1CB0][2020-08-06T08:31:55]i000: Setting string variable 'WixBundleLog' to value 'C:\Users\james\Desktop\log.log'
[1CAC:1CB0][2020-08-06T08:31:55]i000: Setting string variable 'WixBundleName' to value 'MyBootstrapper'
[1CAC:1CB0][2020-08-06T08:31:55]i000: Setting string variable 'WixBundleManufacturer' to value 'James'
[1CAC:1CB0][2020-08-06T08:31:55]i000: Loading managed bootstrapper application.
[1CAC:1CB0][2020-08-06T08:31:56]e000: Error 0x80131508: Failed to create the managed bootstrapper application.
[1CAC:1CB0][2020-08-06T08:31:56]e000: Error 0x80131508: Failed to create UX.
[1CAC:1CB0][2020-08-06T08:31:56]e000: Error 0x80131508: Failed to load UX.
[1CAC:1CB0][2020-08-06T08:31:56]e000: Error 0x80131508: Failed while running 
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleAction = 5
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleElevated = 0
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleLog = C:\Users\james\Desktop\log.log
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleManufacturer = James
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleName = MyBootstrapper
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleOriginalSource = C:\Users\james\Desktop\MyBootstrapper.exe
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleOriginalSourceFolder = C:\Users\james\Desktop\
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleProviderKey = {3d87621d-9ee8-4412-843e-67b7d5da8dd5}
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleSourceProcessFolder = C:\Users\james\Desktop\
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleSourceProcessPath = C:\Users\james\Desktop\MyBootstrapper.exe
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleTag = 
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleUILevel = 4
[1CAC:1CB0][2020-08-06T08:31:56]i410: Variable: WixBundleVersion = 1.0.0.0
[1CAC:1CB0][2020-08-06T08:31:56]e000: Error 0x80131508: Failed to run per-user mode.
[1CAC:1CB0][2020-08-06T08:31:56]i007: Exit code: 0x80131508, restarting: No

我不明白的是为什么它从不尝试打开 WixBootstrapper.Run 方法。我知道这是因为,第一行我有一条日志消息,上面写着 Engine.Log(LogLevel.Verbose, "Starting Custom UI");

所以我假设这必须在看起来像的 Bundle.wxs 文件中。

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Bundle Name="MyBootstrapper" Version="1.0.0.0" Manufacturer="James" UpgradeCode="c59306b1-bc3d-4aa0-9936-53f2a3484343">
    <BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost" >
      <Payload SourceFile="$(var.InstallerUI.TargetDir)BootstrapperCore.config"/>
      <Payload SourceFile="$(var.InstallerUI.TargetDir)InstallerUI.dll"/>
      <Payload SourceFile="C:\Program Files (x86)\WiX Toolset v3.11\bin\Microsoft.Deployment.WindowsInstaller.dll"/>
    </BootstrapperApplicationRef>

    <WixVariable Id="WixMbaPrereqLicenseUrl" Value="Netfx45Full"/>
    <WixVariable Id="WixMbaPrereqPackageId" Value="NetFxLicense.rtf"/>

        <Chain>
      <MsiPackage Id="WPFInstaller" SourceFile="$(var.Installer.TargetPath)" />
        </Chain>
    </Bundle>
</Wix>

关于我的问题,谁能解释一下我做错了什么,以及为什么这不能在 cs 中打开引导程序 class?

此外,我已经提取了 MyBootstrapper.exe 文件,我的所有依赖项都在其中。

我能够克服它现在尝试安装应用程序的这一点,它仍然没有打开 WPF UI,但它现在至少尝试了。

我不得不从

更改BootstrapperCore.config
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" />
  </startup>

  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.5" />
  </startup>