Hi

I know this is older mail but found one solution and I also need another
one :)
So I managed to get error code by creating embedded UI handler DLL.
Everything what I do there is that I catching INSTALLMESSAGE_ERROR and
reading value from first field of input record.

INT WINAPI EmbeddedUIHandler(UINT iMessageType, MSIHANDLE hRecord)
{
    INSTALLMESSAGE MsiMsg = (INSTALLMESSAGE)(0xFF000000 &
(UINT)iMessageType);

    if (INSTALLMESSAGE_ERROR == MsiMsg)
    {
        UINT nMsiError = MsiRecordGetInteger(hRecord, 1);
        // Do whatever you want with nMsiError
    }

    return 0;
}

But here is another problem.
We also have application which can install our product by using ExternalUI.
I thought that in this case it would be simple task but it isn't. When
installer ends I get only general error 1603 - ERROR_INSTALL_FAILURE
And I need more specific error. e.g. 1920 - Service '[2]' ([3]) failed to
start. (I know I wanted only final status but now I hope I can get more)
I found on msdn example which I hoped could help me.
http://msdn.microsoft.com/en-us/library/windows/desktop/bb309215%28v=vs.85%29.aspx
But in this case hRecord contains only fields with error text but no with
error code. (it is unbelievable) I am notified that error came but I have
only text and no error code.

So have anybody any idea? Or if I can force to run my embedded ui in same
time as external ui is running. Than it will catch this error.
I also tried obtain error by calling MsiGetLastError but there was nothing.

thanks for any reply.
elanius.


2011/10/27 Castro, Edwin G. (Hillsboro) <edwin.cas...@fiserv.com>

> I don't think you can have the Windows Installer engine report the exit
> code before it exits back to custom actions in a MSI package before the
> installation completes.
>
> If you are trying to get information after the installation completes and
> you have PowerShell v2 available to you then you could try the following
> command:
>
> Get-EventLog -LogName Application -Source MsiInstaller -Newest 20
>
> Obviously, you'll want to modify (or skip entirely) the -Newest parameter
> to your purposes.
>
> To learn more about the Get-EventLog cmdlet run the following:
>
> Get-Help -Name Get-EventLog -Full
>
> Edwin G. Castro
> Software Developer - Staff
> Digital Channels
> Fiserv
> Office: 503-746-0643
> Fax: 503-617-0291
> www.fiserv.com
> Please consider the environment before printing this e-mail
>
>
> > -----Original Message-----
> > From: Wilson, Phil [mailto:phil.wil...@invensys.com]
> > Sent: Thursday, October 27, 2011 10:31 AM
> > To: General discussion for Windows Installer XML toolset.
> > Subject: Re: [WiX-users] Get installer final status (return code) from
> custom
> > action
> >
> > You could write something to monitor or read the Application Event log.
> > There are MsiInstaller entries created when a product is installed (and
> I think
> > one for failure too). They seem to be event ID 1033, and there's a
> > ProductCode, result and ProductName in the entry.
> >
> > Phil Wilson
> >
> > -----Original Message-----
> > From: Elanius [mailto:elani...@gmail.com]
> > Sent: Thursday, October 27, 2011 4:44 AM
> > To: General discussion for Windows Installer XML toolset.
> > Subject: [WiX-users] Get installer final status (return code) from custom
> > action
> >
> > Hi
> >
> > I am working on installer of our product and I got another requirement
> from
> > my beloved product manager.
> >
> > So I need collect some statistic about installer and main problem is get
> final
> > return code of installer. It would be simple task if I had some top level
> > application which calls installer through MsiInstallProduct but I it is
> not my
> > case. I managed to add Custom Actions on positions -1, -2 and -3 in
> > InstallExecuteSequence so I know if installation ends with success, user
> exit
> > or some error.
> >
> > But I can not obtain last msi error a mean error code which is normally
> > returner by API function MsiInstallProduc. It have to be stored somewhere
> > because in this time (sequence -3) is obvious that installer is
> finishing with
> > some error. But question is if it is accessible?
> >
> > thanks for any reply,
> > elanius.
> >
> ------------------------------------------------------------------------------
> > The demand for IT networking professionals continues to grow, and the
> > demand for specialized networking skills is growing even more rapidly.
> > Take a complimentary Learning@Cisco Self-Assessment and learn about
> > Cisco certifications, training, and career opportunities.
> > http://p.sf.net/sfu/cisco-dev2dev
> > _______________________________________________
> > WiX-users mailing list
> > WiX-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
> >
> > *** Confidentiality Notice: This e-mail, including any associated or
> attached
> > files, is intended solely for the individual or entity to which it is
> addressed.
> > This e-mail is confidential and may well also be legally privileged. If
> you have
> > received it in error, you are on notice of its status. Please notify the
> sender
> > immediately by reply e-mail and then delete this message from your
> system.
> > Please do not copy it or use it for any purposes, or disclose its
> contents to any
> > other person. This email comes from a division of the Invensys Group,
> > owned by Invensys plc, which is a company registered in England and Wales
> > with its registered office at 3rd Floor, 40 Grosvenor Place, London, SW1X
> > 7AW (Registered number 166023). For a list of European legal entities
> within
> > the Invensys Group, please go to
> > http://www.invensys.com/en/legal/default.aspx.
> >
> > You may contact Invensys plc on +44 (0)20 3155 1200 or e-mail
> > recept...@invensys.com. This e-mail and any attachments thereto may be
> > subject to the terms of any agreements between Invensys (and/or its
> > subsidiaries and affiliates) and the recipient (and/or its subsidiaries
> and
> > affiliates).
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > The demand for IT networking professionals continues to grow, and the
> > demand for specialized networking skills is growing even more rapidly.
> > Take a complimentary Learning@Cisco Self-Assessment and learn
> > about Cisco certifications, training, and career opportunities.
> > http://p.sf.net/sfu/cisco-dev2dev
> > _______________________________________________
> > WiX-users mailing list
> > WiX-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wix-users
>
> ------------------------------------------------------------------------------
> The demand for IT networking professionals continues to grow, and the
> demand for specialized networking skills is growing even more rapidly.
> Take a complimentary Learning@Cisco Self-Assessment and learn
> about Cisco certifications, training, and career opportunities.
> http://p.sf.net/sfu/cisco-dev2dev
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to