Set MsiPackage's as features - wix

I am creating a Wix Installer with wix bootstrapper. Wix setup project gives you the possibility to determine which features to install and which not. I am looking the same thing for MsiPackages on bootstrapper, so I can select which msi packages to install.
<Chain>
<!-- TODO: Define the list of chained packages. -->
<!-- <MsiPackage SourceFile="path\to\your.msi" /> -->
<MsiPackage SourceFile="..\APP1\Wix1WindowsFormsApplication1.msi"/>
<MsiPackage SourceFile="..\APP2\Wix2WindowsFormApplication2.msi"/>
</Chain>

This can be done in a custom bootstrapper application in which you have PlanPackageBegin event where you can select which msi packages to install. But this is not easy.
With standard bootstrapper application there is a very limited capability to define checkboxes on the Options dialog and use selection of checkboxes to select which packages to install, as discussed here: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Bootstrapper-Custom-UI-Checkbox-to-customize-install-td7596905.html

Related

Wix Toolset: Skip success dialog in StdBA

I am using WixStandardBootstrapperApplication in bundle
It will install .NET 4.8 and one MSI package, Can find code below,
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense">
<bal:WixStandardBootstrapperApplication
ThemeFile="theme.xml"
SuppressOptionsUI="yes"
LicenseUrl=""/>
</BootstrapperApplicationRef>
<Chain DisableRollback="yes">
<PackageGroupRef Id="NetFx48Web"/>
<MsiPackage Id="myMBS"
SourceFile="$(var.Mbs.Updater.TargetPath)"
DisplayInternalUI="yes"/>
</Chain>
Inside that MSI package we have Custom Action to LaunchApplication after InstallFinalize
<InstallExecuteSequence>
<Custom Action="LaunchApplication" After="InstallFinalize" />
</InstallExecuteSequence>
So we don't need to StdBAs bundle to show Success Dialog, How to skip that
I have researched but didint find any workable solution
The WixInternalUIBootstrapperApplication was added in v4.0-preview.1 for this scenario where the bundle has 0-n prerequisites and one main MSI. If the prereqs don't need to be installed then only the splash screen and MSI UI will be shown. Otherwise, the prereq BA shows its UI while installing the prereqs and then closes before showing the MSI UI.
I conclude it is not possible in StdBA
The default UI dialog will come throughout the installation process in StdBA. So skipping the page is not possible yet. Still if needed means then custom BA will help achieve that. I am not tried it yet
Supporting link
https://stackoverflow.com/a/43522884/7013033
More common would be to provide the user an option wether to start the application or not after successful installation of all packages. This could be done by the WixStandardBootstrapperApplication build in property LaunchTarget. Then you could also remove the custom action from the msi installer.
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense">
<bal:WixStandardBootstrapperApplication
ThemeFile="theme.xml"
SuppressOptionsUI="yes"
LicenseUrl=""
LaunchTarget="{YOURAPPLICATIONPATH}"/>
</BootstrapperApplicationRef>
<Chain DisableRollback="yes">
<PackageGroupRef Id="NetFx48Web"/>
<MsiPackage Id="myMBS"
SourceFile="$(var.Mbs.Updater.TargetPath)"
DisplayInternalUI="yes"/>
</Chain>
Documentation https://wixtoolset.org/documentation/manual/v3/xsd/bal/wixstandardbootstrapperapplication.html

WIX Bootstrapper uninstall without uninstalling MSI how to?

I'm building a WIX Bundle/Chain bootstrapper. It runs and installs like I specified.
I would like to be able to uninstall the bootstrapper without installing the installed MSI. How to accomplish that?
I'm using WIX 3.11.
Other posting here seem to have the opposite behaviour and demand. They seem to use other versions of wix (<=3.10).
Is there a way to accomplish that behaviour?
Some snippets:
...
</Chain>
TK
In your MsiPackage node, add the Permanent flag and set it to yes. When you uninstall your bootstrapper, the msi(s) set this way will remain installed on the machine.
<MsiPackage Id="MSI2KEEP"
Cache="no"
Compressed="yes"
Name="MSI2KEEP"
ForcePerMachine="yes"
DisplayInternalUI="no"
Vital="yes"
**Permanent="yes"**
SourceFile="$(var.MSI2KEEP.TargetPath)"
DisplayName="MSI 2 KEEP"
Description="MSI 2 KEEP" />

Can I reference the MSI output from a WiX Setup project in my wix Bootstrapper project?

For example, I want to do this, but it generates an error:
<Chain>
<MsiPackage SourceFile="$(var.SetupProjectWiX.TargetPath)" />
</Chain>
- where SetupProjectWiX is my MSI WiX project.
I do something similar when creating the MSI itself, and figured the above was possible. Here's the MSI creation referencing a VS project
<File Source="$(var.uCamera.TargetPath)" />
Edit:
I had not added the MSI project as a reference in the bootstrapper project - now it works like a charm :-)
Yes. the same project referencing and variables techniques apply to Bootstrapper projects, too.

WiX bootstrapper that only shows the package Dialogs or atleast one that doesn't require the license approval

I have a project that I am creating an installer for. I have the msi created that will do the install but I also need to install some pre-reqs (.NET 4.0 and VSTO client tools or whatever they are called)
From what I can tell I need to use a bootstrapper and while it seems to work I really don't want the default dialogs that make me approve the license. I would like to skip that completely. (If I could hide the bootstrapper that would be fine but just having an "Install" button without the EULA would be ok).
Here is the xml I am currently using.
<?xml version="1.0" encoding="UTF-8"?>
<WixVariable Id="WixStdbaLogo" Value="logo.png" />
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense">
</BootstrapperApplicationRef>
<Chain>
<!-- TODO: Define the list of chained packages. -->
<PackageGroupRef Id="NetFx40Web"/>
<MsiPackage SourceFile="TestRibbonLocationInstaller.msi" DisplayInternalUI="yes" />
</Chain>
</Bundle>
So from what I can tell I need to basically create a custom bootstrap application for this that I then reference as the bootstrapperapplication. By doing this I will be able to better control the UI (Basically hide it).
Is this thought process correct?

Specify the INSTALLLOCATION of packages in WiX inside the Burn managed bootstrapper

I have a WiX 3.6 bundle (using Burn) and managed bootstrapper that install several MSI packages. Some of the packages install to a common location (C:\program files\MyApp).
I want to let the user choose the install location inside the managed bootstrapper application (C# WPF, especially because the application is large to install; about 1 GB). How can I specify the INSTALLLOCATION for each MSI packages inside my bundle?
Use an MsiProperty child for each MsiPackage to specify INSTALLLOCATION=[BurnVariable]. Then use Engine.StringVariables to set BurnVariable.
For example, in your bundle you set:
<Bundle ...>
<Variable Name='BurnVariable' Value='bar' />
...
<Chain>
<MsiPackage Source='path\to\your.msi'>
<MsiProperty Name="INSTALLLOCATION" Value="[BurnVariable]" />
</MsiPackage>
</Chain>
</Bundle>
See also the FireGiant explanation on this topic.
Then in the managed bootstrapper you can do something similar to this:
Engine.StringVariables["BurnVariable"] = "C:\program files\MyApp";