[wix-users] Burn: mba support for INSTALLMESSAGE_ACTIONDATA contextual info for progress bar.

Phill Hogland phill.hogland at rimage.com
Fri Nov 20 07:05:12 PST 2015


I have tried several approaches to updating the progress text from my Wca-based C++ deferred custom action.  I have read many posts and all of the C++ wix related posts that I have found agree with my observation that the 'templated' portion of the ActionData message is never displayed.  The Action name and the Action 'description' are displayed.  I have not used the Wix ComPlusExtension, but I notice that it implements using ActionData.  So I tried to follow the pattern that I observed there.

1)      I added ProgressText/@Template to the ProgresText element that I already had for the CA, in the wixlib of my CompilerExptension.

2)      I added functions similar to CpiActionStartMessage and CpiActionDataMessage to my CA project.

3)      In the immediate CA I pass info from a custom table to CustomActionData, for access in the deferred CA.

4)      In the deferred CA I call the ActionStartMessage() with the action name, a description, and a template "Enabling [1]".  (initially and tried many other approaches).

5)      Then in the loop I call the ActionDataMessage string with a name of a feature being enabled.

The Action name and the 'description' are displayed but the 'template' (with or without the payload string) is never displayed (in my Burn driven mba).  One thing about this approach that I wonder about is that I think that the PMSIHANDLE defined in the ActiuonStartMessage function has gone out of scope by the time the ActionDataMessage function has been called.

So I commented out that approach and implemented the code found at this link directly in the CA (without any utility functions)
https://msdn.microsoft.com/en-us/library/aa367525(v=vs.85).aspx

And in this case I even tried to implement this code with the template "Incrementing tick [1] of [2]" with the calls to INSTALLMESSAGE_PROGRSS (which the ComPlusExtension does not have, and I probably don't really need to just modify the text).  However I wanted to see if the example code would work in my project, and I observed the same results where the 'template' portion of the string is never displayed.

Then I compared the code at this link, with the code in wiutil.cpp (of dutil project) in the function HandleInstallProgress().
https://msdn.microsoft.com/en-us/library/aa368786(v=vs.85).aspx

I am not sure that I understand the wix code, but I don't see where there is code similar to the example code for handling
case INSTALLMESSAGE_ACTIONDATA:
        // only act if progress total has been initialized
        if (0 == g_iProgressTotal)
            return IDOK;
        SetDlgItemText(/*handle to your dialog*/,/*identifier of your actiontext control*/, szMessage);
        if(g_bEnableActionData)
        {
            SendMessage(/*handle to your progress control*/,PBM_STEPIT,0,0);
        }
        return IDOK;

I see in the wix code, and I suspect that in my implementation fEnableActionData is being set to FALSE, but I did not see how to get it to TRUE.  In my second test of the MSDN code the INSTALLMESAGE_PROGRESS Field[2] is set to 1.

    case 1: // action info.
        if (3 > cFields)
        {
            Trace2(REPORT_STANDARD, "INSTALLMESSAGE_PROGRESS - Invalid field count %d, '%ls'", cFields, wzMessage);
            ExitFunction();
        }
        //Trace3(REPORT_STANDARD, "INSTALLMESSAGE_PROGRESS - ACTION INFO - %d, %d, %d", iFields[1], iFields[2], iFields[3]);

        if (0 == iFields[2])
        {
            pContext->rgMsiProgress[pContext->dwCurrentProgressIndex].fEnableActionData = FALSE;
        }
        else
        {
            pContext->rgMsiProgress[pContext->dwCurrentProgressIndex].fEnableActionData = TRUE;
            pContext->rgMsiProgress[pContext->dwCurrentProgressIndex].dwStep = iFields[1];
        }
        break;

I finally got an implementation hack that seems to work by abending the effort to use INSTALLMESSAGE_ACTIONDATA in the CA loop, and moving the INSTALLMESSAGE_ACTIONSTART to the CA loop and formatting the 'description' field with the changing text that I want to display.  But this hack smells like the wrong approach, so I am interested in advice on how to get this working in a 'correct' way.

I am also curious if anyone using the WixComPlusExtension has noticed whether the ActionData portion to the Progress text is actually being displayed (with names of assemblies, or users, etc)?

If so is there something that I should have implemented in my mba to support this behavior?
Thanks for any advice!

Phill


More information about the wix-users mailing list