Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Progress bar with Custom Action


1 reply to this topic

SwatiBansal

SwatiBansal
  • Members
  • 24 posts

Posted 27 February 2006 - 05:32

Hi,
I have deferred custom actions. When they are executed, I need to increment the progress bar and show the action text displayed with progress bar. I added the text through the Action Text table and it is working fine. But the code which i added for Incrementing the progress bar is not working. I am posting the code please tell that what i am doing wrong.

function ProgressBar_Increment(hInstall)

NUMBER iResult;
HWND hRec, hProgressRec;
NUMBER nvBufferSize;

begin
hRec = MsiCreateRecord(3);
hProgressRec = MsiCreateRecord(3);

MsiRecordSetInteger(hRec, 1, 1);
MsiRecordSetInteger(hRec, 2, 1);
MsiRecordSetInteger(hRec, 3, 0);

iResult = MsiProcessMessage(hInstall, INSTALLMESSAGE_PROGRESS, hRec);

MsiRecordSetInteger(hProgressRec, 1, 2);
MsiRecordSetInteger(hProgressRec, 2, TickIncrement);
MsiRecordSetInteger(hProgressRec, 3, 0);

iResult = MsiProcessMessage(hInstall, INSTALLMESSAGE_PROGRESS, hProgressRec);

MsiCloseHandle(hRec);
MsiCloseHandle(hProgressRec);

end;

This function is called from a Custom Action which is executed for Immediate Execution before Setup Progress in UI sequence. Also, the SetupProgress dialog is subscribed to this custom action.

I read the help article "Adding Progress bar to Cutom ACtions" But could not get it completely.

The custom actions which are actually doing the changes like Copying files etc come later in the sequence. Is this wrong. Do I have to write this code in each and every Custom Action. Please help. This is really confusing.

Swati


Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 27 February 2006 - 22:37

What's the value of TickIncrement?
Remember that the progress is integrated with the progress increments of the rest of the installation. That part can be very high (I believe an increment of 1 equals 1 KB or 1 registry value).
BTW That's why you have to 'reserve' your increments in advance, Windows Installer has to know in advance how many ticks are coming, so it can calculate how many ticks are required to advance the progress by one block.