Is there a way to make the burn wait for an event to complete? - wix

I'm building a bootstrapper application with a customized ui, I want to show the ui after the detect package event complete.

Yes. That is possible. A custom BA (BootstrapperApplication) has full control over when/how/if UI is presented. You could choose to show no UI until after the detect complete callback.

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.

Windows Installer : SpawnAndWaitDialog not getting closed automatically?

I am using a C# custom action followed by a SpawnAndWait Dialog.
Something Like
PROPERTY WORK_DONE="False"
1.LaunchCustomAction (This does some work and sets WORK_DONE to True)
2.Show SpawnAndWait (Exit when WORK_DONE="True")
Problem,For SpawnAndWait Dialog to Appear, I need to mark my CustomAction as
asynchronous, that is to continue installation without waiting for the custom action to finish. But Whenever I do this, Properties are not getting updated and as a result SpawnAndWait Dialog doesn't get closed automatically.
If I don't mark my Condition as async, The dialog doesn't appear and it waits for the custom action to finish first.
My Requirement is to Show a small popup window that lets the user know that there is a background task going on, Please wait.
Please let me know what am I doing wrong.
I am using C# custom Action via Wix Toolset to build the custom action and AdvancedInstaller to build the installer.
I would highly recommend you (if you are willing to) to write your custom action as an unmanaged custom action written in native C++ and use the MsiSetProperty function to set your property. There are lots of Windows Installer incompatibilities and limitations in what regards its integration with managed custom actions.
If you still need to use a managed C# custom action please try to add your custom action as a custom action with sequence in Advanced Installer if this configuration is suitable for your scenario.

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.

WiX burn custom BA - how to pause progress when Cancel command fires?

Using a custom managed bootstrapper application, I am unable to get the setup progress to stop when the cancel button is clicked. I pull up a confirmation view with Yes/No options. Once cancellation has been confirmed, the setup rolls back just fine. Or, if declined, it continues along. This was done in accordance with:
Cancel Installation and Rollback using wix burn Bootstrapper UI
I noticed same problem also occurs in the WiX setup kit itself, where you could click cancel and wait, and the setup instead of waiting for user to confirm or decline cancellation, continues along.
So, my question is, how do I pause the progress, until the Cancel command is confirmed (or declined) in the confirmation view?
Update: I am attempting to do this by the following mechanism:
Add a new property called CancelWaiting. If CancelWaiting is true, then in the ProgressViewModel, change the logic such that the <PropertyChangedEventArgs>.Result is set to Result.Suspend. The challenge here is to do multiple command binding. The other way would be to combine the Cancel and CancelWaiting paths into one. Anyway, I'll update this thread once I get this going. If anyone has any other ideas, please do post.
Returning Result.Suspend will instruct the Burn engine to stop the installation as soon as possible and keep the Bundle registered to execute again. That is not likely what you want to do.
If you want to prevent the progress from continuing, then you must have the progress callback method wait and not return. You can either do that by showing the message box from the progress callback method or have the progress callback wait on an event and signal the event after the user makes a choice on the UI thread.
I know this is old, but my approach may help someone else struggling. I faced the same issue where I had to pause the progress of the installation/uninstallation of custom burn wpf app.
So this is how I solved it:
I created a popup a modal window via Window.ShowDialog(), because the gui thread will block until the popup is closed.
When user press exit/cancel you can do something like this:
ModalWindow newWindow = new ModalWindow();
newWindow.ShowDialog();
You can add new Window and call it in this way. That will pause the UI thread till user close or give feedback to ModalWindow.
But if you are looking for other approach, here is a good read
http://deanchalk.com/wpf-modal-controls-via-dispatcherframe-nested-message-pumps/

Show custom dialog with Launch Condition

I would like to show the my custom dialog rather than the message box when Launch Condition failed in Wix. Normally, the message box of Launch Condition has OK button, but I would like to make more than that with some further actions with my dialog.
Could you please advise me how I can make it?
Thanks.
Dialogs can be sequenced using the InstallExecuteSequence and Custom elements. Schedule it prior to your Welcome dialog and after the LaunchConditions action. You may want an error custom action scheduled in the execute sequence to handle logging during silent installs.
You may also want to author your dialog into the main wizard loop (after install welcome ) using Publish elements also. It's hard to say without understanding your exact needs.