user2392468
user2392468

Reputation: 71

Update progress text while executing one custom action?

I want to update the progress text when executing one custom action. I have done the following things:

  1. declare my custom action to be deferred
  2. use below code to reset the progress bar

    private static void ResetProgress(Session session)
    {
        Record record = new Record(4);
        record[1] = "0";
        record[2] = "1000";
        record[3] = "0";
        record[4] = "0";
        session.Message(InstallMessage.Progress, record);
    }
    
  3. use below code to move the progress bar:

    private static void NumberOfTicksPerActionData(Session session, int ticks)
    {
        Record record = new Record(3);
        record[1] = "1";
        record[2] = ticks.ToString();
        record[3] = "1";
        session.Message(InstallMessage.Progress, record);
    }
    
  4. use below code to update the progress text:

    private static void DisplayActionData(Session session, string message)
    {
        Record record = new Record(1);
        record[1] = message;
        session.Message(InstallMessage.ActionData, record);
    }
    

However, I have failed to update the progress text and move the progress bar.

Any one can help me? If this custom action needs to process sequential actions, how should I update the status on the progress bar while executing this custom action.

I know that I can use

<ProgressText Action="UnzipDataBase">Now installing database files, this may take a few minutes!</ProgressText>

to set progress text to tell what this custom action is doing. But how to update the status while executing this custom action?

Upvotes: 7

Views: 1893

Answers (1)

IlirB
IlirB

Reputation: 1430

Did you put the ProgressText inside UI element? For example

<UI>
   <ProgressText Action="UnzipDataBase">Now installing database files, this may take a few minutes!</ProgressText>
</UI>

Upvotes: 1

Related Questions