Thanks Phill!

I also found this:
http://msdn.microsoft.com/en-us/library/aa371247%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/aa370573%28v=vs.85%29.aspx

However, I'm still not clear on how I go about handling that error code in
my bootstrapper. For instance, let's say two different errors can happen in
my CA:
 1. A critical error that should fail the installation and print an error
message.
 2. An error that can be retried, i.e. I want my bootstrapper to show a
retry page with an explanation of the error.

How do I catch the messages sent from the CA and do the correct behavior in
the bootstrapper?

Cheers,
Soren


On Fri, May 9, 2014 at 1:03 PM, Phill Hogland <phogl...@rimage.com> wrote:

> Youmight want to look at src\ext\ca\wixca\dll\CloseApps.cpp in the Wix
> tools
> source for an example of using WcaProcessMessage.
>
>     HRESULT hr = S_OK;
>     UINT er = ERROR_SUCCESS;
>     PMSIHANDLE hRecMessage = NULL;
>     DWORD *prgProcessIds = NULL;
>     DWORD cProcessIds = 0;
>
>     hRecMessage = ::MsiCreateRecord(1);
>     ExitOnNull(hRecMessage, hr, E_OUTOFMEMORY, "Failed to create record for
> prompt.");
>
>     er = ::MsiRecordSetStringW(hRecMessage, 0, wzPrompt);
>     ExitOnWin32Error(er, hr, "Failed to set prompt record field string");
>
>     do
>     {
>         hr = ProcFindAllIdsFromExeName(wzApplication, &prgProcessIds,
> &cProcessIds);
>         if (SUCCEEDED(hr) && 0 < cProcessIds)
>         {
>             er =
> WcaProcessMessage(static_cast<INSTALLMESSAGE>(INSTALLMESSAGE_WARNING |
> MB_ABORTRETRYIGNORE | MB_DEFBUTTON3 | MB_ICONWARNING), hRecMessage);
>             if (IDABORT == er)
>             {
>                 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
>             }
>             else if (IDRETRY == er)
>             {
>                 hr = S_FALSE;
>             }
>             else if (IDIGNORE == er)
>             {
>                 hr = S_OK;
>             }
>             else
>             {
>                 ExitOnWin32Error(er, hr, "Unexpected return value from
> prompt to continue.");
>             }
>         }
>
>         ReleaseNullMem(prgProcessIds);
>         cProcessIds = 0;
>     } while (S_FALSE == hr);
>
> LExit:
>     ReleaseMem(prgProcessIds);
>     return hr;
> }
>
>
>
> --
> View this message in context:
> http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Displaying-custom-error-messages-if-deferred-CA-fails-tp7594643p7594647.html
> Sent from the wix-users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Is your legacy SCM system holding you back? Join Perforce May 7 to find
> out:
> &#149; 3 signs your SCM is hindering your productivity
> &#149; Requirements for releasing software faster
> &#149; Expert tips and advice for migrating your SCM now
> http://p.sf.net/sfu/perforce
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to