gpt4 book ai didi

WiX Burn 自定义用户界面

转载 作者:行者123 更新时间:2023-12-02 07:44:29 27 4
gpt4 key购买 nike

我正在尝试为 WiX 创建自定义 UI和燃烧。我遵循了我发现的一些指南,到目前为止,我有一个项目具有以下内容,它继承自 BootstrapperApplication。

namespace MyBA
{
public class TestBA : BootstrapperApplication
{
protected override void Run()
{
MessageBox.Show("My BA is running");
this.Engine.Quit(0);
}
}
}

在 AssemblyInfo.cs 中:

[assembly: BootstrapperApplication(typeof(TestBA))]

然后在我的 Bootstrapper 项目中我有以下内容。

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">

<Bundle Name="MyApplication"
Version="1.0.0"
Manufacturer="Acme Ltd"
UpgradeCode="F84A4058-FDF6-4218-BCB5-12C811DA3C99"
Condition="NOT ((VersionNT = 600 AND ServicePackLevel >=2) OR (VersionNT >= 601))"
IconSourceFile="$(var.MyApplicationInstallerRequiredFiles.ProjectDir)logo.ico"
SplashScreenSourceFile="$(var.MyApplicationInstallerRequiredFiles.ProjectDir)Splashscreen.bmp"
DisableRepair="no"
DisableRemove="no"
DisableModify="no">

<WixVariable Id="WixMbaPrereqPackageId"
Value="Netfx4Full" />
<WixVariable Id="WixMbaPrereqLicenseUrl"
Value="NetfxLicense.rtf" />

<WixVariable Id="WixStdbaLicenseRtf"
Value="$(var.MyApplicationInstallerRequiredFiles.ProjectDir)Licence.en-gb.rtf" />
<WixVariable Id="WixStdbaLogo"
Value="$(var.MyApplicationInstallerRequiredFiles.ProjectDir)logoInstallSmall.bmp" />

<BootstrapperApplicationRef Id='ManagedBootstrapperApplicationHost'>
<Payload Name='BootstrapperCore.config'
SourceFile='$(var.MyApplicationInstallerRequiredFiles.ProjectDir)Bootstrapper\MyBA.BootstrapperCore.config' />
<Payload SourceFile='$(var.MyApplicationInstallerRequiredFiles.ProjectDir)Bootstrapper\MyBA.dll' />
</BootstrapperApplicationRef>

<Chain>
<PackageGroupRef Id="MyApplicationPackage" />
</Chain>
</Bundle>
</Wix>

并且我添加了 MyBA.BootstrapperCore.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="wix.bootstrapper"
type="Microsoft.Tools.WindowsInstallerXml.Bootstrapper.BootstrapperSectionGroup, BootstrapperCore">
<section name="host"
type="Microsoft.Tools.WindowsInstallerXml.Bootstrapper.HostSection, BootstrapperCore" />
</sectionGroup>
</configSections>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" />
</startup>
<wix.bootstrapper>
<host assemblyName="MyBA">
<supportedFramework version="v4\Full" />
<supportedFramework version="v4\Client" />
</host>
</wix.bootstrapper>
</configuration>

但是,每当我为 Bootstrap 运行 Setup.exe 时,我都会短暂地出现闪屏,但没有别的。如果我查看日志中的 %TEMP%,则有以下内容

[0A00:0424][2011-11-02T15:52:08]: Burn v3.6.2221.0, path: C:\MyApplication\dev\source\Bootstrapper1\bin\Debug\Setup.exe, cmdline: ''
[0A00:0424][2011-11-02T15:52:08]: Setting string variable 'WixBundleName' to value 'MyApplication'
[0A00:0424][2011-11-02T15:52:08]: Setting string variable 'WixBundleLog' to value 'C:\Users\AppData\Local\Temp\MyApplication_20111102155208.log'
[0A00:0424][2011-11-02T15:52:08]: Condition 'NOT ((VersionNT = 600 AND ServicePackLevel >=2) OR (VersionNT >= 601))' evaluates to true.
[0A00:0424][2011-11-02T15:52:08]: Setting string variable 'WixBundleOriginalSource' to value 'C:\MyApplication\dev\source\Bootstrapper1\bin\Debug\Setup.exe'
[0A00:0424][2011-11-02T15:52:08]: Loading managed bootstrapper application.
[0A00:0424][2011-11-02T15:52:08]: Error 0x80131040: Failed to create the managed bootstrapper application.
[0A00:0424][2011-11-02T15:52:08]: Error 0x80131040: Failed to create UX.
[0A00:0424][2011-11-02T15:52:08]: Error 0x80131040: Failed to load UX.
[0A00:0424][2011-11-02T15:52:08]: Error 0x80131040: Failed while running
[0A00:0424][2011-11-02T15:52:08]: Error 0x80131040: Failed to run per-user mode.

为什么会出现这种情况,为什么会出现上述错误?

最佳答案

如果您查看 WixBA 的源代码,它们会声明一个全局 Threading.Dispatcher,然后在重写的 Run() 方法中,有以下行:

Threading.Dispatcher.Run();

我遇到了类似的问题,同样将 Threading.Dispatcher 添加到我的 Bootstrap 应用程序中解决了这些问题。

此外,如果您的 Bootstrapper 应用程序依赖于任何其他 dll,您需要将它们包含为 <Payload/>在你的<BootstrapperApplicationRef/>下.

关于WiX Burn 自定义用户界面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7983683/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com