how to manually purge an malformed wix-burn package?
Asked Answered
T

2

9

I am in the process of learning how to develop a custom managed bootstrapper for wix-burn. Up to my knowlege there are no official tutorials, unofficial tutorials are always filled with WPF stuff which I'm not interested in and most people on forums do not do much more than saying that you must create a class that inherits from BootstrapperApplication and overrides the Run() method.

I did that, created the config file, added the payloads to the xml markup. The resulting installer did nothing, actually it ran forever, only killing it stopped it. I sincerely expected that calling base.Run() would give me some basic default GUI-less behavior. But that is only an abstract method. Eventually I learned that I must call some Engine.functions() to actually do some work. So I wrote this to test:

protected override void Run()
{
    Engine.Detect();
    Engine.Plan(LaunchAction.Install);
    Engine.Apply(IntPtr.Zero);
    Engine.Quit(0);
}

I successfully compiled a package that actually installed, the problem is that it can not be uninstalled. My question is, what can I do to purge it from my system? What registry keys must I erase, what cached packages must I delete, and what else must I do to get rid of it?

Thereupon answered 30/9, 2015 at 21:46 Comment(0)
C
1

First, the registry key will be in one of the two locations listed below -- and it's probably the first one since the second is for 32-bit applications installed on a 64-bit OS.

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
  • HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninst‌​all

Second, you can use the registry key to determine where the executable is cached for uninstall, which is probably in a folder that looks like C:\ProgramData\Package Cache.

If this were an .msi installation, there's another registry key and the file is cached in a different location as mentioned here.

Other links:

Cleliaclellan answered 11/3, 2016 at 1:17 Comment(0)
D
0

Ufff, you've got yourself into a hell. :) I'll help you as much as I can.

How did you installed that package?

dlls that you can find interesting:

  • BootstrapperCore.dll (included with the WiX SDK)
  • Microsoft.Deployment.WindowsInstaller.dll (included with the WiX SDK)
  • WindowsBase.dll (for threading)

And, one of XML files should be like this, so you can see what exactly is up there.

<?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">
  <Bundle Name="My Test Application" Version="1.0.0.0" Manufacturer="Bryan" UpgradeCode="PUT-GUID-HERE">
    <BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost">
      <Payload SourceFile="..\TestBA\BootstrapperCore.config"/>
      <Payload SourceFile="..\TestBA\bin\Release\TestBA.dll"/>
      <Payload SourceFile="..\TestBA\bin\Release\GalaSoft.MvvmLight.WPF4.dll"/>
      <Payload SourceFile="C:\Program Files\WiX Toolset v3.6\SDK\Microsoft.Deployment.WindowsInstaller.dll"/>
    </BootstrapperApplicationRef>
    <Chain>
      <PackageGroupRef Id='Netfx4Full' />
      <MsiPackage SourceFile="..\DummyInstaller\bin\Release\DummyInstaller.msi" Id="DummyInstallationPackageId" Cache="yes" Visible="no"/>
    </Chain>
  </Bundle>
  <Fragment>
    <!-- Managed bootstrapper requires .NET as a dependency, since it was written in .NET.
       WiX provides a Bootstrapper for the bootstrapper. The fragment below includes .NET.
       For more information or examples see Heath Stewart's blog or the WiX source:
       http://blogs.msdn.com/b/heaths/archive/2011/10/28/introducing-managed-bootstrapper-applications.aspx
       -->
    <WixVariable Id="WixMbaPrereqPackageId" Value="Netfx4Full" />
    <WixVariable Id="WixMbaPrereqLicenseUrl" Value="NetfxLicense.rtf" />
    <util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Version" Variable="Netfx4FullVersion" />
    <util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Version" Variable="Netfx4x64FullVersion" Win64="yes" />
    <PackageGroup Id="Netfx4Full">
      <ExePackage Id="Netfx4Full" Cache="no" Compressed="yes" PerMachine="yes" Permanent="yes" Vital="yes"
                  SourceFile="C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\DotNetFX40\dotNetFx40_Full_x86_x64.exe"
                  DownloadUrl="http://go.microsoft.com/fwlink/?LinkId=164193"
                  DetectCondition="Netfx4FullVersion AND (NOT VersionNT64 OR Netfx4x64FullVersion)" />
    </PackageGroup>
  </Fragment>
</Wix>

Note: your registry search and conditions are a little different from what is used in the WiX toolset to detect NETFX. The following is the detection for NETFX the WiX toolset uses:

<util:RegistrySearch
    Id="NETFRAMEWORK40"
    Variable="NETFRAMEWORK40"
    Root="HKLM"
    Key="SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full"
    Value="Install"
    Result="value" />

Next solution can be this:

Include a PackageGroupRef element in your Chain:

<Bundle>
    <Chain>
        <PackageGroupRef Id="NetFx452" />        
        <MsiPackage ... />
    </Chain>
</Bundle>

Download the Microsoft .NET Framework 4.5.2 (Offline Installer), and add it to your Bootstrapper Project. (I put it in a folder called "Resource".)

Add the following Fragment:

<Fragment>
    <util:RegistrySearchRef Id="NETFRAMEWORK45"/>
    <PackageGroup Id="NetFx452">
        <ExePackage Id="NetFx452"
                    Cache="no"
                    Compressed="yes"
                    PerMachine="yes"
                    Permanent="yes"
                    Vital="yes"
                    Name="NDP452-KB2901907-x86-x64-AllOS-ENU.exe"
                    SourceFile="Resource\NDP452-KB2901907-x86-x64-AllOS-ENU.exe"
                    DetectCondition="NETFRAMEWORK45"
                    InstallCommand="/q /norestart"  />     
    </PackageGroup>
</Fragment>
Darrondarrow answered 15/10, 2015 at 8:37 Comment(2)
I appreciate your help, but it is actually not an answer to my questionThereupon
I had similar issue so i tried to represent my solution. sry that this wasn't helpful.Darrondarrow

© 2022 - 2024 — McMap. All rights reserved.