Dariel,

Here are two c# functions that should help you work with the progress bar from 
a managed custom action.  If you're using unmanaged c++ code, refer to 
WcaProgressMessage as Rob suggested.

public static MessageResult ResetProgressBar(Session session, int 
totalStatements)
{
  var record = new Record(3);
  record[1] = 0; // "Reset" message
  record[2] = totalStatements;  // total ticks
  record[3] = 0; // forward motion
  return session.Message(InstallMessage.Progress, record);
}

public static MessageResult IncrementProgressBar(Session session)
{
  var record = new Record(3);
  record[1] = 2; // "ProgressReport" message
  record[2] = 1; // ticks to increment
  record[3] = 0; // ignore
  return session.Message(InstallMessage.Progress, record);
}


If you get a result of MessageResult.Cancel, it means the user pressed the 
cancel button on the progress dialog and you'll want to exit your custom action 
cleanly with ActionResult.UserExit.



Matt Johnson MCPD, MCTS, MCSD, MCDBA
Director of Application Development
Time America, Inc.
ma...@timeamerica.com | www.timeamerica.com

-----Original Message-----
From: Matt Johnson [mailto:ma...@timeamerica.com] 
Sent: Sunday, May 02, 2010 8:26 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Update progress bar from deferred custom action

Dariel, I'm doing this in a managed custom action (c#).  I'll post it  
here first thing tomorrow.

-Matt

Sent from my iPhone

On May 2, 2010, at 7:52 PM, "Rob Mensching" <r...@robmensching.com>  
wrote:

> The WiX toolset uses WcaProgressMessage() to do this. There are a  
> number of
> examples in the WiX custom action code using it.
>
> On Sun, May 2, 2010 at 7:03 PM, Dariel Marlow  
> <dmar...@microsoft.com> wrote:
>
>> I've followed the example on MSDN (
>> http://msdn.microsoft.com/en-us/library/aa367525(VS.85).aspx) about  
>> adding
>> custom actions to the progress bar, however, only the action text  
>> updates.
>> The progress bar does not move. Does anyone have an example of how  
>> to update
>> the progress bar from within a custom action?
>>
>> Thanks,
>>
>> Dariel
>>
>> --- 
>> --- 
>> --- 
>> ---------------------------------------------------------------------
>> _______________________________________________
>> WiX-users mailing list
>> WiX-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/wix-users
>>
>>
>
>
> -- 
> virtually, Rob Mensching - http://RobMensching.com LLC
> --- 
> --- 
> --- 
> ---------------------------------------------------------------------
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to