What is, for Wix, the difference between pressing the uninstall button of an installer and uninstalling via Apps&Features? - wix

I have an application with a Wix installer. When the user uninstalls without the installer executable but just uses the Apps&Features inside windows, how does that differ? Because it seems that some custom actions are not executed. How can I fix this?

When user uninstalls from Apps&Features, interactive part(InstallUISequence) of installer is skipped. Check if affected custom action is scheduled in InstallUISequence only or if custom action condition contains UILevel property. Also, search msi log for affected custom actions if it's present and its displaying (condition is false). This would mean the problem is with custom action condition only.
Custom actions needs to be sequenced in InstallExecuteSequence table if this needs to be executed every time irrespective of whether its interactive or silent un-installation.
Depending on your requirements, you might schedule in both install sequences.

Related

Schedule reboot from WiX deferred custom action

I've got a WiX deferred custom action that conditionally modifies some registry keys. For the changes to take effect, a reboot is required. I'd like the user to get the standard dialog box that prompts them to reboot after the installation completes.
How can I schedule a reboot from a deferred custom action?
Why do you have a custom action doing something that MSI/WiX knows how to do natively?
A cleaner approach would be to have registry values associated with a component that has the needed condition. Then you can have a simple custom action trigged by that same condition call MsiSetMode with the MSIRUNMODE_REBOOTATEND argument. If you are using C#/DTF that's session.SetMode(InstallRunMode.RebootAtEnd).
This way if the install is aborted, canceled, failed it can roll back the registry changes.

How to add custom action to the 'close' event after successful installation

I have two msis and packed them into a bootstrapper EXE installer. But I want to have the ability to launch the application after installation. I know there's a way to achieve this by adding a 'launch' button. Then there will be two buttons when the installation succeeded. But is there a way to add a custom action to the 'close' button or remove the 'close' button?
Thanks!
Wix Burn UI is not a powerful for now, as far I know, however you can do anything you want, it's just matter of time you're willing to put in. Burn UI does not play well with properties for now, you can't even create custom TextBox to fill up a property, but if time is not a problem:
1) You can download Wix source, and modify everything the way you want it to be, making it reusable.
2) You can create custom WiX Burn UI(I like WPF+MVVM), which shouldn't take too much time, and should be very interesting. There you can include anything your soul wants.
3) You can disable WIx BURN UI and use MSI internalUI,
this is good example; http://wixtoolset.org/documentation/manual/v3/howtos/ui_and_localization/run_program_after_install.html
That will allow you to configfure everything, such as "Close" button having a custom action. + removing Close button by overriding custom dialogs(you can download them from wix, *.THM files)
No, neither of those is possible.

bootstrapper application rollback

I am trying to create a Wix burn bootstrapper that installs my msi. The bootstrapper exe is working fine but the only issue is that whenever I try to cancel the installation in midway the custom actions which are added in msi is not get stopping. Can anyone tell how to stop and rollback the installation while clicking cancel button. Thanks in advance.
A custom action must send ::MsiProcessMessage() calls to provide the possiblity to recieve the cancel and handle the return code from that API (usually ERROR_INSTALL_USEREXIT or IDCANCEL). Then the custom action must exit.
If you look at some of the WiX standard custom actions you'll see lots calls to WcaProcessMessage() and such. We save the return code from those and WcaFinalize() returns the correct thing on exit. Check out src\ca\wcautil\wcautil.cpp and src\ca\wcautil\wcawrap.cpp for example code.

wix uninstall dialog properties not updating

I am launching a custom dialog in my uninstall sequence to gather a handful of data items from the user ultimately to run a custom action to undo an install time custom action. unfortunately none of the property values from the UI are being updated...? They are all blank when I get to my custom action code.
I have read most of the related posts on the web, and I understand not many people are doing uninstall dialogs, being that it will not show in the add/remove version of the uninstaller, and the possibility of getting around this using the ARPNOREMOVE, etc...
Considering I do want to use the uninstall dialog, why aren't the properties being updated? I added the dialog to the install time sequence and the properties are there in the custom action, so I don't believe it is a configuration problem with my dialog or properties. What is different about the UI -properties in the uninstall?
There could be a number of problems:
The properties are not public (app caps names). Only public properties are passes to the execution phase of the installation. More details here.
Your custom action runs deferred and it does't have access to the installation context. More details here on how to access context data from a deferred ca.

Check RAM in WIX Installer

I want to create a WIX Installer, during the prerequisites check, I want to see the amount of RAM Installed on the system.If it is less than 1 GB, It should show a Message to the user Indicating that "Amount of RAM on the system is less than the minimum required by this product. Do you still want to proceed with the Installation?"
There are two buttons in the message box shown (Yes and No). If User clicks on Yes, I continue with the Installation, If user clicks on No, I will just show the finish dialog or abort the Installation. How can I achieve this?
Windows Installer sets the system RAM amount in PhysicalMemory property. Usually this property is used as a launch condition which stops the installation and shows a message to the user.
Launch conditions do not allow the user to continue. So if this is not an option, a solution is to use a custom action. Your custom action can check PhysicalMemory and show a custom message box if it's not enough. Based on the user answer, the custom action can then return 0 to continue or 1602 to stop.
Here is a sample condition:
PhysicalMemory >= 1024
A custom action is no needed to implement your requirement. You can author a Windows Installer dialog and insert it between two other dialogs ( for example WelcomeDlg and VerifyReadyDlg ) to be conditionally called based on the PhysicalMemory property.
Here's what the ControlEvents and Conditions would look like for the WelcomeDlg:
SpawnDialog NotEnoughMemoryDlg PhysicalMemory < X
NewDialog VerifyReadyDlg 1
Then you create a dialog that looks like a mesage box and call it NotEnoughMemoryDlg. Have a ControlEvent for the Yes button of EndDialog Return 1. Have a ControlEvent for the No button that says EndDialog Exit 1.
If the system has enough memory it'll skip over the call to the custom dialog. If the system doesn't have enough memory it'll call the dialog. If the user clicks yes it'll return and fall through to the next control event which takes you to VerifyReadyDlg. If the user clicks no, it'll return with a cancel message and invoke the setup completed cancelled dialog.
I don't really do much UI work in WiX ( I mainly use InstallShield but the underlying MSI concepts are the same ) so I can't really give you "do this" code. Especially since I don't know what your current WiX UI code looks like. ( Are you using the WiXUI extension? )
You can follow my instructions to show a non-blocking warning for the operating system. Adapting those instructions to warn about the value of the PhysicalMemory property as mentioned by Cosmin shouldn't be too difficult.