Ryan Thomas
Ryan Thomas

Reputation: 2002

WiX Bootstrapper Show Error when MSI Fails

I am using Wix Toolset v3.11 and have a created a Bootstrapper using the WixStandardBootstrapperApplication. This is very simple and chains together my .msi and an .msi of a dependent product.

<Chain>
<MsiPackage SourceFile="$(var.MySetupProject.TargetPath)" Id="MyId" Vital="yes">
    <MsiProperty Name="INSTALLFOLDER" Value="[InstallFolder]" />
</MsiPackage>

<MsiPackage Visible="yes" DisplayName="Dependency (64-bit)"
              DownloadUrl="https://myDownloadUrl/Dependency-64.msi"
              SourceFile="..\Dependency-64.msi"
              Compressed="no"
              InstallCondition="VersionNT64"/>
<MsiPackage Visible="yes" DisplayName="Dependency (32-bit)"
              DownloadUrl="https://myDownloadUrl/Dependency-32.msi"
              SourceFile="..\Dependency-32.msi"
              Compressed="no"
              InstallCondition="NOT VersionNT64"/>
</Chain>

In the .msi for my product I have created some versioning conditions that display an error dialog if it is matched using a custom action.

<Upgrade Id="PUT-GUID-HERE">
  <UpgradeVersion OnlyDetect="yes" Property="SELFFOUND" Minimum="!(bind.FileVersion.MainEXE)" IncludeMinimum="yes" Maximum="!(bind.FileVersion.MainEXE)" IncludeMaximum="yes" />
  <UpgradeVersion OnlyDetect="yes" Property="NEWERFOUND" Minimum="!(bind.FileVersion.MainEXE)" IncludeMinimum="no" />
  <UpgradeVersion OnlyDetect="yes" Property="PREVFOUND_IA" Minimum="1.0.0.0" IncludeMinimum="yes" Maximum="4.11.7312.0" IncludeMaximum="yes" />
  <UpgradeVersion OnlyDetect="no" Property="PREVIOUSFOUND" Minimum="4.11.7313.0" IncludeMinimum="yes" Maximum="!(bind.FileVersion.MainEXE)" IncludeMaximum="no" />
</Upgrade>

<CustomAction Id="UninstallOldAlert" Error="[ProductName] is already installed. Please remove via Add/Remove Programs first." />
<CustomAction Id="AlreadyUpdated" Error="[ProductName] is already installed." />
<CustomAction Id="NoDowngrade" Error="A later version of [ProductName] is already installed." />

<InstallExecuteSequence>
  <RemoveExistingProducts After="InstallInitialize">PREVIOUSFOUND</RemoveExistingProducts>
  <Custom Action="UninstallOldAlert" After="FindRelatedProducts">PREVFOUND_IA</Custom>
  <Custom Action="AlreadyUpdated" After="FindRelatedProducts">SELFFOUND</Custom>
  <Custom Action="NoDowngrade" After="FindRelatedProducts">NEWERFOUND</Custom>
</InstallExecuteSequence>

If I run just the .msi it displays the error message correctly and closes, however when I run the bootstrapper it just skips over and installs the dependencies. What I want to happen is to the pass the error up to the bootstrapper but I can't seem to find any instructions on how to do this? I have tried setting the DisplayInternalUI on the package in the bundle but this has no effect.

The message I see when running the .msi and want to see in the bootstrapper is the CustomAction called "UninstallOldAlert"

Happy to provide more information if required, thanks in advance.

UPDATE:

I have also tried using the Condition element in my Product element, but this has the same behaviour, where by it passes up a success to the bootstrapper. :(

Upvotes: 0

Views: 336

Answers (1)

Bob Arnson
Bob Arnson

Reputation: 21896

Burn won't run obsolete packages. You can verify that in the bundle log to see what Burn detected and planned for your package.

Upvotes: 0

Related Questions