Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capture Msi error in bootraper #324

Closed
sanjuleo opened this issue Mar 23, 2018 · 1 comment
Closed

Capture Msi error in bootraper #324

sanjuleo opened this issue Mar 23, 2018 · 1 comment

Comments

@sanjuleo
Copy link

Hi Oleg
I need to raise error in MSi and capture them in bootstraper to display a message or put them in bootstraper log. My MSi is running in silent mode.
For now I am putting them through session.Log(error) and quitting the installation, but they do not display in bootstraper log and user has to go to temp folder to find the MSI log and find the error.

I found this link to capture MSI errors in BA -
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Handling-error-from-MSI-in-Custom-BA-td7600313.html

Do we have something similar in Bundle?

Regards

@oleg-shilo
Copy link
Owner

Yes you can do it for the BA implemented by yourself but you cannot control how the standard WixBA behave. The standard WixBA and implements its own error handling as WiX developers designed it and you have very limited customization options for it.

However if you are using your own BA (see 'WixBootstrapper_UI' sample) then you can use the same technique as the link you provided describes:

public class MainViewModel : INotifyPropertyChanged
{
    public MainViewModel(BootstrapperApplication bootstrapper)
    {
        this.Bootstrapper.Error += this.OnError;
        ...
    }

    void OnError(object sender, ErrorEventArgs e)
    {
        MessageBox.Show(e.ErrorMessage);
    }
    ...

oleg-shilo added a commit that referenced this issue Apr 11, 2018
-----

v1.6.4.0
* Implemented localization of the Feature's description text (ManagedUI)
* AutoEllipsis enabled for long Feature's label text
* Issue #337: How to set ManagedAction execute before Appsearch
  Added `SetupEventArgs.ManagedUI.Shell.CustomErrorDescription`
* Add dual signing of binaries.
* Issue #333: FeaturesDialog drawing issues
* Added sample for "Issuae #324: Capture Msi error in bootraper"
* Added support for bootstrapper generic items (`Bundle.Items`): Triggered by #315
* Issue #270: Deduplication of files added with wildcards sample dedup
* Added additional resolution algorithm for FileShortcut location, which now can be both dir id and dir path. Triggered by #307
* Issue #307: Fileshortcuts starting with an integer; Removed '_' inserted by the 'start digit in the name' check for composite Dir Ids (e.g. ProgramMenuFolder.1My_Product);
* Issue #180: Multiple root level directories. Added `InstallDir` class
* Added `FileShortcut` constructor that does nor require 'location' parameter. It automatically creates the shortcut in the parent `Dir`.  Triggered by #307.
* Package WixSharp.bin: added copying nbsbuilder.exe to output folder
* NuGet package(s): Added <references> section to register only managed dlls.
  WixSharp.bin.targets file is added to copy unmanaged dll to the output folder.
* Implementation XmlFile Element
* Issue #304: Localization bootstrapper via theme file
* Added optional generation of the XML id attribute for `Bootstrapper.Payload.Id`
* Issue #303: ExternalTool method ConsoleRun(Action<string> onConsoleOut) pass invalid unicode strings to onConsoleOut
* Added `ExternalTool,Encoding`. The default value is `Encoding.UTF8`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants