How to add Change button to the WiX Toolset (burn) Bootstrapper? - wix

I need to add the Change button to my WiX (burn) Bootstrapper, so that it invoked the change action from the MSI that it's wrapping:
What markup do I need for that?

In WiX v3.x, you have to set the DisplayInternalUI attribute to yes to show the MSI UI. But the only time that the bundle can show the MSI's internal UI is during Install. The engine is hardcoded to force any other operation (modify, repair, uninstall, etc) to run silently. You'll have to write your own custom BootstrapperApplication in v3.x if you want the bundle to be able to modify an MSI, and the BA will have to have its own UI to do so.
In v4 (which isn't released yet), you can use wixstdba to show the MSI's internal UI for all operations but there isn't currently support for a Change button like you're asking for. It only supports Repair and Uninstall like in v3.x. No one has asked for that yet, so you might want to create a feature request at https://github.com/wixtoolset/issues/issues. Otherwise, you'd have to create a BAFunctions.dll to customize wixstdba.
The general recommendation for bundles is to use separate MSI's for different features instead of one MSI with all of the features.

Related

Only repair and uninstall can be seen while relaunching bootstrapper application

I have an msi bundled with prerequisites using Wix bootstrapper. After installing the wix bootstrapper application, if i relaunch it again i could do only repair and uninstall. But i need to have modify option also.
In MSI i tried setting the property REINSTALLMODE as "vamus". after doing so, i was able to change / repair/ uninstall w.r.t. msi.
But bootstrapper application doesn't show modify option.
On relaunching the installed wix bootstrapper application, i am expecting to have below options.
change, repair & uninstall.
A modify option makes only sense if you want to remove or add features included in an msi. May be a solution would be to set up your own bookkeeping on installed features and showing this list to the user in a custom bootstrapper application.
Another way to handle this situation may be to show the msi installation dialog which should show a "modify" dialog option.

WiX - Allowing a *manual* uninstall of one msi to uninstall another msi that shares the same UpgradeCode (and not just during the MajorUpgrade)

I have a bootstrapper (C# windows forms applications) that trigger two different msi files consecutively out of its resource. The instance transforms between the msi are 'paired' such that one instance transform from the first msi shares an UpgradeCode with one instance tranform from the second msi; these are the pairs that are installed together via the bootstrapper.
The 'core' msi (the first msi that runs) includes the MajorUpgrade element such that when a higher-versioned 'core' msi is run, all related products with a lower version are first uninstalled - this includes the secondary program installed via the second msi since it uses the same UpgradeCode and is recognized as a related product. This is the behaviour I want so that's good, but if I uninstall the 'core' msi program manually via the control panel, it only installs that one. I'd like to get it to uninstall the secondary program as well, even if I manually uninstall the 'core' one.
Do I need to write a custom function that manually calls the uninstall of the secondary msi's program with the ProductCode? E.g., as per here:
Wix - uninstall different product
Or, can I explicitly schedule RemoveExistingProducts to be run for uninstalls? Something like:
<InstallExecuteSequence>
<RemoveExistingProducts After="InstallFinalize">REMOVE</RemoveExistingProducts>
</InstallExecuteSequence>
Is that not possible because after InstallFinalize of the 'core' msi, it knows nothing about the secondary msi? Basically, I'm wondering if I can also use the RemoveExistingProducts standard action for the manual uninstall the case, like it's doing for the MajorUpgrade case.
Thanks so much in advance.
Unfortunately, the answer is no.
RemoveExistingProducts does not trigger during a maintenance operation.
You will certain lines in the log file which indicate that:
Skipping RemoveExistingProducts action: current configuration is maintenance mode or an uninstall
What you are trying to do is usually achieved by making use of a bootstrapper application.
Have you explored the bootstrapping feature of Wix called Burn?
Burn should be able to easily handle your requirement.
If using Burn is not an option for you, then i dont see any other option other than writing your own custom code to achieve this.
Hope this helps.

How to modify the installed features of msi with wix bootstrapper?

I am trying to call a msi inside wix bootstrapper program.It is working properly at the time of installation.And selected features are installed properly.But after installation i am trying to modify the installed features.In the control panel there is change button.But when i click it then it is showing a dialog with Repair, uninstall, cancel buttons.There is no modify button for modifying the features of installer.
Please specify the solution if any.
code inside Bootstrappertheme.wxl is
<!-- Modify dialog -->
<String Id="ModifyHeader">Modify Setup</String>
<String Id="ModifyNotice">[WixBundleName] is already installed on this machine. If it's not working correctly, you may repair it. You may also uninstall it.</String>
<String Id="ModifyRepairButton">&Repair</String>
<String Id="ModifyUninstallButton">&Uninstall</String>
<String Id="ModifyCloseButton">&Cancel</String>
The wix standard bootsrapper application does not currently support msi feature selection. Currently, the only way to get it is to create a custom bootstrapper application. People have asked about this on the WiX mailing list multiple times. Rob Mensching is the project leader, and Bob Arnson currently manages the 3.x branch.
This guide: Writing Your Own .Net-based Installer with WiX is the best resource I know about for building one in WPF. The actual WiX source code is very helpful as well. It's a very big task though.
I don't have a sample project to share with you, but the blog post I mentioned above does have a section "HANDLING CURRENT & FUTURE STATE" which describes how to do this. I think it really is a terrific resource.
Also, see this question: Custom WiX Burn bootstrapper user interface?
Burn GUI
Burn GUI is very different from MSI-GUI. Here is an older, similar answer
Please also see comments in these answers:
On customized GUI
Changing text color to Wix dialogs
Custom WiX Managed Bootstrapper Application
MSI File
What dialog set are you using for the MSI files? Have you tried enabling the advanced dialog set? I haven't tried it yet: http://wixtoolset.org/documentation/manual/v3/wixui/dialog_reference/wixui_advanced.html
WixUI Dialogs:
http://wixtoolset.org/documentation/manual/v3/wixui/dialog_reference/wixui_dialogs.html
Tutorial:
http://wix.tramontana.co.hu/tutorial/user-interface/ui-wizardry
It might be possible to use Orca (http://support.microsoft.com/kb/255905) to edit the MSI and resave it so that it, without special configuration in wix, automatically has the Modify option in Programs and Features. When creating an MSI from scratch (using InstallShield for example), the user can specify which options are available. There should be a way to edit the file to accomplish the same thing.
When you open up the "Change" feature from the Programs and Features menu, it reruns a cached version of the MSI installer in maintenance mode. Regardless of what program is bootstrapping the MSI (wix vs InstallShield), the MSI is the only thing that Windows knows about. If it is not configured to have a Modify option, it won't have it.

Migrate WiX UI to Burn

I have a working WiX installer with a custom UI using a WixUI_Mondo_MyApp.wxs file. I have to extend my installer to also run another exe installer. I understand Burn is the way to do this.
I created a Burn project that chains my original MSI with the custom UI (using DisplayInternalUI="yes"), and that works fine. But I don't want two UIs popping up (the Burn default UI, and my MSI UI), and I need to get some info from the MSI UI to determine if I should install the other exe (it will listed as one of the features).
I suppose the proper solution would be to migrate my UI code from my MSI to my Burn project, but I can find no docs on describing how to do this.
Thanks in advance.
There is no migration path; MSI UI is declarative using the MSI UI tables and Burn supports arbitrary code in a bootstrapper application. If you have any logic in your UI customizations, you'd have to write a custom bootstrapper application to get that in a bundle.

Stopping display of custom dialog boxes in WiX uninstall

I have a WiX installer project that utilises a custom dialog box to ask for parameters to update a web.config file and run a database script on install. Everything works correctly and the application is installed and runs correctly.
However, the custom dialog box is also displayed when I uninstall the software and it certainly doesn't need to be (as I'm not updating a web.config file).
Is there a way to suppress the custom dialog when the application is being uninstalled?
(I should also remove the sql procs I install, at uninstall time but that is outside of this issue).
The solution to your question is to condition the custom action with the condition (Not REMOVE="ALL"). This will make the action run on fresh install and maintenance install, but not on uninstall. If you don't need to run on maintenance install, but only on a fresh install you can set the condition to be: (Not Installed AND Not(REMOVE="ALL")). Full list of MSI properties and brief descriptions here: http://msdn.microsoft.com/en-us/library/aa370905(VS.85).aspx.
The sequencing and custom action logic in MSI files is VERY complicated. It really pays off to avoid custom actions whenever you can.
There is more - all MSI files have built-in support for silent installation. This means that the entire GUI sequence can be skipped, and the MSI file installed without user interaction. This is a crucial feature for corporate deployment via SMS / SCCM or other deployment mechanisms. Showing a custom dialog box when the setup is run in silent mode is a violation of this basic MSI feature. You can work around this by properly conditioning the display of the dialog based on the property UILevel: http://msdn.microsoft.com/en-us/library/aa372096(VS.85).aspx. Just to keep things interesting and confusing Microsoft has defined 4 levels of GUI during an installation ranging from completely silent, through various options such as progress bar only etc... See the link for details.
I could add a lot of details here about MSI sequences, conditions, custom actions and similar, but it wouldn't answer your question. Please add any follow-up questions.
Wix snippet to show the creation of a custom action and its insertion into the InstallExecuteSequence:
<!--Custom Action Sample Section-->
<Binary Id='VBScriptCustomAction.vbs' SourceFile='VBScriptCustomAction.vbs'/>
<CustomAction Id='test' BinaryKey='VBScriptCustomAction.vbs' VBScriptCall='Hello' Return='ignore'/>
<InstallExecuteSequence>
<Custom Action="test" Sequence='4111'><![CDATA[NOT REMOVE~="ALL"]]></Custom>
</InstallExecuteSequence>
<!-- End of Custom Action Sample Section-->