无法使用自定义WiX安装程序卸载

时间:2015-07-23 22:17:29

标签: wpf wix windows-installer uninstaller

我使用ManagedBootstrapperApplicationHost使用WPF前端(使用WiX 3.9)创建了自定义WiX刻录安装程序。

我的MSI安装正常。我使用mBootstrapperApplication.Engine.Detect();来确定MSI包是否存在。如果是,我遵循类似于安装的流程,以便卸载:

mBootstrapperApplication.Engine.Plan(LaunchAction.Uninstall);

一旦进入PlanComplete事件和Status == 0,我就会致电mBootstrapperApplication.Engine.Apply(System.IntPtr.Zero);并最终返回ApplyComplete Status == 0事件。

不幸的是,在那一点似乎没有发生任何事情。

我迷上ExecuteMsiMessage并且没有消息传来。当ExecuteBegin被触发时,PackageCount为0,我相信它应为1。

如有必要,我可以发布代码。我的wxs文件如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
  <Bundle Name="CustomInstallBootstrapper" Version="1.0.0.0" Manufacturer="Square Enix Ltd." UpgradeCode="33CA185D-083B-4D45-A0AE-693C2E09C5F0">
    <BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost">
        <Payload SourceFile="D:\Project\CustomInstallBootstrapper\BootstrapperCore.config"/>
        <Payload SourceFile="D:\Project\CustomInstallBootstrapper\CustomInstallBootstrapper.dll"/>
    </BootstrapperApplicationRef>

    <WixVariable Id="WixMbaPrereqPackageId" Value="ignore" />
    <WixVariable Id="WixMbaPrereqLicenseUrl" Value="ignore" />

    <Chain>
        <PackageGroupRef Id="NetFx451Redist"/>
        <MsiPackage Id="LauncherMSI" SourceFile="D:\Project\Launcher.msi" Cache="yes" Visible="no">
        </MsiPackage>
    </Chain>
  </Bundle>
</Wix> 

如果我自己运行MSI,我可以毫无问题地安装和卸载它。

0 个答案:

没有答案