WIX MSI Package Uninstallation - wix

I am using WIX for an installer package. When I uninstall the package by double clicking the original msi package everything is fine.
When I uninstall from the control panel it gives me a miminal UI uninstallation. I have written into my MSI a custom action which asks the user whether they want to uninstall some databases etc. This does not occur on the minimal UI uninstallation.
How can I make the uinstall from control panel work with a full UI?

A reply by Bob Arnson in this thread:
Yes, that's the behavior of the
Add/Remove Programs applet. It always
uninstalls MSI packages in basic mode
after prompting. The only thing you
can do is set ARPNOREMOVE to force a
user to use maintenance mode -- and
surface a Remove option in your
maintenance UI.

You can't do that natively with MSI. You'd need to refer to a boostrapper/external UI to do the uninstall. The other answers to this question point in the right direction.

Look at the registry key for your product in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall. In there look at the Uninstall value and see if adjusting it does what you want.
I'm pretty sure that there is a property in the MSI for this if that fixes your issue I just can't remember it off the top of my head. Searching the MSI for the string you find in the registry should help you suss it out though.

You can make ARP menu show only Remove/Change button(it opens your maintenance dialog) for your app by deleting 'ModifyPath' registry value under HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{YourProductCode}. And place both remove and change options in your maintenance dialog.
PS. For this method to apply make sure that you don't have any of the following registry values set to 1 under the registry key stated above: NoRepair, NoRemove, NoModify, WindowsInstaller.

Related

Uninstallation condition for WIX

For installation, we have a property "Install" which we can use in conditions to execute if its undergoing installation. Do we have a similar property for Uninstallation?
You can use REMOVE~="ALL" to detect a full uninstallation.
An uninstall performed as part of a major upgrade can be detected via the UPGRADINGPRODUCTCODE property.
Here is some further advice and some help resources: here is a "MSI Conditions Cheat Sheet" to help you get the complicated MSI conditions for custom actions right. The sheet looks fine to me, but I have not tested it in detail - just sharing the link with your own testing as the only guarantee.
Also, you can check out Stefan Kruger's msifaq.com for a list of common MSI questions as well as his main installsite.org site for general deployment information.
With regards to Wix check out this well known wix tutorial. I'll throw in a link to the Windows Installer Best Practices list as well.
How to add a WiX custom action that happens only on uninstall (via MSI)?

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.

How to specify a custom Repair functionality for an MSI created using WiX?

I created an MSI which installs a Visual Studio 2012 extension package (VSIX) and a couple of other components. There's no option to select which features get installed ( I don't want to give user the choice). All the features get installed by default. However, when I try to repair the MSI ( either from control panel or from MSI itself), it throws up an error. How do I customize this Repair functionality? If I cannot customize, how do I disable it?
It would help if you said what the error actually was. However, the most likely reason is that you have a custom action that is running again (maybe because of the condition you used on it) and it's failing because it's not checking that it was run before, or it uses a property value that no longer is valid - for example INSTALLDIR is not preserved after the install unless you preserve it somewhere.

How to Create a Patch in WiX that is not a "Repair"

I have an existing large WiX install that has already been released. I need to create a small install for just a couple of files that have changed. I have created a patch (.MSP file) in WiX for these few files using the "PatchCreation" element. When the patch is run, it presents the user with a "Reinstall/Repair/Remove" dialog. If the user selects repair, the patch does exactly what it is supposed to. My problem here is that I don't want the patch to say "repair," or to give the user these options. I just want it to install over the few files I have, more or less like a regular install. What can I do to fix this?
MSI implements patches as repairs. In WiX v3.5, the WixUI dialog library has dialogs that are displayed when installing patches.
I have found a more flexible way to work around this, thanks to some help I found here. If you start MSIExec with command-line options (for example, "msiexec /p [patch file] REINSTALL=ALL REINSTALLMODE=omus"), you can get the install to start up without the "Repair" option coming up. You can also use the IExpress tool (which is shipped with Windows, and can be brought up in a command-prompt) to create a wrapper/bootstrapper that will start the MSP file from MSIExec.
Thanks very much to the answers I received. I would not have figured this out without your help.
I partially agree with Bob. Patches in WiX are applied through a repair, but Windows Installer does support a standalone patch installation. Other setup authoring tools can create them.
Regarding the WiX patch, I recommend using a custom bootstrapper which applies the patch automatically.

Why won't Windows Installer use the UI in the .msi file during removal?

Has anyone been able to get Windows Installer to use the InstallUISequence table during removal?
I started with an MSI file produced by the Visual Studio msi builder, decompiled it into WiX source code and handcrafted it, but I cannot get the installer to use my UI during removal. It insists on using a default UI provided by Windows Installer.
I have also analyzed several MSI files, and I have been unable to find one where Windows Installer will use the provided UI during removal.
I captured the msiexec logs during removal, and sure enough, Windows Installer appears to be ignoring the InstallUISequence table.
It seems that msiexec runs with minimal UI during removal. If I specify the /qf switch (use full UI) during removal, then Windows Installer does take the UI from the .msi file. However, this doesn't help the regular user, because she won't do the removal from msiexec.
Does anyone know of a way to convince Windows Installer to use the UI in the MSI file by default?
When removing an application from Add/Remove Programs, this will always run with "basic" UI.
You can't make uninstall run with full UI, the best you can do is prevent removal and force people to 'modify' (which does run with UI) and remove from there.
Whatever you do, there's still no way to prevent someone right clicking on the original MSI and selecting 'Remove', this will always run with basic UI.
The "Why" is basically because Microsoft says so. :-) Can't say I disagree as I get annoyed when ISV's get all cute when I'm just trying to remove a program.