WIX Uninstall an EXE Package - wix

I am working on a wix installer that Installs WebView2. I have this working. However, when I uninstall WebView2 is left on my system. How do I remove the WebView2 when the uninstaller is ran?
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" >
<Bundle Name="Build.Bootstrap.Installer" Version="1.0.0.0" Manufacturer="Company Name" UpgradeCode="GUID">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense"/>
<Chain>
<ExePackage Id="InvokeBootstrapper" Name="Install WebView2 Runtime" Cache="no" Compressed="no"
PerMachine="yes" Vital="yes" SourceFile="MicrosoftEdgeWebview2Setup.exe"
InstallCommand=" /silent /install" InstallCondition="NOT (REMOVE OR WVRTInstalled)" />
<!-- TODO: Define the list of chained packages. -->
<!-- <MsiPackage SourceFile="path\to\your.msi" /> -->
</Chain>
</Bundle>
</Wix>

Related

how to check condtiotion for version check in bootstraper (wix)?

I am using bootstraper to install VC++ and .net framework,
<?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="Engage" Version="1.0.0.0" Manufacturer="my Corporation" UpgradeCode="d7d559b1-3388-4275-91e2-d8d44d2f02db">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<Chain>
<!-- TODO: Define the list of chained packages. -->
<PackageGroupRef Id="Netfx45FullPackage" />
</Chain>
</Bundle>
<Fragment>
<PackageGroup Id="Netfx45FullPackage">
<ExePackage Id="Netfx45Xxx" Cache="no" Compressed="no" PerMachine="yes" Permanent="yes" Vital="no" InstallCommand="/q" SourceFile=".\NDP452-x86-x64ENU.exe" />
<ExePackage Id="VC2013" Cache="no" Compressed="no" PerMachine="yes" Permanent="yes" Vital="no" InstallCommand="/q" SourceFile=".\vcredist_x862013.exe" />
<MsiPackage Id="MyProg" Cache="no" Compressed="no" DisplayInternalUI="yes" Vital="yes" SourceFile="D:\Projects\Crimson\engage.client\EngageSetupCreator\bin\Debug\EngageSetupCreator.msi" />
</PackageGroup>
</Fragment>
</Wix>
currently iam installing those two without checking any condition, what should I do to check if the same version for vc++ and .netframework exist, and if exist skip the installation ?
no need to install again if already exists.
You need to add detect condition and use registry search to get the installed version.
For example:
<?define NetFx451MinRelease = 378675 ?>
<util:RegistrySearchRef Id="NETFRAMEWORK45"/>
<ExePackage Id="NetFx451"
...
DetectCondition="NETFRAMEWORK45 >= $(var.NetFx451MinRelease)"
...
>
</ExePackage>
Same for the vc++.

Wix Burn automatically cancelling

I have a very simple Burn bootstrapper that installs the Visual Studio 2015 Redistributable and then runs our application installer (created with Wix). During installation, after installing the redistributable, a dialog pops up automatically that asks if I would like to cancel (i.e., the same thing that would happen if I clicked the Cancel button).
I've created several other installers that use this same pattern and never have seen this problem. Below is the simplified installer with some identifying information removed:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
<?define ProductVersion = "1.0"?>
<?define Manufacturer = "XXXX, Inc."?>
<?if $(var.Platform) = x64 ?>
<?define VCRedistExe = "vc_redist.x64.exe"?>
<?else?>
<?define VCRedistExe = "vc_redist.x86.exe"?>
<?endif?>
<Bundle Name="$(var.ProductName)" Version="$(var.ProductVersion)" Manufacturer="$(var.Manufacturer)" UpgradeCode="$(var.UpgradeCode)" Condition="VersionNT >= v6.0">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" >
<bal:WixStandardBootstrapperApplication LicenseFile="$(var.AssetsPath)\License.rtf" SuppressOptionsUI="yes"/>
</BootstrapperApplicationRef>
<Chain>
<PackageGroupRef Id="redist"/>
<MsiPackage SourceFile="$(var.MsiPath)" DisplayInternalUI="no"/>
</Chain>
</Bundle>
<Fragment>
<PackageGroup Id="redist_vc140">
<ExePackage Id="vc140" DisplayName="Visual C++ 2015 Redistributable" Cache="no" PerMachine="yes" Permanent="yes" Vital="yes" Compressed="yes" SourceFile="resources/$(var.VCRedistExe)" InstallCommand="/install /quiet /norestart" Protocol="burn">
<ExitCode Value="3010" Behavior="forceReboot"/>
<!-- Ignore "Newer version installed" error -->
<ExitCode Value="1638" Behavior="success"/>
</ExePackage>
</PackageGroup>
</Fragment>
<Fragment>
<PackageGroup Id="redist">
<PackageGroupRef Id="redist_vc140"/>
</PackageGroup>
</Fragment>
</Wix>
I believe you should remove the following exit code, as it is not necessary for installing your packages. Possibly conflicting with your bootstrapper installation.
<ExitCode Value="3010" Behavior="forceReboot"/>
Hope this helps you!

WiX Bundle: Patches for 1.0.0 are not removed from Programs & Features when bundle 2.0.0 is installed

There are 3 bundles, code is listed below. 1.0.0, 1.0.0.1, and 2.0.0.
If 1.0.0, 1.0.0.1, and 2.0.0 are installed, View Installed Updates will still have 1.0.0.1 listed as installed. It will remain there until the last Version is uninstalled.
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle Name="Burn Installer" Version="1.0.0" Manufacturer="LANSA" UpgradeCode="AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA" Copyright="..." AboutUrl="...">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<Chain>
<MsiPackage Id="MainPackage" SourceFile="TESTLIST_v1.0.0_en-us.msi" Vital="yes" DisplayInternalUI="yes" />
</Chain>
</Bundle>
</Wix>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle Name="Patch 1.0.0.1" ParentName="Burn Installer" Version="1.0.0.1" Manufacturer="LANSA" UpgradeCode="AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA" Copyright="..." AboutUrl="...">
<RelatedBundle Id="AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA" Action="Patch"/>
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<Chain>
<MspPackage Id="Patch" SourceFile="TESTLIST_v1.0.0.1_en-us.msp" Vital="yes" DisplayInternalUI="no" PerMachine="yes" Permanent="no"/>
</Chain>
</Bundle>
</Wix>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle Name="Burn Installer" Version="2.0.0" Manufacturer="LANSA" UpgradeCode="AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA" Copyright="..." AboutUrl="...">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<Chain>
<MsiPackage Id="MainPackage" SourceFile="TESTLIST_v2.0.0_en-us.msi" Vital="yes" DisplayInternalUI="yes" />
</Chain>
</Bundle>
</Wix>
When an Upgrade is applied, all prior Versions and Patches should be delisted from Programs and Features and/or View Installed Updates. Exactly the same as does occur when the MSI/MSP are directly installed rather than through the Bundler.
The answer for WiX 3.9 and later is as follows...
In Major Upgrade bundles the UpgradeCode must match. "AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA" in the example below.
In Patch Bundles the Upgrade Code must be unique, unrelated to any other GUID used in any bundle. "CCCCCCCC-CCCC-CCCC-CCCC-CCCCCCCCCCCC" in the example.
In the Major Upgrade bundles the RelatedBundle must be unique. This GUID is used in all the patches for that Major Upgrade. "BBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB" in the example.
These settings also ensure that the Major Upgrades are listed in Programs and Features and the patches are listed in View Installed Updates.
<Bundle Version="1.0.0" UpgradeCode="AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA">
<RelatedBundle Id="BBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB" Action="Detect" />
</Bundle>
<Bundle Version="1.0.0.1" UpgradeCode="CCCCCCCC-CCCC-CCCC-CCCC-CCCCCCCCCCCC">
<RelatedBundle Id="BBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB" Action="Patch" />
</Bundle>
<Bundle Version="2.0.0" UpgradeCode="AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA">
<RelatedBundle Id="DDDDDDDD-DDDD-DDDD-DDDD-DDDDDDDDDDDD" Action="Detect" />
</Bundle>

Wix-downgrade option is not working even when i set "yes" in Major upgrade tag

Please see below bundle file
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle Name="Boot_Demo" Version="2.0.0" Manufacturer="Demo-Product" UpgradeCode="{8B19CAE6-59BD-4001-958B-9D2E9F9A1B4D}">
<Chain>
<!-- TODO: Define the list of chained packages. -->
<!-- <MsiPackage SourceFile="path\to\your.msi" /> -->
<MsiPackage SourceFile="D:\Jayesh\TestProjects\Demo-Product\Demo-Product\bin\Debug\Demo-Product.msi"
DisplayInternalUI="yes"
Visible="yes"
ForcePerMachine="yes"
Permanent="no"
Vital="yes"
EnableFeatureSelection="yes"
>
</MsiPackage>
</Chain>
</Bundle>
</Wix>
am getting same error while downgrading with different versions .
am used first 2.0.0 in bundle file and product.wxs file. Then I have given 1.0.0.

Merging two msi using wix toolset

How to merge two msi using wixedit, presently they are having 4.0 version of wixtoolset. In the documentation they have mentioned that merging two msi in windows is possible using bundles and chain tags. But whenver I try to do it, it always show some error. Please let me know any example of wix tool set to merge two msi using bundle and chain tags.
I am following Bootstrapper method as provided in pdf of wix 3.6. To bundle two msi using chain element.
<?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="Prog" Version="0.0.0.1" Manufacturer="my Corporation" UpgradeCode="f380ae43-5df1-4cfe-9297-526e3e333e99">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense">
<bal:WixStandardBootstrapperApplication LicenseFile="..\license.rtf" />
</BootstrapperApplicationRef>
<Chain>
<!-- TODO: Define the list of chained packages. -->
<PackageGroupRef Id="Netfx45FullPackage" />
</Chain>
</Bundle>
<Fragment>
<PackageGroup Id="Netfx45FullPackage">
<MsiPackage Id="Prog" Cache="no" Compressed="no" DisplayInternalUI="yes" Vital="yes" SourceFile="$(var.installerPath)\Prog.msi" />
<MsiPackage Id="Prog2" Cache="no" Compressed="no" DisplayInternalUI="yes" Vital="yes" SourceFile="$(var.installerPath)\Prog2.msi" />
</PackageGroup>
</Fragment>
</Wix>
you can add the variable installerPath