Warn User If Internet Speed is slow - wix

I am creating a installer using WIX, The requirement here is that when the user clicks on the next button on the license agreement dialog, I want to check the Internet spped of the user. If it is less than 1 mbps, I should show a message to the user that "the internet speed is less than the minimum required by the application. Do you still want to go ahead with the Installation?" This messagebox contains two buttons "Yes" and "No". If user clicks on Yes, I continue with the Installation. On click of "No", the Installation aborts.
I think this is impossible or may be quite difficult to do it with WIX. So thought of writing a C# Application, which will check the internet speed and show the dialog to the user. I want to launch this utility to be launched in the UI Sequence. Then capture whether user clicked on Yes or No, If user clicks on Yes, i continue with the Installation otherwise Installation aborts.
Note- When user clicks either Yes or No, the C# Application closes.
How can I :
1. Embed C# App in msi
2. Launch it in UI Sequence
3. Get the user action result and proceed accordingly.
Please help, it is urgent.

First, I question the value of doing this in an installer. Internet speed is highly variable and a user is just going to click yes and proceed. Any kind of system status check should really be inside your application.
But if you really want to have a Managed Custom Action in your installer that can set a property then you want to check out Deployment Tools Foundation.
WiX and DTF: Introduction
Deployment Tools Foundation (DTF) Managed Custom Actions
How long will it take for your code to determine internet speed? If it can do it in a few seconds then you can consider scheduling the custom action between CostInitialize and InstallFinalize. The CA will set a property and then you can use that property in your UI to decide if a warnign dialog that you author should be shown or not.
Again though, I have to suggest that this isn't a good idea.

Related

Wix / WixSharp installer. Track user cancel installation event

I'm developing the installer using WixSharp. I want to track (catch, subscribe etc) the event when user clicks the cancel button (cancel / abort installation).
I want to track during the stage user inputs the data and during the installation files process as well. It's better no changing the standard UI dialogs but using custom action or something. But if changing UI is the only way it's OK.
The project UI type is WixUI_InstallDir.
Thanks for attention.
You can't track this button click if you use this project type. But you can customize this project type if you adds this dialogs forms in your project
WixSharp Managed Setup - Cusom UI
Just add dialogs from this project and cancel handler (i think you know how to do it in winforms). Don't forget to check Project.cs, there are dialogs sequence and ManagedUI parameter set.

MSI: Show message box in UI phase of installation

I'm updating an InstallShield based installer. I've added a new managed custom action, written in C#, and packaged using Wix DTF.
Action is invoked correctly, and performs necessary actions.
Problem I have is showing an error message to user.
Method 1: MsiProcessMessage
From articles I've read, I understood that MsiProcessMessage is the correct way to do it, however this method does not work in UI sequence (before setup actually starts copying files and modifying system). In install sequence this method works. Code which I use is following:
Record record = new Record() { FormatString = "Password is not valid for this user." };
session.Message(
InstallMessage.Error | (InstallMessage)(MessageBoxIcon.Error) | (InstallMessage)MessageBoxButtons.OK,
record
);
Is it actually impossible to show an error message in UI sequence (Immediate execution) using MsiProcessMessage?
Method 2: MessageBox.Show
Using Windows.Forms works for showing a message box. However, message is displayed in background of setup wizard, and shows a separate icon in Windows taskbar.
Is there a way to get window handle of installation wizard, and that way solve this problem?
You didn't quite mention this, but I'm guessing that you are invoking your custom action off a DoAction ControlEvent, published off of something like a button click. Underneath the covers, this is very different from scheduling it in the InstallUISequence. MsiProcessMessage doesn't work from DoAction.
For proper integration with the Windows Installer UI experience, you should avoid using MessageBox.Show (your method 2). Better-integrated options include:
Tweaking a message that can be shown on the dialog from which you invoke this action
Showing a popup message by conditionally invoking a SpawnDialog ControlEvent
Showing an additional wizard panel by conditionally invoking a NewDialog ControlEvent
All three of those involve editing the UI of your project, but differently.

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.

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.

Is it possible in WIX to force user to scroll all Eula to proceed further?

We have a WIX Eula box , We need to make sure that user read all the EULA contents before he says accept ?
Is there any way to keep accept check box or button disabled until user scrolls it down completely?
Any help will be really appreciable.
This is not supported by Windows Installer, so it cannot be done in WiX.
It's supported only by some setup authoring tools which use an external installation UI. Their external UI can detect the scroll position and update buttons accordingly.
So for now it would be best to simply use the standard behavior.