WIX Toolset Bundle does not detect package that was just installed - wix3.5

I am creating a super simple bootstrapper project that installs just 1 MSI.
Install works perfectly, but when I do an uninstall from (ARP), the package just installed is not detected, so it is not removed, but the bootstrapper is removed from ARP, making it seem like the product is gone.
I have to run the EXE again, which makes it seem like an install is happening, but when the MSI is executed, it shows the options to change or remove the product (as is expected).
<?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="Bed Occupancy Monitoring"
Version="$(var.PRODUCTVERSION)"
Manufacturer=""
UpgradeCode="4346DC9B-5B4D-4301-A8A6-EE4ED4C001DB">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense">
<bal:WixStandardBootstrapperApplication
LicenseUrl=""
ThemeFile="HyperlinkLargeTheme.xml"
LocalizationFile="HyperlinkTheme.wxl"
LogoFile="Logo.png"
SuppressOptionsUI="yes"
ShowVersion="yes"/>
</BootstrapperApplicationRef>
<Chain>
<MsiPackage Id="BedOccupancy"
SourceFile="$(var.Installer.TargetPath)"
DisplayName="Bed Occupancy $(var.PRODUCTVERSION)"
DisplayInternalUI="yes"
Permanent="no"
Visible="no"/>
</Chain>
</Bundle>
</Wix>

Related

Denial of installation WIX Installer

I made a bootstrapper (bootstrapper is an installer that contains other installers to put all together, in this case will be my app and SQL Express database installer). When I start the bootstrapper, the SQL Express installation window is being displayed on the screen and if I close the window, my app is still set, and I need if user closes SQL Express installation window then my program won't be installed.
<?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="Bootstrapper" Version="1.0.0.0" Manufacturer="MyCompany AboutUrl="https://mycompany.ru/"
Copyright="ol raits rezervit" UpgradeCode="1788BF21-18BD-49E8-A572-DD38F9B67A88">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense"/>
<util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Microsoft SQL Server"
Result="exists" Variable="SQLExpressInstalled_x64" Win64="yes"/>
<Chain>
<ExePackage SourceFile="SQL2019-SSEI-Expr.exe" DetectCondition="SQLExpressInstalled_x64" Permanent="no"></ExePackage>
<MsiPackage SourceFile="MyProgram.msi"></MsiPackage>
</Chain>
</Bundle>
</Wix>
Would adding "Vital" be a usable suggestion for you?
I have added this suggestion in your provided code example as the last argument for the ExePackage.
"Vital"
Specifies whether the package must succeed for the chain to continue. The default "yes" indicates that if the package fails then the chain will fail and rollback or stop. If "no" is specified then the chain will continue even if the package reports failure.
<?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="Bootstrapper" Version="1.0.0.0" Manufacturer="MyCompany AboutUrl="https://mycompany.ru/ "Copyright="ol raits rezervit" UpgradeCode="1788BF21-18BD-49E8-A572-DD38F9B67A88">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense"/>
<util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Microsoft SQL Server"
Result="exists" Variable="SQLExpressInstalled_x64" Win64="yes"/>
<Chain>
<ExePackage SourceFile="SQL2019-SSEI-Expr.exe" DetectCondition="SQLExpressInstalled_x64" Permanent="no" Vital="yes"></ExePackage>
<MsiPackage SourceFile="MyProgram.msi"></MsiPackage>
</Chain>
</Bundle>
</Wix>
Ref - https://wixtoolset.org/documentation/manual/v3/xsd/wix/exepackage.html

Wix to remove previous version that was installed with Bootstrapper from control panel

I've got "ABC 10.1" program version installed on computer allready and I would like to remove it on each newer ABC.msi installation (for example when ABC 10.2 is going to be installed).
So far I've used a BOOTSTRAPPER to install new versions and it worked like a charm (the previous version was uninstalled and removed from the control panel and newest was appearing in the control panel).
Right now I would like to use ABC.msi for installation and to not use the BOOTSTRAPPER, but when I use ABC.msi installer the previous one is not being removed from the control panel and I have two "ABCs" 10.1 and 10.2 versions in the control panel.
How can I remove ABC previous version that was installed by BOOTSTRAPPER during newest ABC.msi installation (and avoid duplicating ABC in Control Panel)?
Bundle.wxs
<Bundle
Name="$(var.ProductName)"
Version="$(var.ShowVersion)"
Manufacturer="ABC"
UpgradeCode="33312c8d-64f1-4a04-a98e-4aa692de6aaf"
IconSourceFile="$(var.BaseDir)\Setup\UI\ABC.ico"
Condition="((VersionNT = v6.1 AND ServicePackLevel >= 1) OR (VersionNT > v6.1)) AND (WixBundleInstalled = 0)">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense">
<bal:WixStandardBootstrapperApplication
LicenseFile="$(var.BaseDir)\Setup\UI\License.rtf"
LogoFile="$(var.BaseDir)\Setup\UI\OticonAppIcon.png"
SuppressOptionsUI="yes"
ShowVersion="yes"/>
</BootstrapperApplicationRef>
<Chain>
<!-- Install .Net 4.6.1 -->
<PackageGroupRef Id='NetFx461Redist'/>
<!-- my packages to install -->
<PackageGroupRef Id="InstallerPackages" />
</Chain>
</Bundle>
<Fragment>
<PackageGroup Id ="InstallerPackages" >
<MsiPackage SourceFile="$(var.OutDir)\ABC.MSI" />
<MsiPackage SourceFile="$(var.OutDir)\DatabaseInstallerABC.msi" />
</PackageGroup>
</Fragment>
productABC.wxs (the file that is creating ABC.msi) is as following:
<?xml version="1.0" encoding="UTF-8"?>
<?include .\defines.wxi ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension" xmlns:fire="http://schemas.microsoft.com/wix/FirewallExtension" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Product Id="$(var.ProductCode)"
Codepage="1252" Language="1033"
Manufacturer="ABC" Name="$(var.ProductName)"
UpgradeCode="{3338CE6B-D733-41AF-830B-DCAFE2E0CD58}"
Version="$(var.ProductVersion)">
<Package Id="*"
Compressed="yes"
InstallerVersion="300"
Languages="1033"
Manufacturer="ABC"
Platform="x86" />
<Media Id="1"
Cabinet="media1.cab"
EmbedCab="yes" />
----some directories and components----
<MajorUpgrade
Schedule="afterInstallInitialize"
DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit."
AllowSameVersionUpgrades="yes"/>
<InstallExecuteSequence>
<LaunchConditions After="AppSearch" />
<Custom Action="SetTargetDir" Before="CostFinalize"></Custom>
<Custom Action="SaveTargetDir" After="InstallValidate"></Custom>
</InstallExecuteSequence>
<WixVariable Id="WixUILicenseRtf" Value="$(var.BaseDir)\Setup\UI\License.rtf" />
<WixVariable Id="WixUIBannerBmp" Value="$(var.BaseDir)\Setup\UI\bannrbmp.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="$(var.BaseDir)\Setup\UI\ABCbackground.bmp" />
</Product>
</Wix>
Generic answer: The wix bootstrapper is what writes the entry in the Control Panel for your "ABC 10.1" release. In order to remove that, your 10.2 release will need to have a custom action tell the previous bundle to uninstall itself ("previous-cached-bundle.exe /silent /uninstall" or something similar). Now, whether you tell the old bundle to remove itself first, or you allow your MSI to upgrade first is up to your own requirements.

collision in wix extension: NetFxExtension

I am trying to create a bootstrapper project in Visual Studio 2015 using Wix.
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension"
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
<Bundle Name="..." Version="1.0.0.0" Manufacturer="..." UpgradeCode="...">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense">
<bal:WixStandardBootstrapperApplication LicenseFile="mtel-eula-free.rtf"/>
</BootstrapperApplicationRef>
<BootstrapperApplicationRef Id="WixBootstrapperApplication:WixNetFxExtension" />
<BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost">
<Payload
Name="BootstrapperCore.config"
SourceFile="$(var.TargetDir)\BootstrapperCore.config"/>
<Payload
SourceFile="$(var.TargetPath)"/>
</BootstrapperApplicationRef>
<Chain>
<PackageGroupRef Id="NetFx45Web"/>
<MsiPackage Id="MTESetup" SourceFile="$(var.MTESetup.TargetPath)"/>
</Chain>
</Bundle>
</Wix>
The project name for the bootstrapper is MTEBootstrapper and the project name for the wix project for the MSI is MTESetup. For MTEBootstrapper, I added a reference to WixNetFxExtension.dll from Wix 3.10; In the properties of MTEBootstrapper, I added -ext WixNetFxExtension.dll. Now I am getting this error when I try to build MTEBootstrapper:
Error The extension 'Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxExtension' contains a defintion for table 'NetFxNativeImage' that collides with a previously loaded table definition. Please remove one of the conflicting extensions or rename one of the tables to avoid the collision. MTEBootstrapper light.exe 0
I have no idea what is causing this. How do I fix it?
It looks like this error surfaces when I have both the reference to WixNetFxExtension added to MTEBootstrapper and the -ext option for the linker. I removed the -ext option for the linker and collision error disappeared.
(Separately I am getting an unresolved symbol WixNetFxExtension, which I will file a separate question for.)

wix installer upgrade dialog not displaying, how to prepare?

I have installed msi on client location. Now i need to provide upgrade. When i prepare new msi with new version it is saying product is already installed. How to upgrade product.
Existing product msi(wix) info:
ProductVersion : 0.0.0.1
PackageCode {B3B7B3A9-AF58-41C0-B3BD-F5ED1B5DE914}
UpgradeCode {63B4B483-1851-4F32-BEFA-E7D73C4CE0DE}
ProductCode {1F3EFF43-C480-4956-B076-76437B6313E6}
My wix looks like this.
<?xml version="1.0" encoding="utf-8"?>
<?define ProductVersion = "0.0.0.2"?>
<?define UpgradeCode = "63b4b483-1851-4f32-befa-e7d73c4ce0de"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Product Id="*" Name="Calculator" Language="1033" Version="$(var.ProductVersion)" Manufacturer="ABCD" UpgradeCode="$(var.UpgradeCode)">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<Upgrade Id="$(var.UpgradeCode)">
<!-- Detect older product versions -->
<UpgradeVersion OnlyDetect="no" IncludeMinimum="yes" IncludeMaximum="yes" Minimum="0.0.0.1" Maximum="$(var.ProductVersion)" Property="PREVIOUSVERSIONSINSTALLED" />
<!-- Detect newer product versions -->
<UpgradeVersion OnlyDetect="yes" IncludeMinimum="no" Minimum="$(var.ProductVersion)" Property="NEWERVERSIONDETECTED" />
</Upgrade>
<!-- Exits successfully in the case newer version are already installed -->
<CustomActionRef Id="WixExitEarlyWithSuccess" />
and continues....
Whats wrong in my code. I would like to get upgrade option from this.
It will say the product is already installed if either the ProductCode or the PackageCode of the new MSI is the same as the previous one. It's not clear to me from your post if they have both changed or not.
Also, you won't get an upgrade unless you change something in the first three fields of the ProductVersion. This is the behavior of Windows Installer.
http://msdn.microsoft.com/en-us/library/aa370859(v=vs.85).aspx

Is there a way to make an installer which can install multiple msis downloading from internet?

Just like WiX installer, I wanna distribute a small setup.exe, while installing, the setup.exe can download the demanded msis from a specified server.
If anyone know how to do, code sample is better.
The below codes can be compiled successfully, but the WixBA UI doesn't display.
<?xml version="1.0" encoding="UTF-8"?>
<BootstrapperApplicationRef Id='ManagedBootstrapperApplicationHost'>
<Payload Name='BootstrapperCore.config' SourceFile='WixBA.BootstrapperCore.config' />
<Payload SourceFile='WixBA.dll' />
<Payload SourceFile='License.htm' />
</BootstrapperApplicationRef>
<Variable Name='InstallFolder' Type='string' Value='[ProgramFilesFolder]Test' />
<Chain>
<MsiPackage Id='sevenz' Vital='yes' Name='data\7z.msi' SourceFile='data\7z.msi' >
<MsiProperty Name='INSTALLFOLDER' Value='[InstallFolder]' />
</MsiPackage>
</Chain>
</Bundle>
The WiX toolset supports this using the Burn engine. The source code is all available in src\burn\engine (in particular, you'll want to look at downloadengine.cpp).

Resources