私はWixブートストラップに取り組んでいますが、私が見つけてこのチュートリアルに従っているカスタムUIが必要です。https://medium.com/@rukshandangalla/how-i-created-custom-ui-using-wpf-mvvm-and-prism-for-wix-installer-5055c2b611e2 しかし、それは不完全であり、カスタムUIをブートストラップにリンクする方法を示していません.Visual Studioの参照として、バンドルのペイロードとして追加しようとしましたが、これが正しい方法であるかどうかはわかりません。
Visual Studioでビルドしようとすると、次のエラーが表示されます
Either 'Microsoft.Tools.WindowsInstallerXml.AssemblyDefaultWixExtensionAttribute' was not defined or the type defined in extension '..\Setup\bin\Debug\PETSetup.dll' could not be loaded.
これは私のバンドルです
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Bundle Name="Abundle name" Version="2.0.1" Manufacturer="manu" Condition="VersionNT64" UpgradeCode="254822db-8638-44bc-8815-95d0506b5145" IconSourceFile="X:\SS\Wix Installer\icon.ico">
<BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost">
<Payload SourceFile="X:\SS\Wix Installer\Setup\bin\Debug\BootstrapperCore.config"/>
<Payload SourceFile="X:\SS\Wix Installer\Setup\bin\Debug\PETSetup.dll"/>
<Payload SourceFile="C:\Program Files (x86)\WiX Toolset v3.11\SDK\Microsoft.Deployment.WindowsInstaller.dll"/>
</BootstrapperApplicationRef>
<WixVariable Id="WixMbaPrereqPackageId" Value="Netfx4Full" />
<WixVariable Id="WixMbaPrereqLicenseUrl" Value="X:\SS\Wix Installer\eula.rtf" />
<bal:Condition Message="You need to install .Net Framework 4.0 or higher in order to run this install">
<![CDATA[Netfx4FullVersion]]>
</bal:Condition>
<Chain>
<ExePackage Vital="yes" Permanent="yes" Cache="yes" SourceFile="X:\SS\Source\Bin\PrerequistesInstaller.exe"/>
</Chain>
<util:RegistrySearch Id="Net40" Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Version" Variable="Netfx4FullVersion" Result="exists"/>
</Bundle>
</Wix>
これがカスタムUIのメインのcsファイルです
using Microsoft.Tools.WindowsInstallerXml.Bootstrapper;
using PETSetup.Models;
using PETSetup.ViewModels;
using PETSetup.Views;
using System.IO;
using System.Windows.Threading;
namespace PETSetup
{
public class PETSetup : BootstrapperApplication
{
Microsoft.Tools.WindowsInstallerXml.AssemblyDefaultWixExtensionAttribute t = new Microsoft.Tools.WindowsInstallerXml.AssemblyDefaultWixExtensionAttribute(typeof(PETSetup));
public static Dispatcher Dispatcher { get; set; }
protected override void Run()
{
Dispatcher = Dispatcher.CurrentDispatcher;
var model = new BootstrapperApplicationModel(this);
var viewModel = new InstallViewModel(model, Engine);
var view = new InstallView(viewModel);
model.SetWindowHandle(view);
Engine.Detect();
view.Show();
Dispatcher.Run();
Engine.Quit(model.FinalResult);
}
}
}
これを機能させるにはどうすればいいですか?または誰かがより良いステップバイステップのチュートリアルを知っていますか?私が見つけることができる他のものはMsiのものであり、ブートストラップではないからです。
発行0: ここでプロジェクトの設定ファイルを修正する方法を確認してください WiXカスタムブートストラップアプリケーションおよび.NET 4.5
問題1: ブートストラップはwixエンジンによって起動されます 各ステップで、コストゥムブートストラップはメソッドの1つを呼び出してプロセスを返します。たとえば、Engine.Detect()およびEngine.Quit()を呼び出します。 しかし、手を取り戻すには、イベントハンドラーを実装する必要があります。DetectEndsのように作業を行ってから、Planなどのwixに戻ります この例を確認してください https://github.com/rstropek/Samples/tree/master/WiXSamples/CustomBurnUI